options.php 22 KB

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