diff options
Diffstat (limited to 'bin/admin.pl')
-rwxr-xr-x | bin/admin.pl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/admin.pl b/bin/admin.pl index b5c19610..61990b65 100755 --- a/bin/admin.pl +++ b/bin/admin.pl @@ -907,9 +907,16 @@ sub change_password { $form->{callback} = "admin.pl?"; $form->error(__FILE__.':'.__LINE__.': '.$locale->text('Passwords do not match!')) if $form->{new_password} ne $form->{confirm_password}; - $root->{password} = $form->{new_password}; - $root->{'root login'} = 1; - $root->save_member(); + + # use the central database handle + my $dbh = ${LedgerSMB::Sysconfig::GLOBALDBH}; + + my $updateAdminPassword = $dbh->prepare("UPDATE users_conf + SET password = md5(?) + WHERE id = 1"); + + $updateAdminPassword->execute($form->{new_password}); + $form->{callback} = "$form->{script}?action=list_users&path=$form->{path}"; $form->redirect($locale->text('Password changed!')); } |