Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option 'modPassPlain' to send plaintext password updates to LDAP server #3634

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/plugins/authldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,12 @@ public function modifyUser($user, $changes)
}

// Generate the salted hashed password for LDAP
$phash = new \dokuwiki\PassHash();
$hash = $phash->hash_ssha($changes['pass']);
if ($this->getConf('modPassPlain')) {
$hash = $changes['pass'];
} else {
$phash = new \dokuwiki\PassHash();
$hash = $phash->hash_ssha($changes['pass']);
}

// change the password
if (!@ldap_mod_replace($this->con, $dn, array('userpassword' => $hash))) {
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/authldap/conf/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
$conf['groupkey'] = 'cn';
$conf['debug'] = 0;
$conf['modPass'] = 1;
$conf['modPassPlain'] = 0;
$conf['attributes'] = array();
1 change: 1 addition & 0 deletions lib/plugins/authldap/conf/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
$meta['groupkey'] = array('string','_caution' => 'danger');
$meta['debug'] = array('onoff','_caution' => 'security');
$meta['modPass'] = array('onoff');
$meta['modPassPlain']= array('onoff','_caution' => 'security');
1 change: 1 addition & 0 deletions lib/plugins/authldap/lang/en/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
$lang['userkey'] = 'Attribute denoting the username; must be consistent to userfilter.';
$lang['groupkey'] = 'Group membership from any user attribute (instead of standard AD groups) e.g. group from department or telephone number';
$lang['modPass'] = 'Can the LDAP password be changed via dokuwiki?';
$lang['modPassPlain']= 'Send password updates in plain text to the LDAP server (rather than salt and hash them with the configured algorithm before transmission)?';
$lang['debug'] = 'Display additional debug information on errors';


Expand Down