X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fmail_fetch%2Foptions.php;h=7dd615d1eb1644909a2a3913409e12a2f7a366ea;hp=55f0077c2e66a373108e0d27bd94cd0c09824665;hb=8d6a115b0ef06dbcf9b149ba2509208f09b3a2ab;hpb=d622d38af6c2101b24c27851caf30866070c90c1
diff --git a/plugins/mail_fetch/options.php b/plugins/mail_fetch/options.php
index 55f0077c..7dd615d1 100644
--- a/plugins/mail_fetch/options.php
+++ b/plugins/mail_fetch/options.php
@@ -1,27 +1,93 @@
'on' ) SetPref($data_dir,$username,"mailfetch_cypher", 'on');
+ setPref($data_dir,$username,"mailfetch_lmos_$mf_sn",(isset($mf_lmos)?$mf_lmos:""));
+ setPref($data_dir,$username,"mailfetch_login_$mf_sn",(isset($mf_login)?$mf_login:""));
+ setPref($data_dir,$username,"mailfetch_fref_$mf_sn",(isset($mf_fref)?$mf_fref:""));
+ setPref($data_dir,$username,"mailfetch_subfolder_$mf_sn",(isset($mf_subfolder)?$mf_subfolder:""));
+ $mf_sn++;
+ setPref($data_dir,$username,'mailfetch_server_number', $mf_sn);
+ $mf_action = 'config';
+ break;
+ case 'confirm_modify':
+ //modify a server
+ if (!isset($mf_server)) return;
+ setPref($data_dir,$username,"mailfetch_server_$mf_sn", (isset($mf_server)?$mf_server:""));
+ setPref($data_dir,$username,"mailfetch_alias_$mf_sn", (isset($mf_alias)?$mf_alias:""));
+ setPref($data_dir,$username,"mailfetch_user_$mf_sn",(isset($mf_user)?$mf_user:""));
+ setPref($data_dir,$username,"mailfetch_pass_$mf_sn",(isset($mf_pass)?encrypt( $mf_pass ) :""));
+ if( $mf_cypher <> 'on' ) setPref($data_dir,$username,"mailfetch_cypher", 'on');
+ setPref($data_dir,$username,"mailfetch_lmos_$mf_sn",(isset($mf_lmos)?$mf_lmos:""));
+ setPref($data_dir,$username,"mailfetch_login_$mf_sn",(isset($mf_login)?$mf_login:""));
+ setPref($data_dir,$username,"mailfetch_fref_$mf_sn",(isset($mf_fref)?$mf_fref:""));
+ setPref($data_dir,$username,"mailfetch_subfolder_$mf_sn",(isset($mf_subfolder)?$mf_subfolder:""));
+ $mf_action = 'config';
+ break;
+ case 'confirm_delete':
+ //delete a server
+ $mailfetch_server_number = getPref($data_dir, $username, "mailfetch_server_number");
+ if ($mf_sn+1==$mailfetch_server_number) {
+ //is the last server, whe can only decrase $mailfetch_server_number
+ $mailfetch_server_number--;
+ setPref($data_dir,$username,"mailfetch_server_number", $mailfetch_server_number);
+ } else {
+ //if not the last, all the sequel server come up one step
+ //then whe decrase $mailfetch_server_number
+ $mailfetch_server_number--;
+ for ($i=$mf_sn;$i<$mailfetch_server_number;$i++) {
+ $tmp=$i+1;
+ setPref($data_dir,$username,"mailfetch_server_$i", getPref($data_dir, $username, "mailfetch_server_$tmp"));
+ setPref($data_dir,$username,"mailfetch_alias_$i", getPref($data_dir, $username, "mailfetch_alias_$tmp"));
+ setPref($data_dir,$username,"mailfetch_user_$i", getPref($data_dir, $username, "mailfetch_user_$tmp"));
+ setPref($data_dir,$username,"mailfetch_pass_$i",(isset($mf_pass)?encrypt( $mf_pass ) :""));
+ // if( $mf_cypher <> 'on' ) setPref($data_dir,$username,"mailfetch_cypher", 'on');
+ setPref($data_dir,$username,"mailfetch_lmos_$i", getPref($data_dir, $username, "mailfetch_lmos_$tmp"));
+ setPref($data_dir,$username,"mailfetch_login_$i", getPref($data_dir, $username, "mailfetch_login_$tmp"));
+ setPref($data_dir,$username,"mailfetch_fref_$i", getPref($data_dir, $username, "mailfetch_fref_$tmp"));
+ setPref($data_dir,$username,"mailfetch_subfolder_$i", getPref($data_dir, $username, "mailfetch_subfolder_$tmp"));
+ }
+ setPref($data_dir,$username,"mailfetch_server_number", $mailfetch_server_number);
+ }
+ $mf_action = 'config';
+ break;
+ }
+
+ $mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number', 0);
+ $mailfetch_cypher = getPref( $data_dir, $username, 'mailfetch_cypher' );
+ 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_alias_[$i] = getPref($data_dir, $username, "mailfetch_alias_$i");
@@ -36,162 +102,245 @@
}
- echo '
';
- } else { //unsupported action
- echo '' .
- "" . _("Fetching Servers") . ' |
' .
- '
' .
- '' .
- "" . _("Undefined Function") . ' |
' .
- "" .
- _("Hey! Wath do You are looking for?") . ' |
';
+ echo ''.
+ ' '.
+ ' '.
+ '';
+ } else {
+ echo _("No-one server in use. Try to add.");
}
+ echo '';
+ break;
+ case _("Delete"): //erase confirmation about a server
+ echo html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Fetching Servers") . '', 'center', $color[0] )
+ ) ,
+ 'center', '', 'width="95%" cols="1" cellpadding="5" cellspacing="1"' ) .
+ '
' .
+ html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Confirm Deletion of a Server") . '', 'center', $color[9] )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'td',
+ "" .
+ '' .
+ '
' . _("Selected Server:") . " $mailfetch_server_[$mf_sn]
" .
+ _("Confirm delete of selected server?") . '
' .
+ '' .
+ '
' ,
+ 'center', $color[9] )
+ ) ,
+ 'center', '', 'width="70%" cols="1" cellpadding="5" cellspacing="1"' );
+ break; //modify a server
+ case _("Modify"):
+ echo html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Fetching Servers") . '', 'center', $color[0] )
+ ) ,
+ 'center', '', 'width="95%" cols="1" cellpadding="5" cellspacing="1"' ) .
+ '
' .
+ html_tag( 'table', '', 'center', '', 'width="70%" cols="1" cellpadding="5" cellspacing="1"' ) .
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Mofify a Server") . '', 'center', $color[9] )
+ ) .
+ html_tag( 'tr' ) .
+ html_tag( 'td', '', 'center', $color[0] ) .
+
+ "" .
+ '' .
+ html_tag( 'table' ) .
+ html_tag( 'tr',
+ html_tag( 'th', _("Server:"), 'right' ) .
+ html_tag( 'td', '', 'left' )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'th', _("Alias:"), 'right' ) .
+ html_tag( 'td', '', 'left' )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'th', _("Username:"), 'right' ) .
+ html_tag( 'td', '', 'left' )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'th', _("Password:"), 'right' ) .
+ html_tag( 'td', '', 'left' )
+ ) .
+ html_tag( 'tr' ) .
+ html_tag( 'th', _("Store in Folder:"), 'right' ) .
+ html_tag( 'td', '', 'left' );
+
+ $imapConnection = sqimap_login ($username, $key, $imapServerAddress, $imapPort, 0);
+ $boxes = sqimap_mailbox_list($imapConnection);
+ echo '' .
+
+ html_tag( 'tr',
+ html_tag( 'th', ' ', 'right' ) .
+ html_tag( 'td',
+ '' . _("Leave Mail on Server") ,
+ 'left' )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'th', ' ', 'right' ) .
+ html_tag( 'td',
+ '' . _("Check mail during login"),
+ 'left' )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'th', ' ', 'right' ) .
+ html_tag( 'td',
+ '' . _("Check mail during folder refresh") ,
+ 'left' )
+ ) .
+ html_tag( 'tr',
+ html_tag( 'td',
+ '',
+ 'center', '', 'colspan="2"' )
+ ) .
+
+ '';
+ break;
+ default: //unsupported action
+ echo '' .
+ html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Fetching Servers") . '', 'center', $color[0] )
+ ) ,
+ 'center', '', 'width="95%" cols="1"' ) .
+ '
' .
+ html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', '' . _("Undefined Function") . '', 'center', $color[9] ) .
+ html_tag( 'td', '' . _("Hey! Wath do You are looking for?") . '', 'center', $color[0] )
+ ) ,
+ 'center', '', 'width="70%" cols="1"' );
+ }
?>
-