mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:20:12 +01:00
added pop3 login feature to the gui
This commit is contained in:
parent
ecf8c91e9a
commit
c37ed257ae
@ -99,6 +99,12 @@ $config['IMAP_HOST'] = 'mail.yourdomain.com';
|
|||||||
$config['IMAP_PORT'] = 993;
|
$config['IMAP_PORT'] = 993;
|
||||||
$config['IMAP_SSL'] = true;
|
$config['IMAP_SSL'] = true;
|
||||||
|
|
||||||
|
// enable authentication against a pop3 server (disabled by default)
|
||||||
|
|
||||||
|
$config['ENABLE_POP3_AUTH'] = 0;
|
||||||
|
$config['POP3_HOST'] = 'mail.yourdomain.com';
|
||||||
|
$config['POP3_PORT'] = 995;
|
||||||
|
$config['POP3_SSL'] = true;
|
||||||
|
|
||||||
// enable authentication against google (disabled by default)
|
// enable authentication against google (disabled by default)
|
||||||
// see http://www.mailpiler.org/en/google-apps-free.html for details
|
// see http://www.mailpiler.org/en/google-apps-free.html for details
|
||||||
|
@ -18,6 +18,11 @@ class ModelUserAuth extends Model {
|
|||||||
if($ok == 1) { return $ok; }
|
if($ok == 1) { return $ok; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ENABLE_POP3_AUTH == 1) {
|
||||||
|
require 'Zend/Mail/Protocol/Pop3.php';
|
||||||
|
$ok = $this->checkLoginAgainstPOP3($username, $password);
|
||||||
|
if($ok == 1) { return $ok; }
|
||||||
|
}
|
||||||
|
|
||||||
// fallback local auth
|
// fallback local auth
|
||||||
|
|
||||||
@ -255,6 +260,34 @@ class ModelUserAuth extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function checkLoginAgainstPOP3($username = '', $password = '') {
|
||||||
|
$user = array();
|
||||||
|
$rc = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
$conn = new Zend_Mail_Protocol_Pop3(POP3_HOST, POP3_PORT, POP3_SSL);
|
||||||
|
|
||||||
|
if($conn) {
|
||||||
|
$s = $conn->connect(POP3_HOST);
|
||||||
|
|
||||||
|
if($s) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
$conn->login($username, $password);
|
||||||
|
|
||||||
|
$this->add_session_vars($username, $username, array($username), 0);
|
||||||
|
$rc = 1;
|
||||||
|
}
|
||||||
|
catch (Zend_Mail_Protocol_Exception $e) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Zend_Mail_Protocol_Exception $e) {}
|
||||||
|
|
||||||
|
return $rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function check_ntlm_auth() {
|
public function check_ntlm_auth() {
|
||||||
$ldap_mail_attr = 'mail';
|
$ldap_mail_attr = 'mail';
|
||||||
$ldap_account_objectclass = 'user';
|
$ldap_account_objectclass = 'user';
|
||||||
|
Loading…
Reference in New Issue
Block a user