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

SF.net SVN: ledger-smb:[2347] branches/1.2



Revision: 2347
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2347&view=rev
Author:   einhverfr
Date:     2008-10-02 15:25:35 +0000 (Thu, 02 Oct 2008)

Log Message:
-----------
Committing Sadashiva's fix for Access Denied when deleting user

Modified Paths:
--------------
    branches/1.2/CONTRIBUTORS
    branches/1.2/bin/admin.pl

Modified: branches/1.2/CONTRIBUTORS
===================================================================
--- branches/1.2/CONTRIBUTORS	2008-10-01 16:45:59 UTC (rev 2346)
+++ branches/1.2/CONTRIBUTORS	2008-10-02 15:25:35 UTC (rev 2347)
@@ -69,6 +69,9 @@
 Victor Sterpu <victor @ ambra.ro> has contributed several bug fixes to COGS 
 handling.
 
+Sadashiva [email omitted] has committed a fix to the admin screen regarding access 
+errors when deleting a user.
+
 Original Authors of SQL-Ledger:
 ===================================
 Dieter Simader <dsimader @ sql-ledger.com>

Modified: branches/1.2/bin/admin.pl
===================================================================
--- branches/1.2/bin/admin.pl	2008-10-01 16:45:59 UTC (rev 2346)
+++ branches/1.2/bin/admin.pl	2008-10-02 15:25:35 UTC (rev 2347)
@@ -938,16 +938,20 @@
     }
 
     #users_conf
-    my $deleteUser =
-      $dbh->prepare(
-"DELETE FROM users_conf USING users WHERE users.username = ? and users.id = users_conf.id;"
-      );
-    $deleteUser->execute( $form->{login} );
+ 
+    my $deleteUser = $dbh->prepare("select id FROM users WHERE username = ?;");
 
-    #and now users
-    $deleteUser = $dbh->prepare("DELETE FROM users WHERE username = ?;");
     $deleteUser->execute( $form->{login} );
 
+    my $id1=$deleteUser->fetchrow();
+
+    $dbh->do("DELETE FROM users_conf WHERE id=$id1;") or print "error";
+    $dbh->do("DELETE FROM users WHERE id=$id1;") or print "Error";
+    
+    $form->{login}="admin";
+
+
+
     $form->redirect( $locale->text('User deleted!') );
 }
 
@@ -971,7 +975,7 @@
 
     print qq|
 	<body class="admin">
-		<form method="post" action="$form->{script}">
+		<form method="get" action="$form->{script}">
 		<table>
 			<tr class="listheading">
 				<th>| . $locale->text('Change Password') . qq|</th>


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