From 2128bbc6c5a178906d5d7b925bcd6d0652f47f52 Mon Sep 17 00:00:00 2001 From: kink Date: Sat, 5 Aug 2006 14:49:49 +0000 Subject: [PATCH] no need to pass $key variable to sqimap_login anymore git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11477 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/filters/filters.php | 8 +++----- plugins/filters/options.php | 5 +---- plugins/filters/spamoptions.php | 7 ++----- plugins/info/options.php | 4 +--- plugins/mail_fetch/fetch.php | 7 ++----- plugins/mail_fetch/functions.php | 14 ++++---------- plugins/mail_fetch/options.php | 9 +++------ plugins/message_details/message_details_bottom.php | 6 ++---- plugins/sent_subfolders/setup.php | 7 ++----- plugins/spamcop/spamcop.php | 4 +--- 10 files changed, 21 insertions(+), 50 deletions(-) diff --git a/plugins/filters/filters.php b/plugins/filters/filters.php index 09df3f7f..f10e0646 100644 --- a/plugins/filters/filters.php +++ b/plugins/filters/filters.php @@ -192,10 +192,8 @@ function filters_bulkquery($filters, $IPs) { */ function start_filters($hook_args) { global $imapServerAddress, $imapPort, $imap_stream, $imapConnection, - $UseSeparateImapConnection, $AllowSpamFilters, $filter_inbox_count; - - sqgetGlobalVar('username', $username, SQ_SESSION); - sqgetGlobalVar('key', $key, SQ_COOKIE); + $UseSeparateImapConnection, $AllowSpamFilters, $filter_inbox_count, + $username; /** * check hook that calls filtering. If filters are called by right_main_after_header, @@ -230,7 +228,7 @@ function start_filters($hook_args) { // Also check if we are forced to use a separate IMAP connection if ((!isset($imap_stream) && !isset($imapConnection)) || $UseSeparateImapConnection ) { - $stream = sqimap_login($username, $key, $imapServerAddress, + $stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10); $previously_connected = false; } else if (isset($imapConnection)) { diff --git a/plugins/filters/options.php b/plugins/filters/options.php index e5a67e31..e9536d2e 100644 --- a/plugins/filters/options.php +++ b/plugins/filters/options.php @@ -21,9 +21,6 @@ include_once(SM_PATH . 'plugins/filters/filters.php'); displayPageHeader($color, 'None'); /* get globals */ -sqgetGlobalVar('username', $username, SQ_SESSION); -sqgetGlobalVar('key', $key, SQ_COOKIE); -sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); sqgetGlobalVar('theid', $theid); @@ -128,7 +125,7 @@ if (sqgetGlobalVar('filter_submit',$filter_submit,SQ_POST)) { if (isset($action) && ($action == 'add' || $action == 'edit')) { - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); $boxes = sqimap_mailbox_list($imapConnection); for ($a = 0, $cnt = count($boxes); $a < $cnt; $a++) { diff --git a/plugins/filters/spamoptions.php b/plugins/filters/spamoptions.php index b228298f..d644fde7 100644 --- a/plugins/filters/spamoptions.php +++ b/plugins/filters/spamoptions.php @@ -20,9 +20,6 @@ include_once(SM_PATH . 'functions/imap_messages.php'); include_once(SM_PATH . 'plugins/filters/filters.php'); /* get globals */ -sqgetGlobalVar('username', $username, SQ_SESSION); -sqgetGlobalVar('key', $key, SQ_COOKIE); -sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); sqgetGlobalVar('action', $action, SQ_GET); @@ -80,7 +77,7 @@ if ($SpamFilters_YourHop == ' ') { if (isset($action) && $action == 'spam') { - $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); + $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); $boxes = sqimap_mailbox_list($imapConnection); sqimap_logout($imapConnection); $numboxes = count($boxes); @@ -215,4 +212,4 @@ if (isset($action) && $action == 'spam') { echo ''; } ?> - \ No newline at end of file + diff --git a/plugins/info/options.php b/plugins/info/options.php index 85677c19..8da3dd9e 100644 --- a/plugins/info/options.php +++ b/plugins/info/options.php @@ -42,8 +42,6 @@ if (! is_plugin_enabled('info')) { } /* GLOBALS */ -sqgetGlobalVar('username', $username, SQ_SESSION); - sqgetGlobalVar('submit', $submit, SQ_POST); for($i = 0; $i <= 9; $i++){ @@ -207,4 +205,4 @@ sqimap_logout($imap_stream); */ do_hook('info_bottom'); ?> - \ No newline at end of file + diff --git a/plugins/mail_fetch/fetch.php b/plugins/mail_fetch/fetch.php index 7bf720b1..c22928fc 100644 --- a/plugins/mail_fetch/fetch.php +++ b/plugins/mail_fetch/fetch.php @@ -22,9 +22,6 @@ include_once(SM_PATH . 'plugins/mail_fetch/class.POP3.php'); include_once(SM_PATH . 'plugins/mail_fetch/functions.php' ); /* globals */ -sqgetGlobalVar('username', $username, SQ_SESSION); -sqgetGlobalVar('key', $key, SQ_COOKIE); -sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); /* end globals */ @@ -173,7 +170,7 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) { } Mail_Fetch_Status(_("Opening IMAP server")); - $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); + $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10); // check if destination folder is not set, is not subscribed and is not \noselect folder if($mailfetch_subfolder == '' || @@ -324,4 +321,4 @@ for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) { ?> - \ No newline at end of file + diff --git a/plugins/mail_fetch/functions.php b/plugins/mail_fetch/functions.php index 80223967..bedab89f 100644 --- a/plugins/mail_fetch/functions.php +++ b/plugins/mail_fetch/functions.php @@ -45,15 +45,13 @@ if (file_exists(SM_PATH . 'config/mail_fetch_config.php')) { * @private */ function mail_fetch_load_pref_function() { - global $data_dir; + global $data_dir, $username; global $mailfetch_server_number; global $mailfetch_cypher, $mailfetch_port_; global $mailfetch_server_,$mailfetch_alias_,$mailfetch_user_,$mailfetch_pass_; global $mailfetch_lmos_, $mailfetch_uidl_, $mailfetch_login_, $mailfetch_fref_; global $PHP_SELF; - sqgetGlobalVar('username', $username, SQ_SESSION); - if( stristr( $PHP_SELF, 'mail_fetch' ) ) { $mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number', 0); $mailfetch_cypher = getPref($data_dir, $username, 'mailfetch_cypher', 'on' ); @@ -82,10 +80,7 @@ function mail_fetch_login_function() { //include_once (SM_PATH . 'include/validate.php'); include_once (SM_PATH . 'functions/imap_general.php'); - global $data_dir, $imapServerAddress, $imapPort; - - sqgetGlobalVar('username', $username, SQ_SESSION); - sqgetGlobalVar('key', $key, SQ_COOKIE); + global $username, $data_dir, $imapServerAddress, $imapPort; $mailfetch_newlog = getPref($data_dir, $username, 'mailfetch_newlog'); @@ -136,7 +131,7 @@ function mail_fetch_login_function() { continue; } - $imap_stream = sqimap_login($username, $key, $imapServerAddress, $imapPort, 10); + $imap_stream = sqimap_login($username, false, $imapServerAddress, $imapPort, 10); $Count = $pop3->login($mailfetch_user, $mailfetch_pass); if (($Count == false || $Count == -1) && $pop3->ERROR != '') { @@ -228,9 +223,8 @@ function mail_fetch_login_function() { * Internal function used to detect new logins */ function mail_fetch_setnew_function() { - global $data_dir; + global $data_dir, $username; - sqgetGlobalVar('username', $username, SQ_SESSION); setPref( $data_dir, $username, 'mailfetch_newlog', 'on' ); } diff --git a/plugins/mail_fetch/options.php b/plugins/mail_fetch/options.php index 6cea5271..caf1f7ff 100644 --- a/plugins/mail_fetch/options.php +++ b/plugins/mail_fetch/options.php @@ -20,9 +20,6 @@ require('../../include/init.php'); include_once(SM_PATH . 'functions/imap_general.php'); /* globals */ -sqgetGlobalVar('username', $username, SQ_SESSION); -sqgetGlobalVar('key', $key, SQ_COOKIE); -sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); if(!sqgetGlobalVar('mf_cypher', $mf_cypher, SQ_POST)) { @@ -212,7 +209,7 @@ switch( $mf_action ) { html_tag( 'tr' ) . html_tag( 'th', _("Store in Folder:"), 'right' ) . html_tag( 'td', '', 'left' ); - $imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0); + $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0); $boxes = sqimap_mailbox_list($imapConnection); echo ''; $selected = 0; @@ -386,4 +383,4 @@ switch( $mf_action ) { 'center', '', 'width="70%"' ); } ?> - \ No newline at end of file + diff --git a/plugins/message_details/message_details_bottom.php b/plugins/message_details/message_details_bottom.php index b6d897c2..25fc0090 100644 --- a/plugins/message_details/message_details_bottom.php +++ b/plugins/message_details/message_details_bottom.php @@ -107,12 +107,10 @@ function CalcEntity($entString, $direction) { * @access public */ function get_message_details($mailbox, $passed_id, $stripHTML=FALSE) { - global $imapServerAddress, $imapPort, $color,$msgd_8bit_in_hex; + global $imapServerAddress, $imapPort, $color,$msgd_8bit_in_hex, $username; $returnValue = ''; - sqgetGlobalVar('username', $username, SQ_SESSION); - $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); $read = sqimap_mailbox_select($imapConnection, $mailbox); $body = sqimap_run_command($imapConnection, "FETCH $passed_id RFC822",true, $response, $readmessage, TRUE); @@ -368,4 +366,4 @@ ECHO; } return $returnValue; } -?> \ No newline at end of file +?> diff --git a/plugins/sent_subfolders/setup.php b/plugins/sent_subfolders/setup.php index 53d17d14..4ca648b3 100644 --- a/plugins/sent_subfolders/setup.php +++ b/plugins/sent_subfolders/setup.php @@ -102,9 +102,7 @@ function sent_subfolders_load_prefs() { * Adds sent_subfolders options in folder preferences */ function sent_subfolders_optpage_loadhook_folders() { - global $optpage_data, $imapServerAddress, $imapPort, $show_contain_subfolders_option; - - sqgetGlobalVar('username', $username, SQ_SESSION); + global $username, $optpage_data, $imapServerAddress, $imapPort, $show_contain_subfolders_option; /* Get some imap data we need later. */ $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); @@ -190,12 +188,11 @@ function save_option_sent_subfolders_setting($option) { * creates required imap folders */ function sent_subfolders_update_sentfolder() { - global $sent_folder; + global $sent_folder, $username; global $sent_subfolders_base, $sent_subfolders_setting; global $data_dir, $imapServerAddress, $imapPort, $color; global $use_sent_subfolders, $move_to_sent; - sqgetGlobalVar('username', $username, SQ_SESSION); sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION); if ($use_sent_subfolders || $move_to_sent) { diff --git a/plugins/spamcop/spamcop.php b/plugins/spamcop/spamcop.php index f27e8b6e..b72ee0cb 100644 --- a/plugins/spamcop/spamcop.php +++ b/plugins/spamcop/spamcop.php @@ -25,8 +25,6 @@ include_once(SM_PATH . 'plugins/spamcop/functions.php'); /* GLOBALS */ -sqgetGlobalVar('username', $username, SQ_SESSION); - sqgetGlobalVar('mailbox', $mailbox, SQ_GET); sqgetGlobalVar('passed_id', $passed_id, SQ_GET); sqgetGlobalVar('js_web', $js_web, SQ_GET); @@ -171,4 +169,4 @@ echo "

"; - \ No newline at end of file + -- 2.25.1