/**
* mail_fetch/fetch.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
+ * Copyright (c) 1999-2003 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Fetch code.
require_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
require_once(SM_PATH . 'functions/html.php' );
- /* globals */
- $username = $_SESSION['username'];
- $key = $_COOKIE['key'];
- $onetimepad = $_SESSION['onetimepad'];
- $delimter = $_SESSION['delimiter'];
+/* globals */
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
- /* This form, like the advanced identities form
- uses dynamic post variable names so we need
- to extract the whole $_POST array to make
- things work
- */
+/* FIXME: This form, like the advanced identities form
+ * uses dynamic post variable names so we need
+ * to extract the whole $_POST array to make
+ * things work
+ */
- extract($_POST);
- /* end globals */
+extract($_POST);
+/* end globals */
function Mail_Fetch_Status($msg) {
echo html_tag( 'table',
if ($mailfetch_server_number<1) $mailfetch_server_number=0;
for ($i=0;$i<$mailfetch_server_number;$i++) {
$mailfetch_server_[$i] = getPref($data_dir, $username, "mailfetch_server_$i");
+ $mailfetch_port_[$i] = getPref($data_dir, $username, "mailfetch_port_$i");
$mailfetch_alias_[$i] = getPref($data_dir, $username, "mailfetch_alias_$i");
$mailfetch_user_[$i] = getPref($data_dir, $username, "mailfetch_user_$i");
$mailfetch_pass_[$i] = getPref($data_dir, $username, "mailfetch_pass_$i");
'<option value="all" selected>..' . _("All") . "...\n";
for ($i=0;$i<$mailfetch_server_number;$i++) {
echo "<option value=\"$i\">" .
- (($mailfetch_alias_[$i]=='')?$mailfetch_server_[$i]:$mailfetch_alias_[$i]) .
+ htmlspecialchars((($mailfetch_alias_[$i]=='')?$mailfetch_server_[$i]:$mailfetch_alias_[$i])) .
'</option>' . "\n";
}
echo '</select>' .
if ($mailfetch_pass_[$i]=='') {
echo html_tag( 'tr',
html_tag( 'td', _("Password for") . ' <b>' .
- (($mailfetch_alias_[$i]=='')?$mailfetch_server_[$i]:$mailfetch_alias_[$i]) .
+ htmlspecialchars((($mailfetch_alias_[$i]=='')?$mailfetch_server_[$i]:$mailfetch_alias_[$i])) .
'</b>: ',
'right' ) .
- html_tag( 'td', '<input type="password" name="pass_' . $i , '">', 'left' )
+ html_tag( 'td', '<input type="password" name="pass_' . $i . '">', 'left' )
);
}
}
echo html_tag( 'tr',
html_tag( 'td', ' ' ) .
html_tag( 'td', '<input type=submit name=submit_mailfetch value="' . _("Fetch Mail"). '">', 'left' )
- );
-
+ ) .
'</table></form>';
exit();
}
for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
$mailfetch_server=$mailfetch_server_[$i_loop];
+ $mailfetch_port=$mailfetch_port_[$i_loop];
$mailfetch_user=$mailfetch_user_[$i_loop];
if ($mailfetch_pass_[$i_loop]=="") {
$tmp="pass_$i_loop";
html_tag( 'table',
html_tag( 'tr',
html_tag( 'td', '<b>' . _("Fetching from ") .
- (($mailfetch_alias_[$i_loop] == '')?$mailfetch_server:$mailfetch_alias_[$i_loop]) .
+ htmlspecialchars((($mailfetch_alias_[$i_loop] == '')?$mailfetch_server:$mailfetch_alias_[$i_loop])) .
'</b>',
'center' ) ,
'', $color[9] ) ,
flush();
- if (!$pop3->connect($mailfetch_server)) {
+ if (!$pop3->connect($mailfetch_server,$mailfetch_port)) {
Mail_Fetch_Status(_("Oops, ") . $pop3->ERROR );
continue;
}