Skip to content

Commit

Permalink
Merge branch 'MDL-61296-34' of git://github.com/cescobedo/moodle into…
Browse files Browse the repository at this point in the history
… MOODLE_34_STABLE
  • Loading branch information
David Monllao committed Jul 3, 2018
2 parents 41562c9 + e21e44b commit e418005
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions auth/ldap/auth.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1289,9 +1289,18 @@ function user_update($olduser, $newuser) {
$nuvalue = core_text::convert($newvalue, 'utf-8', $this->config->ldapencoding); $nuvalue = core_text::convert($newvalue, 'utf-8', $this->config->ldapencoding);
empty($nuvalue) ? $nuvalue = array() : $nuvalue; empty($nuvalue) ? $nuvalue = array() : $nuvalue;
$ouvalue = core_text::convert($oldvalue, 'utf-8', $this->config->ldapencoding); $ouvalue = core_text::convert($oldvalue, 'utf-8', $this->config->ldapencoding);

foreach ($ldapkeys as $ldapkey) { foreach ($ldapkeys as $ldapkey) {
$ldapkey = $ldapkey; // Skip update if $ldapkey does not exist in LDAP.
if (!isset($user_entry[$ldapkey][0])) {
$success = false;
error_log($this->errorlogtag.get_string('updateremfailfield', 'auth_ldap',
array('ldapkey' => $ldapkey,
'key' => $key,
'ouvalue' => $ouvalue,
'nuvalue' => $nuvalue)));
continue;
}

$ldapvalue = $user_entry[$ldapkey][0]; $ldapvalue = $user_entry[$ldapkey][0];
if (!$ambiguous) { if (!$ambiguous) {
// Skip update if the values already match // Skip update if the values already match
Expand Down
1 change: 1 addition & 0 deletions auth/ldap/lang/en/auth_ldap.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
$string['start_tls_key'] = 'Use TLS'; $string['start_tls_key'] = 'Use TLS';
$string['updateremfail'] = 'Error updating LDAP record. Error code: {$a->errno}; Error string: {$a->errstring}<br/>Key ({$a->key}) - old moodle value: \'{$a->ouvalue}\' new value: \'{$a->nuvalue}\''; $string['updateremfail'] = 'Error updating LDAP record. Error code: {$a->errno}; Error string: {$a->errstring}<br/>Key ({$a->key}) - old moodle value: \'{$a->ouvalue}\' new value: \'{$a->nuvalue}\'';
$string['updateremfailamb'] = 'Failed to update LDAP with ambiguous field {$a->key}; old moodle value: \'{$a->ouvalue}\', new value: \'{$a->nuvalue}\''; $string['updateremfailamb'] = 'Failed to update LDAP with ambiguous field {$a->key}; old moodle value: \'{$a->ouvalue}\', new value: \'{$a->nuvalue}\'';
$string['updateremfailfield'] = 'Failed to update LDAP with non-existent field (\'{$a->ldapkey}\'). Key ({$a->key}) - old moodle value: \'{$a->ouvalue}\' new value: \'{$a->nuvalue}\'';
$string['updatepasserror'] = 'Error in user_update_password(). Error code: {$a->errno}; Error string: {$a->errstring}'; $string['updatepasserror'] = 'Error in user_update_password(). Error code: {$a->errno}; Error string: {$a->errstring}';
$string['updatepasserrorexpire'] = 'Error in user_update_password() when reading password expiry time. Error code: {$a->errno}; Error string: {$a->errstring}'; $string['updatepasserrorexpire'] = 'Error in user_update_password() when reading password expiry time. Error code: {$a->errno}; Error string: {$a->errstring}';
$string['updatepasserrorexpiregrace'] = 'Error in user_update_password() when modifying expirationtime and/or gracelogins. Error code: {$a->errno}; Error string: {$a->errstring}'; $string['updatepasserrorexpiregrace'] = 'Error in user_update_password() when modifying expirationtime and/or gracelogins. Error code: {$a->errno}; Error string: {$a->errstring}';
Expand Down

0 comments on commit e418005

Please sign in to comment.