summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-13 06:30:33 +0000
committerchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2006-11-13 06:30:33 +0000
commit908bf94e2708efade6c0e54334842142a9be4fca (patch)
tree5c31966de1da60d8f49a55d31f8b96afbfe9cabf
parent0e9d0cd2221a1940bc4bcab1eaf65f06308160b9 (diff)
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
-rwxr-xr-xbin/admin.pl13
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&amp;path=$form->{path}";
$form->redirect($locale->text('Password changed!'));
}