mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 17:44:56 +00:00
use ldap authentication if turned on
This commit is contained in:
parent
bd15584c65
commit
1e4a07be94
|
@ -113,9 +113,27 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
*/
|
*/
|
||||||
function check_auth($type, $user, $pass) /* {{{ */
|
function check_auth($type, $user, $pass) /* {{{ */
|
||||||
{
|
{
|
||||||
|
global $settings;
|
||||||
|
|
||||||
if($this->logger)
|
if($this->logger)
|
||||||
$this->logger->log('check_auth: type='.$type.', user='.$user.'', PEAR_LOG_INFO);
|
$this->logger->log('check_auth: type='.$type.', user='.$user.'', PEAR_LOG_INFO);
|
||||||
$userobj = $this->dms->getUserByLogin($user);
|
|
||||||
|
$userobj = false;
|
||||||
|
|
||||||
|
/* Authenticate against LDAP server {{{ */
|
||||||
|
if (!$userobj && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
|
||||||
|
require_once("../inc/inc.ClassLdapAuthentication.php");
|
||||||
|
$authobj = new SeedDMS_LdapAuthentication($this->dms, $settings);
|
||||||
|
$userobj = $authobj->authenticate($user, $pass);
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
/* Authenticate against SeedDMS database {{{ */
|
||||||
|
if(!$userobj) {
|
||||||
|
require_once("../inc/inc.ClassDbAuthentication.php");
|
||||||
|
$authobj = new SeedDMS_DbAuthentication($this->dms, $settings);
|
||||||
|
$userobj = $authobj->authenticate($user, $pass);
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
if(!$userobj)
|
if(!$userobj)
|
||||||
return false;
|
return false;
|
||||||
if(md5($pass) != $userobj->getPwd())
|
if(md5($pass) != $userobj->getPwd())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user