Skip to content

Commit

Permalink
authad: added compatibility for old option names
Browse files Browse the repository at this point in the history
adLDAP renamed the ad_username and ad_password to admin_username
admin_password recently. this makes our backend recognize the old
settings
  • Loading branch information
splitbrain committed Apr 25, 2013
1 parent 1464232 commit 8257d71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/plugins/authad/auth.php
Expand Up @@ -465,14 +465,18 @@ protected function _loadServerConfig($domain) {
$opts['domain_controllers'] = array_map('trim', $opts['domain_controllers']);
$opts['domain_controllers'] = array_filter($opts['domain_controllers']);

// compatibility with old option name
if(empty($opts['admin_username']) && !empty($opts['ad_username'])) $opts['admin_username'] = $opts['ad_username'];
if(empty($opts['admin_password']) && !empty($opts['ad_password'])) $opts['admin_password'] = $opts['ad_password'];

// we can change the password if SSL is set
if($opts['use_ssl'] || $opts['use_tls']) {
$this->cando['modPass'] = true;
} else {
$this->cando['modPass'] = false;
}

if(isset($opts['admin_username']) && isset($opts['admin_password'])) {
if(!empty($opts['admin_username']) && !empty($opts['admin_password'])) {
$this->cando['getUsers'] = true;
} else {
$this->cando['getUsers'] = false;
Expand Down

0 comments on commit 8257d71

Please sign in to comment.