Skip to content
Snippets Groups Projects
Commit 9b3cd997 authored by Dries Buytaert's avatar Dries Buytaert
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
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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'");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment