X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fsent_subfolders%2Fsetup.php;h=c8dba2e5fd3484565a58df4af0762353c9571bc0;hb=45cdd1b5d629eea0ec39342e0417a88903e82511;hp=65e1c33d8ce57dd3349e7a4cd4e51c084d059e75;hpb=a3add160842395ccb4612001f9781056ec1d073a;p=squirrelmail.git diff --git a/plugins/sent_subfolders/setup.php b/plugins/sent_subfolders/setup.php index 65e1c33d..c8dba2e5 100644 --- a/plugins/sent_subfolders/setup.php +++ b/plugins/sent_subfolders/setup.php @@ -47,10 +47,14 @@ function squirrelmail_plugin_init_sent_subfolders() { } function sent_subfolders_check_handleAsSent() { - global $handleAsSent_result, $sent_subfolders_base; - global $use_sent_subfolders; + global $handleAsSent_result, $sent_subfolders_base, + $use_sent_subfolders; + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { + global $_SESSION; + } $sent_subfolders_base = 'INBOX.Sent'; $args = func_get_arg(0); + $delimiter = $_SESSION['delimiter']; /* Only check the folder string if we have been passed a mailbox. */ if ($use_sent_subfolders && (count($args) > 1)) { @@ -68,8 +72,8 @@ function sent_subfolders_check_handleAsSent() { } function sent_subfolders_load_prefs() { - global $use_sent_subfolders; - global $sent_subfolders_setting, $sent_subfolders_base; + global $use_sent_subfolders, $data_dir, $username, + $sent_subfolders_setting, $sent_subfolders_base; $use_sent_subfolders = getPref ($data_dir, $username, 'use_sent_subfolders', SMPREF_OFF); @@ -82,7 +86,13 @@ function sent_subfolders_load_prefs() { } function sent_subfolders_optpage_loadhook_folders() { - global $optpage_data, $username, $key, $imapServerAddress, $imapPort; + global $optpage_data, $imapServerAddress, $imapPort; + + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { + global $_SESSION, $_COOKIE; + } + $username = $_SESSION['username']; + $key = $_COOKIE['key']; /* Get some imap data we need later. */ $imapConnection = @@ -144,10 +154,17 @@ function save_option_sent_subfolders_setting($option) { } function sent_subfolders_update_sentfolder() { - global $sent_folder, $delimiter, $auto_create_special, $auto_create_done; + global $sent_folder, $auto_create_special, $auto_create_done; global $sent_subfolders_base, $sent_subfolders_setting; - global $username, $data_dir, $key, $imapServerAddress, $imapPort; - global $use_sent_subfolders, $move_to_sent; + global $data_dir, $imapServerAddress, $imapPort; + global $use_sent_subfolders, $move_to_sent, $imap_server_type; + + if ( (float)substr(PHP_VERSION,0,3) < 4.1 ) { + global $_SESSION, $_COOKIE; + } + $username = $_SESSION['username']; + $key = $_COOKIE['key']; + $delimiter = $_SESSION['delimiter']; if ($use_sent_subfolders || $move_to_sent) { $year = date('Y'); @@ -160,16 +177,24 @@ function sent_subfolders_update_sentfolder() { Multiple year holders with messages in it. level 1. Multiple year folders with holders in it. level 2. */ +/* + if( $imap_server_type == 'uw' ) { + $cnd_delimiter = ''; + } else { + $cnd_delimiter = $delimiter; + } +*/ + $cnd_delimiter = $delimiter; + switch ($sent_subfolders_setting) { case SMPREF_SENT_SUBFOLDERS_YEARLY: $level = 1; - $sent_subfolder = $sent_subfolders_base + $sent_subfolder = $sent_subfolders_base . $cnd_delimiter . $year; - $year_folder = $sent_subfolder; break; case SMPREF_SENT_SUBFOLDERS_QUARTERLY: $level = 2; - $sent_subfolder = $sent_subfolders_base + $sent_subfolder = $sent_subfolders_base . $cnd_delimiter . $year . $delimiter . $quarter; $year_folder = $sent_subfolders_base @@ -177,7 +202,7 @@ function sent_subfolders_update_sentfolder() { break; case SMPREF_SENT_SUBFOLDERS_MONTHLY: $level = 2; - $sent_subfolder = $sent_subfolders_base + $sent_subfolder = $sent_subfolders_base . $cnd_delimiter . $year . $delimiter . $month; $year_folder = $sent_subfolders_base . $year;