Skip to content

Commit

Permalink
Bugfix. A user without the privilige to change the permission templat…
Browse files Browse the repository at this point in the history
…es for users couldn't change user properties. Closes: poweradmin#80.
  • Loading branch information
rejozenger committed Jul 11, 2008
1 parent 10832f3 commit 0620953
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion inc/users.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -712,10 +712,15 @@ function update_user_details($details) {
username = " . $db->quote($details['username']) . ",
fullname = " . $db->quote($details['fullname']) . ",
email = " . $db->quote($details['email']) . ",
perm_templ = " . $db->quote($details['templ_id']) . ",
description = " . $db->quote($details['descr']) . ",
active = " . $db->quote($active) ;

// If the user is alllowed to change the permission template, set it.
if ($perm_templ_perm_edit == "1") {
$query .= ", perm_templ = " . $db->quote($details['templ_id']) ;

}

// TODO Check if function works if password is set too.
if($details['password'] != "") {
$query .= ", password = '" . md5($db->quote($details['password'])) . "' ";
Expand Down
3 changes: 2 additions & 1 deletion users.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
}
echo " </select>\n";
} else {
echo $user['tpl_name'];
echo " <input type=\"hidden\" name=\"user[" . $user['uid'] . "][templ_id]\" value=\"" . $user['tpl_id'] . "\">\n";
echo " " . $user['tpl_name'] . "\n";
}
echo " </td>\n";
echo " <td><input type=\"checkbox\" name=\"user[" . $user['uid'] . "][active]\"" . $active . "></td>\n";
Expand Down

0 comments on commit 0620953

Please sign in to comment.