Commit 9b3cd997 authored by Dries's avatar Dries
Browse files

- fixed 2 bugs and 1 confusing issue in modules/account.module:

    * last access field should not be updated when admin edits stuff
    * saving empty access list caused warning message
    * clicking the access links was confusing (no more links)
parent 4371b627
......@@ -143,7 +143,7 @@ function account_access($account) {
$data = explode(";", $account->access);
foreach ($data as $array) {
$access = explode(":", $array);
if ($access[0]) $output .= " <A HREF=\"admin.php?mod=$access[0]\">$access[0]</A>";
if ($access[0]) $output .= " $access[0]";
}
return $output;
}
......@@ -173,9 +173,15 @@ function account_comments($id) {
}
function account_edit_save($name, $edit) {
foreach ($edit as $key=>$value) if ($key != "access") $query .= "$key = '". addslashes($value) ."', ";
db_query("UPDATE users SET $query last_access = '". time() ."' WHERE userid = '$name'");
foreach ($edit[access] as $key=>$value) user_set(user_load($name), "access", $value, 1);
foreach ($edit as $key=>$value) {
if ($key != "access") $query .= "$key = '". addslashes($value) ."', ";
}
db_query("UPDATE users SET $query access = '' WHERE userid = '$name'");
if ($edit["access"]) {
foreach ($edit["access"] as $key=>$value) user_set(user_load($name), "access", $value, 1);
}
watchdog("message", "account: modified user '$name'");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment