summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-10-02 15:25:35 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-10-02 15:25:35 +0000
commit2a7cffad68540d58c8407725219715c3097864bb (patch)
tree07d0d6ffc3cf5ccccacbdc8fd20e6bbe6f147815
parent4a3d99c0c9fc089c854f0509795b67c2bf4a0530 (diff)
Committing Sadashiva's fix for Access Denied when deleting user
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@2347 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--CONTRIBUTORS3
-rwxr-xr-xbin/admin.pl20
2 files changed, 15 insertions, 8 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index d50c4017..6a5d6df7 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -69,6 +69,9 @@ Donna Robinson [email omitted] contributed some fixes to the HTML code.
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>
diff --git a/bin/admin.pl b/bin/admin.pl
index 42022d36..1019b204 100755
--- a/bin/admin.pl
+++ b/bin/admin.pl
@@ -938,16 +938,20 @@ sub delete {
}
#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 @@ sub change_admin_password {
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>