]> git.mjollnir.org Git - moodle.git/commitdiff
FIxes for POP3 from Rudy Scott http://moodle.org/mod/forum/discuss.php?d=9131
authormoodler <moodler>
Sun, 15 Aug 2004 17:21:01 +0000 (17:21 +0000)
committermoodler <moodler>
Sun, 15 Aug 2004 17:21:01 +0000 (17:21 +0000)
auth/pop3/config.html
auth/pop3/lib.php
lang/en/auth.php

index 103375c348f465832441f523643024477f27d6f2..ec0288b860257d469523dcbd04f5bce189c76957 100644 (file)
@@ -1,4 +1,4 @@
-<?PHP
+<?PHP  // $Id$
     if (!isset($config->auth_pop3host)) {
         $config->auth_pop3host = "127.0.0.1";
     }
@@ -8,6 +8,9 @@
     if (!isset($config->auth_pop3port)) {
         $config->auth_pop3port = "110";
     }
+    if (!isset($config->auth_pop3mailbox)) {
+        $config->auth_pop3mailbox = "INBOX";
+    }
 ?>
 <tr valign="top" BGCOLOR="<?php echo $THEME->cellheading2 ?>">
        <TD ALIGN=RIGHT><P>auth_pop3host:</TD>
     </TD>
 </TR>
 
+<TR VALIGN=TOP BGCOLOR="<?php echo $THEME->cellheading2 ?>">
+       <TD ALIGN=RIGHT><P>auth_pop3mailbox:</TD>
+       <TD>
+    <INPUT name=auth_pop3mailbox TYPE=text SIZE=6 VALUE="<?php echo $config->auth_pop3mailbox?>">
+    <?php  if (isset($err["auth_pop3mailbox"])) formerr($err["auth_pop3mailbox"]); ?>
+    </TD>
+    <TD>
+    <?php  print_string("auth_pop3mailbox","auth") ?>
+    </TD>
+</TR>
+
 <TR VALIGN=TOP>
        <TD ALIGN=RIGHT><P><?php  print_string("instructions", "auth") ?>:</TD>
        <TD>
index bd78bc29d5b3e60421cba7ee3d65496e05f16fc3..6c18d436ec210733e2107578257f8c81da75084d 100644 (file)
@@ -12,16 +12,21 @@ function auth_user_login ($username, $password) {
     foreach ($hosts as $host) {                 // Try each host in turn
 
         $host = trim($host);
+        
+        // remove any trailing slash
+        if (substr($host, -1) == '/') {
+            $host = substr($host, 0, strlen($host) - 1);
+        }
 
         switch ($CFG->auth_pop3type) {
             case "pop3":
-                $host = '{'.$host.":$CFG->auth_pop3port/pop3}INBOX";
+                $host = '{'.$host.":$CFG->auth_pop3port/pop3}$CFG->auth_pop3mailbox";
             break;
             case "pop3notls":
-                $host = '{'.$host.":$CFG->auth_pop3port/pop3/notls}INBOX";
+                $host = '{'.$host.":$CFG->auth_pop3port/pop3/notls}$CFG->auth_pop3mailbox";
             break;
             case "pop3cert":
-                $host = '{'.$host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}INBOX";
+                $host = '{'.$host.":$CFG->auth_pop3port/pop3/ssl/novalidate-cert}$CFG->auth_pop3mailbox";
             break;
         }
 
index ecd94b4ea54dc72ab3ae45fb712fd8ac62e78d34..79da8c2bf7b8e73a5ccc915922f5503702db578c 100644 (file)
@@ -49,7 +49,7 @@ $string['auth_ldapextrafields'] = 'These fields are optional.  You can choose to
 $string['auth_ldaptitle'] = 'Use an LDAP server';
 $string['auth_manualdescription'] = 'This method removes any way for users to create their own accounts.  All accounts must be manually created by the admin user.';
 $string['auth_manualtitle'] = 'Manual accounts only';
-$string['auth_multiplehosts'] = 'Multiple hosts can be specified (eg host1.com;host2.com;host3.com';
+$string['auth_multiplehosts'] = 'Multiple hosts OR addresses can be specified (eg host1.com;host2.com;host3.com) or (eg xxx.xxx.xxx.xxx;xxx.xxx.xxx.xxx)';
 $string['auth_nntpdescription'] = 'This method uses an NNTP server to check whether a given username and password is valid.';
 $string['auth_nntphost'] = 'The NNTP server address. Use the IP number, not DNS name.';
 $string['auth_nntpport'] = 'Server port (119 is the most common)';
@@ -58,7 +58,8 @@ $string['auth_nonedescription'] = 'Users can sign in and create valid accounts i
 $string['auth_nonetitle'] = 'No authentication';
 $string['auth_pop3description'] = 'This method uses a POP3 server to check whether a given username and password is valid.';
 $string['auth_pop3host'] = 'The POP3 server address. Use the IP number, not DNS name.';
-$string['auth_pop3port'] = 'Server port (110 is the most common)';
+$string['auth_pop3mailbox'] = 'Name of the mailbox to attempt a connection with.  (usually INBOX)';
+$string['auth_pop3port'] = 'Server port (110 is the most common, 995 is common for SSL)';
 $string['auth_pop3title'] = 'Use a POP3 server';
 $string['auth_pop3type'] = 'Server type. If your server uses certificate security, choose pop3cert.';
 $string['auth_user_create'] = 'Enable user creation';