summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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>