From 908bf94e2708efade6c0e54334842142a9be4fca Mon Sep 17 00:00:00 2001 From: christopherm Date: Mon, 13 Nov 2006 06:30:33 +0000 Subject: fixing tool to change admin password git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@560 4979c152-3d1c-0410-bac9-87ea11338e46 --- bin/admin.pl | 13 ++++++++++--- 1 file 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!')); } -- cgit v1.2.3