From d1a07a2e8f21e402c85799215f37bd7f3cb685f1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 31 Mar 2001 14:58:37 +0000 Subject: - fixed "you-have-to-logout-and-login-before-permissions-change" bug (reported by UnConeD) - added "add node" link to book selection box and made it display the current location - removed tabs and whitespaces from themes - done automatically --- includes/node.inc | 4 ++-- includes/user.inc | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/node.inc b/includes/node.inc index d4ba181e0..5bfefe00c 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -146,10 +146,10 @@ function node_info($node) { nid" => t("view node"), "/submit.php?mod=$node->type&op=update&id=$node->nid" => t("suggest update"), "node.php?op=history&id=$node->nid" => t("view history")); + $choices = array("node.php?id=$node->nid" => t("view node"), "submit.php?mod=$node->type" => t("add node"), "submit.php?mod=$node->type&op=update&id=$node->nid" => t("update node"), "node.php?op=history&id=$node->nid" => t("view history")); $output .= "
\n"; - foreach ($choices as $key => $value) $options .= "\n"; + foreach ($choices as $key => $value) $options .= "\n"; $output .= " \n"; $output .= "
\n"; diff --git a/includes/user.inc b/includes/user.inc index ce5820023..66a015e4f 100644 --- a/includes/user.inc +++ b/includes/user.inc @@ -29,6 +29,14 @@ function user_load($username) { return new User($username); } +function user_rehash() { + global $user; + if ($user->id) { + $user = new User($user->userid); + session_register("user"); + } +} + function user_save($account, $array) { // dynamically compose query: foreach ($array as $key=>$value) { @@ -82,7 +90,7 @@ function user_set($account, $column, $name, $value) { } function user_access($account, $section = 0) { -// print $account->userid ." ". $account->access ."

"; + global $user; if ($section) return (user_get($account, "access", $section) || $account->id == 1); else return ($account->access || $account->id == 1); } -- cgit v1.2.3