+ }
+ echo html_tag( 'tr',
+ html_tag( 'td', ' ' ) .
+ html_tag( 'td', '<input type="submit" name="submit_mailfetch" value="' . _("Fetch Mail"). '" />', 'left' )
+ ) .
+ '</table></form>';
+}
+
+$mailfetch = Mail_Fetch_Servers();
+displayPageHeader($color);
+
+echo '<br />';
+
+echo html_tag( 'table',
+ html_tag( 'tr',
+ html_tag( 'td', '<b>' . _("Remote POP server Fetching Mail") . '</b>', 'center', $color[0] )
+ ) ,
+ 'center', '', 'width="95%" cols="1"' );
+
+
+/* there are no servers defined yet... */
+if($mailfetch['server_number'] == 0) {
+//FIXME: do not echo directly to browser -- use templates only
+ echo '<p>' . _("No POP3 servers configured yet.") . '</p>';
+ echo makeInternalLink('plugins/mail_fetch/options.php',
+ _("Click here to go to the options page.") );
+ $oTemplate->display('footer.tpl');
+ exit();
+}
+
+// get $server_to_fetch from globals, if not set display a choice to the user
+if (! sqgetGlobalVar('server_to_fetch', $server_to_fetch, SQ_POST) ) {
+ Mail_Fetch_Select_Server($mailfetch);
+ $oTemplate->display('footer.tpl');
+ exit();
+}
+
+if ( $server_to_fetch == 'all' ) {
+ $i_start = 0;
+ $i_stop = $mailfetch['server_number'];
+} else {
+ $i_start = $server_to_fetch;
+ $i_stop = $i_start+1;
+}
+
+for ($i_loop=$i_start;$i_loop<$i_stop;$i_loop++) {
+ $mailfetch_server = $mailfetch[$i_loop]['server'];
+ $mailfetch_port = $mailfetch[$i_loop]['port'];
+ $mailfetch_user = $mailfetch[$i_loop]['user'];
+ $mailfetch_pass = $mailfetch[$i_loop]['pass'];
+ $mailfetch_lmos = $mailfetch[$i_loop]['lmos'];
+ $mailfetch_login = $mailfetch[$i_loop]['login'];
+ $mailfetch_uidl = $mailfetch[$i_loop]['uidl'];
+ $mailfetch_subfolder = $mailfetch[$i_loop]['subfolder'];
+ $mailfetch_auth = $mailfetch[$i_loop]['auth'];
+ $mailfetch_type = $mailfetch[$i_loop]['type'];
+
+ echo '<br />' .