This commit is contained in:
moodler 2004-08-15 17:21:01 +00:00
parent 4b9c337598
commit 58a524be4d
3 changed files with 26 additions and 6 deletions

View 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>
@ -47,6 +50,17 @@
</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>

View 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;
}

View 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';