options.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <?php
  2. /**
  3. * mail_fetch/options.php
  4. *
  5. * Setup of the mailfetch plugin.
  6. *
  7. * @copyright &copy; 1999-2006 The SquirrelMail Project Team
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. * @version $Id$
  10. * @package plugins
  11. * @subpackage mail_fetch
  12. */
  13. /**
  14. * Include the SquirrelMail initialization file.
  15. */
  16. require('../../include/init.php');
  17. include_once(SM_PATH . 'plugins/mail_fetch/functions.php' );
  18. include_once(SM_PATH . 'functions/imap_general.php');
  19. include_once(SM_PATH . 'functions/forms.php');
  20. /* globals */
  21. sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
  22. if(!sqgetGlobalVar('mf_cypher', $mf_cypher, SQ_POST)) {
  23. $mf_cypher = '';
  24. }
  25. if(! sqgetGlobalVar('mf_action', $mf_action, SQ_POST) ) {
  26. if (sqgetGlobalVar('mf_action_mod', $mf_action_mod, SQ_POST)) {
  27. $mf_action = 'Modify';
  28. }
  29. elseif (sqgetGlobalVar('mf_action_del', $mf_action_del, SQ_POST)) {
  30. $mf_action = 'Delete';
  31. }
  32. else {
  33. $mf_action = 'config';
  34. }
  35. }
  36. sqgetGlobalVar('mf_sn', $mf_sn, SQ_POST);
  37. sqgetGlobalVar('mf_server', $mf_server, SQ_POST);
  38. sqgetGlobalVar('mf_port', $mf_port, SQ_POST);
  39. sqgetGlobalVar('mf_alias', $mf_alias, SQ_POST);
  40. sqgetGlobalVar('mf_user', $mf_user, SQ_POST);
  41. sqgetGlobalVar('mf_pass', $mf_pass, SQ_POST);
  42. sqgetGlobalVar('mf_subfolder', $mf_subfolder, SQ_POST);
  43. sqgetGlobalVar('mf_login', $mf_login, SQ_POST);
  44. sqgetGlobalVar('mf_fref', $mf_fref, SQ_POST);
  45. sqgetGlobalVar('mf_lmos', $mf_lmos, SQ_POST);
  46. sqgetGlobalVar('mf_auth', $mf_auth, SQ_POST);
  47. sqgetGlobalVar('mf_type', $mf_type, SQ_POST);
  48. sqgetGlobalVar('submit_mailfetch', $submit_mailfetch, SQ_POST);
  49. /* end globals */
  50. displayPageHeader( $color, 'None' );
  51. switch( $mf_action ) {
  52. case 'add':
  53. if ($mf_sn<1) $mf_sn=0;
  54. if (!isset($mf_server)) return;
  55. setPref($data_dir,$username,"mailfetch_server_$mf_sn", (isset($mf_server)?$mf_server:""));
  56. setPref($data_dir,$username,"mailfetch_port_$mf_sn", (isset($mf_port)?$mf_port:110));
  57. setPref($data_dir,$username,"mailfetch_alias_$mf_sn", (isset($mf_alias)?$mf_alias:""));
  58. setPref($data_dir,$username,"mailfetch_user_$mf_sn",(isset($mf_user)?$mf_user:""));
  59. setPref($data_dir,$username,"mailfetch_pass_$mf_sn",(isset($mf_pass)?encrypt( $mf_pass ) :""));
  60. if( isset($mf_cypher) && $mf_cypher <> 'on' ) SetPref($data_dir,$username,'mailfetch_cypher', 'on');
  61. setPref($data_dir,$username,"mailfetch_lmos_$mf_sn",(isset($mf_lmos)?$mf_lmos:""));
  62. setPref($data_dir,$username,"mailfetch_login_$mf_sn",(isset($mf_login)?$mf_login:""));
  63. setPref($data_dir,$username,"mailfetch_fref_$mf_sn",(isset($mf_fref)?$mf_fref:""));
  64. setPref($data_dir,$username,"mailfetch_subfolder_$mf_sn",(isset($mf_subfolder)?$mf_subfolder:""));
  65. setPref($data_dir,$username,"mailfetch_auth_$mf_sn",(isset($mf_auth)?$mf_auth:MAIL_FETCH_AUTH_USER));
  66. setPref($data_dir,$username,"mailfetch_type_$mf_sn",(isset($mf_type)?$mf_type:MAIL_FETCH_USE_PLAIN));
  67. $mf_sn++;
  68. setPref($data_dir,$username,'mailfetch_server_number', $mf_sn);
  69. $mf_action = 'config';
  70. break;
  71. case 'confirm_modify':
  72. //modify a server
  73. if (!isset($mf_server)) return;
  74. setPref($data_dir,$username,"mailfetch_server_$mf_sn", (isset($mf_server)?$mf_server:""));
  75. setPref($data_dir,$username,"mailfetch_port_$mf_sn", (isset($mf_port)?$mf_port:110));
  76. setPref($data_dir,$username,"mailfetch_alias_$mf_sn", (isset($mf_alias)?$mf_alias:""));
  77. setPref($data_dir,$username,"mailfetch_user_$mf_sn",(isset($mf_user)?$mf_user:""));
  78. setPref($data_dir,$username,"mailfetch_pass_$mf_sn",(isset($mf_pass)?encrypt( $mf_pass ) :""));
  79. if( $mf_cypher <> 'on' ) setPref($data_dir,$username,"mailfetch_cypher", 'on');
  80. setPref($data_dir,$username,"mailfetch_lmos_$mf_sn",(isset($mf_lmos)?$mf_lmos:""));
  81. setPref($data_dir,$username,"mailfetch_login_$mf_sn",(isset($mf_login)?$mf_login:""));
  82. setPref($data_dir,$username,"mailfetch_fref_$mf_sn",(isset($mf_fref)?$mf_fref:""));
  83. setPref($data_dir,$username,"mailfetch_subfolder_$mf_sn",(isset($mf_subfolder)?$mf_subfolder:""));
  84. setPref($data_dir,$username,"mailfetch_auth_$mf_sn",(isset($mf_auth)?$mf_auth:MAIL_FETCH_AUTH_USER));
  85. setPref($data_dir,$username,"mailfetch_type_$mf_sn",(isset($mf_type)?$mf_type:MAIL_FETCH_USE_PLAIN));
  86. $mf_action = 'config';
  87. break;
  88. case 'confirm_delete':
  89. //delete a server
  90. $mailfetch_server_number = getPref($data_dir, $username, "mailfetch_server_number");
  91. if ($mf_sn+1==$mailfetch_server_number) {
  92. //is the last server, whe can only decrase $mailfetch_server_number
  93. $mailfetch_server_number--;
  94. setPref($data_dir,$username,"mailfetch_server_number", $mailfetch_server_number);
  95. } else {
  96. //if not the last, all the sequel server come up one step
  97. //then whe decrase $mailfetch_server_number
  98. $mailfetch_server_number--;
  99. for ($i=$mf_sn;$i<$mailfetch_server_number;$i++) {
  100. $tmp=$i+1;
  101. setPref($data_dir,$username,'mailfetch_server_'.$i,
  102. getPref($data_dir,$username, 'mailfetch_server_'.$tmp));
  103. setPref($data_dir,$username,'mailfetch_port_'.$i,
  104. getPref($data_dir,$username, 'mailfetch_port_'.$tmp));
  105. setPref($data_dir,$username,'mailfetch_alias_'.$i,
  106. getPref($data_dir,$username, 'mailfetch_alias_'.$tmp));
  107. setPref($data_dir,$username,'mailfetch_user_'.$i,
  108. getPref($data_dir,$username, 'mailfetch_user_'.$tmp));
  109. setPref($data_dir,$username,'mailfetch_pass_'.$i,
  110. getPref($data_dir,$username, 'mailfetch_pass_'.$tmp));
  111. setPref($data_dir,$username,'mailfetch_lmos_'.$i,
  112. getPref($data_dir,$username, 'mailfetch_lmos_'.$tmp));
  113. setPref($data_dir,$username,'mailfetch_login_'.$i,
  114. getPref($data_dir,$username, 'mailfetch_login_'.$tmp));
  115. setPref($data_dir,$username,'mailfetch_fref_'.$i,
  116. getPref($data_dir,$username, 'mailfetch_fref_'.$tmp));
  117. setPref($data_dir,$username,'mailfetch_subfolder_'.$i,
  118. getPref($data_dir,$username, 'mailfetch_subfolder_'.$tmp));
  119. setPref($data_dir,$username,'mailfetch_auth_'.$i,
  120. getPref($data_dir,$username, 'mailfetch_auth_'.$tmp,MAIL_FETCH_AUTH_USER));
  121. setPref($data_dir,$username,'mailfetch_type_'.$i,
  122. getPref($data_dir,$username, 'mailfetch_type_'.$tmp,MAIL_FETCH_USE_PLAIN));
  123. setPref($data_dir,$username,'mailfetch_uidl_'.$i,
  124. getPref($data_dir,$username, 'mailfetch_uidl_'.$tmp));
  125. }
  126. setPref($data_dir,$username,"mailfetch_server_number", $mailfetch_server_number);
  127. }
  128. $mf_action = 'config';
  129. break;
  130. }
  131. $mailfetch_server_number = getPref($data_dir, $username, 'mailfetch_server_number', 0);
  132. $mailfetch_cypher = getPref( $data_dir, $username, 'mailfetch_cypher' );
  133. if ($mailfetch_server_number<1) {
  134. $mailfetch_server_number=0;
  135. }
  136. for ($i=0;$i<$mailfetch_server_number;$i++) {
  137. $mailfetch_server_[$i] = getPref($data_dir, $username, "mailfetch_server_$i");
  138. $mailfetch_port_[$i] = getPref($data_dir, $username, "mailfetch_port_$i");
  139. $mailfetch_alias_[$i] = getPref($data_dir, $username, "mailfetch_alias_$i");
  140. $mailfetch_user_[$i] = getPref($data_dir, $username, "mailfetch_user_$i");
  141. $mailfetch_pass_[$i] = getPref($data_dir, $username, "mailfetch_pass_$i");
  142. $mailfetch_lmos_[$i] = getPref($data_dir, $username, "mailfetch_lmos_$i");
  143. $mailfetch_login_[$i] = getPref($data_dir, $username, "mailfetch_login_$i");
  144. $mailfetch_fref_[$i] = getPref($data_dir, $username, "mailfetch_fref_$i");
  145. $mailfetch_uidl_[$i] = getPref($data_dir, $username, "mailfetch_uidl_$i");
  146. $mailfetch_subfolder_[$i] = getPref($data_dir, $username, "mailfetch_subfolder_$i");
  147. $mailfetch_auth_[$i] = getPref($data_dir, $username, "mailfetch_auth_$i",MAIL_FETCH_AUTH_USER);
  148. $mailfetch_type_[$i] = getPref($data_dir, $username, "mailfetch_type_$i",MAIL_FETCH_USE_PLAIN);
  149. if( $mailfetch_cypher == 'on' ) $mailfetch_pass_[$i] = decrypt( $mailfetch_pass_[$i] );
  150. }
  151. echo '<br /><form method="post" action="'.$PHP_SELF.'">' .
  152. html_tag( 'table',
  153. html_tag( 'tr',
  154. html_tag('td',
  155. '<b>' . _("Remote POP server settings") . '</b>',
  156. 'center', $color[0] )
  157. ),
  158. 'center', '', 'width="95%"' ) .
  159. html_tag( 'table',
  160. html_tag( 'tr',
  161. html_tag( 'td',
  162. _("You should be aware that the encryption used to store your password is not perfectly secure. However, if you are using pop, there is inherently no encryption anyway. Additionally, the encryption that we do to save it on the server can be undone by a hacker reading the source to this file.") ,
  163. 'left' )
  164. ) .
  165. html_tag( 'tr',
  166. html_tag( 'td',
  167. _("If you leave password empty, it will be asked when you fetch mail.") ,
  168. 'left' )
  169. ) .
  170. html_tag( 'tr',
  171. html_tag( 'td',
  172. '<input type="checkbox" name="mf_cypher" ' .
  173. (($mailfetch_cypher=='on')?'checked="checked" />':' />') .
  174. _("Encrypt passwords (informative only)") ,
  175. 'right' )
  176. ) ,
  177. 'center', '', 'width="95%"' );
  178. switch( $mf_action ) {
  179. case 'config':
  180. echo html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="5" cellspacing="1"' ) .
  181. html_tag( 'tr',
  182. html_tag( 'td', '<b>' . _("Add Server") . '</b>', 'center', $color[9] )
  183. ) .
  184. html_tag( 'tr' ) .
  185. html_tag( 'td', '', 'center', $color[0] ) .
  186. "<input type=\"hidden\" name=\"mf_sn\" value=\"$mailfetch_server_number\" />" .
  187. '<input type="hidden" name="mf_action" value="add" />' .
  188. html_tag( 'table' ) .
  189. html_tag( 'tr',
  190. html_tag( 'th', _("Server:"), 'right' ) .
  191. html_tag( 'td', '<input type="text" name="mf_server" value="" size="40" />', 'left' )
  192. ) .
  193. html_tag( 'tr',
  194. html_tag( 'th', _("Port:"), 'right') .
  195. html_tag( 'td', '<input type="text" name="mf_port" value="110" size="20" />', 'left')
  196. ) .
  197. html_tag( 'tr',
  198. html_tag( 'th', _("Alias:"), 'right' ) .
  199. html_tag( 'td', '<input type="text" name="mf_alias" value="" size="20" />', 'left' )
  200. ) .
  201. html_tag( 'tr',
  202. html_tag( 'th', _("Username:"), 'right' ) .
  203. html_tag( 'td', '<input type="text" name="mf_user" value="" size="20" />', 'left' )
  204. ) .
  205. html_tag( 'tr',
  206. html_tag( 'th', _("Password:"), 'right' ) .
  207. html_tag( 'td', '<input type="password" name="mf_pass" value="" size="20" />', 'left' )
  208. ) .
  209. html_tag( 'tr',
  210. html_tag( 'th', _("Authentication type:"), 'right' ) .
  211. html_tag( 'td', addSelect('mf_auth',
  212. array(MAIL_FETCH_AUTH_USER => _("USER"),
  213. MAIL_FETCH_AUTH_APOP => _("APOP"),
  214. MAIL_FETCH_AUTH_RFC1939 => _("APOP or USER")),
  215. MAIL_FETCH_AUTH_USER,true), 'left' )
  216. ) .
  217. html_tag( 'tr',
  218. html_tag( 'th', _("Connection type:"), 'right' ) .
  219. html_tag( 'td', addSelect('mf_type',
  220. array(MAIL_FETCH_USE_PLAIN => _("Plain text"),
  221. MAIL_FETCH_USE_TLS => _("Use TLS"),
  222. MAIL_FETCH_USE_STLS => _("Use StartTLS")),
  223. MAIL_FETCH_USE_PLAIN,true), 'left' )
  224. ) .
  225. html_tag( 'tr' ) .
  226. html_tag( 'th', _("Store in Folder:"), 'right' ) .
  227. html_tag( 'td', '', 'left' );
  228. $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0);
  229. $boxes = sqimap_mailbox_list($imapConnection);
  230. echo '<select name="mf_subfolder">';
  231. $selected = 0;
  232. if ( isset($mf_subfolder) )
  233. $selected = array(strtolower($mf_subfolder));
  234. echo sqimap_mailbox_option_list($imapConnection, $selected);
  235. echo '</select></td></tr>' .
  236. html_tag( 'tr',
  237. html_tag( 'th', '&nbsp;', 'right' ) .
  238. html_tag( 'td', '<input type="checkbox" name="mf_lmos" checked="checked" />' . _("Leave Mail on Server"), 'left' )
  239. ) .
  240. html_tag( 'tr',
  241. html_tag( 'th', '&nbsp;', 'right' ) .
  242. html_tag( 'td', '<input type="checkbox" name="mf_login" />' . _("Check mail at login"), 'left' )
  243. ) .
  244. html_tag( 'tr',
  245. html_tag( 'th', '&nbsp;', 'right' ) .
  246. html_tag( 'td', '<input type="checkbox" name="mf_fref" />' . _("Check mail at folder refresh"), 'left' )
  247. ) .
  248. html_tag( 'tr',
  249. html_tag( 'td',
  250. '<input type="submit" name="submit_mailfetch" value="' . _("Add Server") . '" />',
  251. 'center', '', 'colspan="2"' )
  252. ) .
  253. '</table></td></tr></table></form>';
  254. // Modify Server
  255. echo '<font size="-5"><br /></font>' .
  256. html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="5" cellspacing="1"' ) .
  257. html_tag( 'tr',
  258. html_tag( 'td', '<b>' . _("Modify Server") . '</b>', 'center', $color[9] )
  259. ) .
  260. html_tag( 'tr' ) .
  261. html_tag( 'td', '', 'center', $color[0] );
  262. if ($mailfetch_server_number>0) {
  263. echo "<form action=\"$PHP_SELF\" method=\"post\" target=\"_self\">";
  264. echo '<b>' . _("Server Name:") . '</b> <select name="mf_sn">';
  265. for ($i=0;$i<$mailfetch_server_number;$i++) {
  266. echo "<option value=\"$i\">" .
  267. htmlspecialchars( (($mailfetch_alias_[$i]=='')?$mailfetch_server_[$i]:$mailfetch_alias_[$i])) . "</option>";
  268. }
  269. echo '</select>'.
  270. '&nbsp;&nbsp;<input type="submit" name="mf_action_mod" value="' . _("Modify") . '" />'.
  271. '&nbsp;&nbsp;<input type="submit" name="mf_action_del" value="' . _("Delete") . '" />'.
  272. '</form>';
  273. } else {
  274. echo _("No servers known.");
  275. }
  276. echo '</td></tr></table>';
  277. break;
  278. case 'Delete': //erase confirmation about a server
  279. echo html_tag( 'table',
  280. html_tag( 'tr',
  281. html_tag( 'td', '<b>' . _("Fetching Servers") . '</b>', 'center', $color[0] )
  282. ) ,
  283. 'center', '', 'width="95%" cellpadding="5" cellspacing="1"' ) .
  284. '<br />' .
  285. html_tag( 'table',
  286. html_tag( 'tr',
  287. html_tag( 'td', '<b>' . _("Confirm Deletion of a Server") . '</b>', 'center', $color[9] )
  288. ) .
  289. html_tag( 'tr',
  290. html_tag( 'td',
  291. "<input type=\"hidden\" name=\"mf_sn\" value=\"$mf_sn\" />" .
  292. '<input type="hidden" name="mf_action" value="confirm_delete" />' .
  293. '<br />' . _("Selected Server:") . " <b>" . htmlspecialchars($mailfetch_server_[$mf_sn]) . "</b><br />" .
  294. _("Confirm delete of selected server?") . '<br /><br />' .
  295. '<input type="submit" name="submit_mailfetch" value="' . _("Confirm Delete") . '" />' .
  296. '<br /></form>' ,
  297. 'center', $color[9] )
  298. ) ,
  299. 'center', '', 'width="70%" cellpadding="5" cellspacing="1"' );
  300. break; //modify a server
  301. case 'Modify':
  302. echo html_tag( 'table',
  303. html_tag( 'tr',
  304. html_tag( 'td', '<b>' . _("Fetching Servers") . '</b>', 'center', $color[0] )
  305. ) ,
  306. 'center', '', 'width="95%" cellpadding="5" cellspacing="1"' ) .
  307. '<br />' .
  308. html_tag( 'table', '', 'center', '', 'width="70%" cellpadding="5" cellspacing="1"' ) .
  309. html_tag( 'tr',
  310. html_tag( 'td', '<b>' . _("Modify Server") . '</b>', 'center', $color[9] )
  311. ) .
  312. html_tag( 'tr' ) .
  313. html_tag( 'td', '', 'center', $color[0] ) .
  314. "<input type=\"hidden\" name=\"mf_sn\" value=\"$mf_sn\" />" .
  315. '<input type="hidden" name="mf_action" value="confirm_modify" />' .
  316. html_tag( 'table' ) .
  317. html_tag( 'tr',
  318. html_tag( 'th', _("Server:"), 'right' ) .
  319. html_tag( 'td', '<input type="text" name="mf_server" value="' .
  320. htmlspecialchars($mailfetch_server_[$mf_sn]) . '" size="40" />', 'left' )
  321. ) .
  322. html_tag( 'tr',
  323. html_tag( 'th', _("Port:"), 'right' ) .
  324. html_tag( 'td', '<input type="text" name="mf_port" value="' .
  325. htmlspecialchars($mailfetch_port_[$mf_sn]) . '" size="40" />', 'left' )
  326. ) .
  327. html_tag( 'tr',
  328. html_tag( 'th', _("Alias:"), 'right' ) .
  329. html_tag( 'td', '<input type="text" name="mf_alias" value="' .
  330. htmlspecialchars($mailfetch_alias_[$mf_sn]) . '" size="40" />', 'left' )
  331. ) .
  332. html_tag( 'tr',
  333. html_tag( 'th', _("Username:"), 'right' ) .
  334. html_tag( 'td', '<input type="text" name="mf_user" value="' .
  335. htmlspecialchars($mailfetch_user_[$mf_sn]) . '" size="20" />', 'left' )
  336. ) .
  337. html_tag( 'tr',
  338. html_tag( 'th', _("Password:"), 'right' ) .
  339. html_tag( 'td', '<input type="password" name="mf_pass" value="' .
  340. htmlspecialchars($mailfetch_pass_[$mf_sn]) . '" size="20" />', 'left' )
  341. ) .
  342. html_tag( 'tr',
  343. html_tag( 'th', _("Authentication type:"), 'right' ) .
  344. html_tag( 'td', addSelect('mf_auth',array(MAIL_FETCH_AUTH_USER => _("USER"),
  345. MAIL_FETCH_AUTH_APOP => _("APOP"),
  346. MAIL_FETCH_AUTH_RFC1939 => _("APOP or USER")),
  347. $mailfetch_auth_[$mf_sn],true), 'left' )
  348. ) .
  349. html_tag( 'tr',
  350. html_tag( 'th', _("Connection type:"), 'right' ) .
  351. html_tag( 'td', addSelect('mf_type',array(MAIL_FETCH_USE_PLAIN => _("Plain text"),
  352. MAIL_FETCH_USE_TLS => _("Use TLS"),
  353. MAIL_FETCH_USE_STLS => _("Use StartTLS")),
  354. $mailfetch_type_[$mf_sn],true), 'left' )
  355. ) .
  356. html_tag( 'tr' ) .
  357. html_tag( 'th', _("Store in Folder:"), 'right' ) .
  358. html_tag( 'td', '', 'left' );
  359. $imapConnection = sqimap_login ($username, false, $imapServerAddress, $imapPort, 0);
  360. $boxes = sqimap_mailbox_list($imapConnection);
  361. echo '<select name="mf_subfolder">';
  362. $selected = 0;
  363. if ( isset($mailfetch_subfolder_[$mf_sn]) ) {
  364. $selected = array(strtolower($mailfetch_subfolder_[$mf_sn]));
  365. }
  366. echo sqimap_mailbox_option_list($imapConnection, $selected) .
  367. '</select></td></tr>' .
  368. html_tag( 'tr',
  369. html_tag( 'th', '&nbsp;', 'right' ) .
  370. html_tag( 'td',
  371. '<input type="checkbox" name="mf_lmos" ' . (($mailfetch_lmos_[$mf_sn] == 'on')?'checked="checked"':'') .
  372. ' />' . _("Leave Mail on Server") ,
  373. 'left' )
  374. ) .
  375. html_tag( 'tr',
  376. html_tag( 'th', '&nbsp;', 'right' ) .
  377. html_tag( 'td',
  378. '<input type="checkbox" name="mf_login" ' . ( ($mailfetch_login_[$mf_sn] == 'on')?'checked="checked"':'') .
  379. ' />' . _("Check mail at login"),
  380. 'left' )
  381. ) .
  382. html_tag( 'tr',
  383. html_tag( 'th', '&nbsp;', 'right' ) .
  384. html_tag( 'td',
  385. '<input type="checkbox" name="mf_fref" ' . ( ($mailfetch_fref_[$mf_sn] == 'on')?'checked="checked"':'') .
  386. ' />' . _("Check mail at folder refresh") ,
  387. 'left' )
  388. ) .
  389. html_tag( 'tr',
  390. html_tag( 'td',
  391. '<input type="submit" name="submit_mailfetch" value="' . _("Modify Server") . '" />',
  392. 'center', '', 'colspan="2"' )
  393. ) .
  394. '</table></form></td></tr></table>';
  395. break;
  396. default: //unsupported action
  397. echo '</form>' .
  398. html_tag( 'table',
  399. html_tag( 'tr',
  400. html_tag( 'td', '<b>' . _("Fetching Servers") . '</b>', 'center', $color[0] )
  401. ) ,
  402. 'center', '', 'width="95%"' ) .
  403. '<br />' .
  404. html_tag( 'table',
  405. html_tag( 'tr',
  406. html_tag( 'td', '<b>' . _("Undefined Function") . '</b>', 'center', $color[9] ) .
  407. html_tag( 'td', '<b>' . _("The function you requested is unknown.") . '</b>', 'center', $color[0] )
  408. ) ,
  409. 'center', '', 'width="70%"' );
  410. }
  411. $oTemplate->display('footer.tpl');