diff options
author | Pami Ketolainen <pami.ketolainen@jollamobile.com> | 2013-07-25 13:00:08 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2013-07-25 13:00:08 +0200 |
commit | df25a5bb5ce5b30caff910d059f84a54abbded86 (patch) | |
tree | db973d20afaf7c1de3f1161496da346b04caed45 /contrib | |
parent | Bug 880113 - Use the cache for the product and component name (diff) | |
download | bugzilla-df25a5bb5ce5b30caff910d059f84a54abbded86.tar.gz bugzilla-df25a5bb5ce5b30caff910d059f84a54abbded86.tar.bz2 bugzilla-df25a5bb5ce5b30caff910d059f84a54abbded86.zip |
Bug 889403: syncLDAP.pl does not rederive regexp groups when updating login name
r=LpSolit a=sgreen
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/syncLDAP.pl | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/contrib/syncLDAP.pl b/contrib/syncLDAP.pl index ec0839ed5..6ad96477b 100755 --- a/contrib/syncLDAP.pl +++ b/contrib/syncLDAP.pl @@ -240,22 +240,15 @@ if($readonly == 0) { print "Phase 2: updating existing users... " unless $quiet; - my $sth_update_login = $dbh->prepare( - 'UPDATE profiles - SET login_name = ? - WHERE ' . $dbh->sql_istrcmp('login_name', '?')); - my $sth_update_realname = $dbh->prepare( - 'UPDATE profiles - SET realname = ? - WHERE ' . $dbh->sql_istrcmp('login_name', '?')); - if($noupdate == 0) { while( my ($key, $value) = each(%update_users) ) { + my $user = Bugzilla::User->check($key); if(defined $value->{'new_login_name'}) { - $sth_update_login->execute($value->{'new_login_name'}, $key); + $user->set_login($value->{'new_login_name'}); } else { - $sth_update_realname->execute($value->{'realname'}, $key); + $user->set_name($value->{'realname'}); } + $user->update(); } print "done!\n" unless $quiet; } |