ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:24.87 GB of 70.42 GB (35.31%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ http/ mail.1/ program/ steps/ settings/ - drwxr-xr-x

Directory:
Viewing file:     save_folder.inc (6.52 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 +-----------------------------------------------------------------------+
 | program/steps/settings/save_folder.inc                                |
 |                                                                       |
 | This file is part of the Roundcube Webmail client                     |
 | Copyright (C) 2005-2009, The Roundcube Dev Team                       |
 | Licensed under the GNU GPL                                            |
 |                                                                       |
 | PURPOSE:                                                              |
 |   Provide functionality to create/edit a folder                       |
 |                                                                       |
 +-----------------------------------------------------------------------+
 | Author: Aleksander Machniak <alec@alec.pl>                            |
 +-----------------------------------------------------------------------+

 $Id: save_folder.inc 5096 2011-08-19 08:07:05Z alec $

*/

// WARNING: folder names in UI are encoded with RCMAIL_CHARSET

// init IMAP connection
$RCMAIL->imap_connect();


$name trim(get_input_value('_name'RCUBE_INPUT_POSTtrue));
$old  trim(get_input_value('_mbox'RCUBE_INPUT_POSTtrue));
$path trim(get_input_value('_parent'RCUBE_INPUT_POSTtrue));

$name_imap rcube_charset_convert($nameRCMAIL_CHARSET'UTF7-IMAP');
$old_imap  rcube_charset_convert($oldRCMAIL_CHARSET'UTF7-IMAP');
// $path is in UTF7-IMAP already

$delimiter $IMAP->get_hierarchy_delimiter();
$options strlen($old_imap) ? rcmail_folder_options($old_imap) : array();

// Folder name checks
if ($options['protected'] || $options['norename']) {
}
else if (!
strlen($name)) {
    
$error rcube_label('cannotbeempty');
}
else if (
mb_strlen($name) > 128) {
    
$error rcube_label('nametoolong');
}
else {
    
// these characters are problematic e.g. when used in LIST/LSUB
    
foreach (array($delimiter'%''*') as $char) {
        if (
strpos($name$delimiter) !== false) {
            
$error rcube_label('forbiddencharacter') . " ($char)";
            break;
        }
    }
}

if (
$error) {
    
$OUTPUT->command('display_message'$error'error');
}
else {
    if (
$options['protected'] || $options['norename']) {
        
$name_imap $old_imap;
    }
    else if (
strlen($path)) {
        
$name_imap $path $delimiter $name_imap;
    }
    else {
        
$name_imap $RCMAIL->imap->mod_mailbox($name_imap'in');
    }
}

// Check access rights to the parent folder
if (!$error && strlen($path) && (!strlen($old_imap) || $old_imap != $name_imap)) {
    
$parent_opts $RCMAIL->imap->mailbox_info($path);
    if (
$parent_opts['namespace'] != 'personal'
        
&& (empty($parent_opts['rights']) || !preg_match('/[ck]/'implode($parent_opts)))
    ) {
        
$error rcube_label('parentnotwritable');
    }
}

if (!
$error) {
    
$folder['name']     = $name_imap;
    
$folder['oldname']  = $old_imap;
    
$folder['class']    = '';
    
$folder['options']  = $options;
    
$folder['settings'] = array(
        
// List view mode: 0-list, 1-threads
        
'view_mode'   => (int) get_input_value('_viewmode'RCUBE_INPUT_POST),
        
'sort_column' => get_input_value('_sortcol'RCUBE_INPUT_POST),
        
'sort_order'  => get_input_value('_sortord'RCUBE_INPUT_POST),
    );
}

// create a new mailbox
if (!$error && !strlen($old)) {

    
$folder['subscribe'] = true;

    
$plugin $RCMAIL->plugins->exec_hook('folder_create', array('record' => $folder));

    
$folder $plugin['record'];

    if (!
$plugin['abort']) {
        
$created $IMAP->create_mailbox($folder['name'], $folder['subscribe']);
    }
    else {
        
$created $plugin['result'];
    }

    if (
$created) {
        
// Save folder settings
        
if (isset($_POST['_viewmode'])) {
            
$a_threaded = (array) $RCMAIL->config->get('message_threading', array());

            if (
$_POST['_viewmode'])
                
$a_threaded[$folder['name']] = true;
            else
                unset(
$a_threaded[$folder['name']]);

            
$RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
        }

        
rcmail_update_folder_row($folder['name'], null$folder['subscribe'], $folder['class']);
        
$OUTPUT->show_message('foldercreated''confirmation');
        
// reset folder preview frame
        
$OUTPUT->command('subscription_select');
        
$OUTPUT->send('iframe');
    }
    else {
        
// show error message
        
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving''error'nullfalse);
    }
}

// update a mailbox
else if (!$error) {
    
$plugin $RCMAIL->plugins->exec_hook('folder_update', array('record' => $folder));

    
$folder $plugin['record'];
    
$rename = ($folder['oldname'] != $folder['name']);

    if (!
$plugin['abort']) {
        if (
$rename) {
            
$updated $RCMAIL->imap->rename_mailbox($folder['oldname'], $folder['name']);
        }
        else {
            
$updated true;
        }
    }
    else {
        
$updated $plugin['result'];
    }

    if (
$updated) {
        
// Update folder settings,
        
if (isset($_POST['_viewmode'])) {
            
$a_threaded = (array) $RCMAIL->config->get('message_threading', array());

            
// In case of name change update names of childrens in settings
            
if ($rename) {
                
$oldprefix  '/^' preg_quote($folder['oldname'] . $delimiter'/') . '/';
                foreach (
$a_threaded as $key => $val) {
                    if (
$key == $folder['oldname']) {
                        unset(
$a_threaded[$key]);
                    }
                    else if (
preg_match($oldprefix$key)) {
                        unset(
$a_threaded[$key]);
                          
$a_threaded[preg_replace($oldprefix$folder['name'].$delimiter$key)] = true;
                    }
                }
            }
            if (
$_POST['_viewmode'])
                
$a_threaded[$folder['name']] = true;
            else
                unset(
$a_threaded[$folder['name']]);

            
$RCMAIL->user->save_prefs(array('message_threading' => $a_threaded));
        }

        
$OUTPUT->show_message('folderupdated''confirmation');
        if (
$rename) {
            
rcmail_update_folder_row($folder['name'], $folder['oldname'], $folder['subscribe'], $folder['class']);
            
$OUTPUT->send('iframe');
        }
    }
    else {
        
// show error message
        
$OUTPUT->show_message($plugin['message'] ? $plugin['message'] : 'errorsaving''error'nullfalse);
    }
}

rcmail_overwrite_action('edit-folder');
Command:
Quick Commands:
Upload:
[OK] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [OK]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.1742 seconds