More robustness, and some little bug fixes.
[moodle.git] / auth / pop3 / config.html
index 19847cc..9e42e35 100644 (file)
@@ -1,8 +1,19 @@
+<?PHP
+    if (!isset($config->auth_pop3host)) {
+        $config->auth_pop3host = "127.0.0.1";
+    }
+    if (!isset($config->auth_pop3type)) {
+        $config->auth_pop3type = "pop3";
+    }
+    if (!isset($config->auth_pop3port)) {
+        $config->auth_pop3port = "110";
+    }
+?>
 <tr valign="top" BGCOLOR="<?=$THEME->cellheading2 ?>">
        <TD ALIGN=RIGHT><P>auth_pop3host:</TD>
        <TD>
         <INPUT name=auth_pop3host TYPE=text SIZE=30 VALUE="<?=$config->auth_pop3host?>">
-       <? formerr($err["ldap_host_url"]); ?>
+       <? if (isset($err["auth_pop3host"])) formerr($err["auth_pop3host"]); ?>
        </TD>
     <TD>
     <? print_string("auth_pop3host","auth") ?>
@@ -18,7 +29,6 @@
        }
        choose_from_menu($pop3options, "auth_pop3type", $config->auth_pop3type, "");
     ?>
-    <? formerr($err["auth_pop3type"]); ?>
     </TD>
 <TD>
     <? print_string("auth_pop3type","auth") ?>
@@ -29,7 +39,7 @@
        <TD ALIGN=RIGHT><P>auth_pop3port:</TD>
        <TD>
     <INPUT name=auth_pop3port TYPE=text SIZE=6 VALUE="<?=$config->auth_pop3port?>">
-    <? formerr($err["auth_pop3port"]); ?>
+    <? if (isset($err["auth_pop3port"])) formerr($err["auth_pop3port"]); ?>
     </TD>
     <TD>
     <? print_string("auth_pop3port","auth") ?>