[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [560] trunk/bin/admin.pl



Revision: 560
          http://svn.sourceforge.net/ledger-smb/?rev=560&view=rev
Author:   christopherm
Date:     2006-11-12 22:30:33 -0800 (Sun, 12 Nov 2006)

Log Message:
-----------
fixing tool to change admin password

Modified Paths:
--------------
    trunk/bin/admin.pl

Modified: trunk/bin/admin.pl
===================================================================
--- trunk/bin/admin.pl	2006-11-13 06:13:19 UTC (rev 559)
+++ trunk/bin/admin.pl	2006-11-13 06:30:33 UTC (rev 560)
@@ -907,9 +907,16 @@
 	$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!'));
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.