summaryrefslogtreecommitdiff
path: root/bin/admin.pl
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 /bin/admin.pl
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
Diffstat (limited to 'bin/admin.pl')
-rwxr-xr-xbin/admin.pl20
1 files changed, 12 insertions, 8 deletions
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>