mirror of
https://github.com/silentsakky/zarafa-webapp-passwd
synced 2026-07-27 10:30:56 +02:00
Merge pull request #5 from oxilion/master
Fix typo and allow logins with @
This commit is contained in:
commit
1161ec7a32
2 changed files with 13 additions and 5 deletions
|
|
@ -10,4 +10,8 @@ define('PLUGIN_PASSWD_LDAP_BASEDN', 'dc=example,dc=com');
|
|||
|
||||
/** URI to access LDAP server **/
|
||||
define('PLUGIN_PASSWD_LDAP_URI', 'localhost');
|
||||
?>
|
||||
|
||||
/** Set to true if you login with username@tenantname **/
|
||||
define('PLUGIN_PASSWD_LOGIN_WITH_TENANT', false);
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -90,8 +90,12 @@ class PasswdModule extends Module
|
|||
// check connection is successfull
|
||||
if(ldap_errno($ldapconn) === 0) {
|
||||
// get the users uid, if we have a multi tenant installation then remove company name from user name
|
||||
$parts = explode('@', $data['username']);
|
||||
$uid = $parts[0];
|
||||
if (PLUGIN_PASSWD_LOGIN_WITH_TENANT){
|
||||
$parts = explode('@', $data['username']);
|
||||
$uid = $parts[0];
|
||||
} else {
|
||||
$uid = $data['username'];
|
||||
}
|
||||
|
||||
// search for the user dn that will be used to do login into LDAP
|
||||
$userdn = ldap_search (
|
||||
|
|
@ -109,7 +113,7 @@ class PasswdModule extends Module
|
|||
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
|
||||
// login with current password if that fails then current password is wrong
|
||||
$bind = ldap_bind($ladpconn, $userdn, $data['current_password']);
|
||||
$bind = ldap_bind($ldapconn, $userdn, $data['current_password']);
|
||||
|
||||
if(ldap_errno($ldapconn) === 0) {
|
||||
$passwd = $data['new_password'];
|
||||
|
|
@ -245,4 +249,4 @@ class PasswdModule extends Module
|
|||
return $hash;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue