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 --- admin.php | 1 + includes/node.inc | 4 ++-- includes/user.inc | 10 +++++++++- modules/account.module | 12 ++++++------ modules/book.module | 2 +- modules/book/book.module | 2 +- modules/moderation.module | 2 -- node.php | 2 +- themes/example/example.theme | 2 +- themes/jeroen/jeroen.theme | 6 +++--- themes/marvin/marvin.theme | 6 +++--- 11 files changed, 28 insertions(+), 21 deletions(-) diff --git a/admin.php b/admin.php index 040fc33ea..acf8986b5 100644 --- a/admin.php +++ b/admin.php @@ -45,6 +45,7 @@ function admin_page($mod) { \ No newline at end of file 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); } diff --git a/modules/account.module b/modules/account.module index 236993140..71671cbd3 100644 --- a/modules/account.module +++ b/modules/account.module @@ -116,12 +116,12 @@ function account_edit($name) { $output .= "Username:
". check_output($account->userid) ."

\n"; $output .= "Status:

\n"; $output .= "Administrator access:

\n"; - $output .= "Real name:
name\">

\n"; - $output .= "Real e-mail address:
real_email\">

\n"; - $output .= "Fake e-mail address:
fake_email\">

\n"; - $output .= "URL of homepage:
url\">

\n"; - $output .= "Bio information:

\n"; - $output .= "Signature:

\n"; + $output .= "Real name:
name). "\">

\n"; + $output .= "Real e-mail address:
real_email) ."\">

\n"; + $output .= "Fake e-mail address:
fake_email) ."\">

\n"; + $output .= "URL of homepage:
url) ."\">

\n"; + $output .= "Bio information:

\n"; + $output .= "Signature:

\n"; $output .= "userid\">\n"; $output .= "\n"; $output .= "\n"; diff --git a/modules/book.module b/modules/book.module index 8009ae27e..59c1b35d4 100644 --- a/modules/book.module +++ b/modules/book.module @@ -80,7 +80,7 @@ function book_toc($parent = 0, $offset = 0, $toc = array()) { $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND b.parent = '$parent' ORDER BY b.weight"); while ($node = db_fetch_object($result)) { $toc[$node->nid] = ($offset ? $offset : "") ."". ++$number .". $node->title"; - $toc = book_toc($node->nid, ($offset ? "$offset." : "") ."$number.", $toc); + $toc = book_toc($node->nid, ($offset ? $offset : "") ."$number.", $toc); } return $toc; } diff --git a/modules/book/book.module b/modules/book/book.module index 8009ae27e..59c1b35d4 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -80,7 +80,7 @@ function book_toc($parent = 0, $offset = 0, $toc = array()) { $result = db_query("SELECT n.*, b.* FROM node n LEFT JOIN book b ON n.nid = b.nid AND n.lid = b.lid WHERE n.type = 'book' AND n.status = '$status[posted]' AND b.parent = '$parent' ORDER BY b.weight"); while ($node = db_fetch_object($result)) { $toc[$node->nid] = ($offset ? $offset : "") ."". ++$number .". $node->title"; - $toc = book_toc($node->nid, ($offset ? "$offset." : "") ."$number.", $toc); + $toc = book_toc($node->nid, ($offset ? $offset : "") ."$number.", $toc); } return $toc; } diff --git a/modules/moderation.module b/modules/moderation.module index 4df29e080..1faf9542d 100644 --- a/modules/moderation.module +++ b/modules/moderation.module @@ -99,8 +99,6 @@ function moderation_page() { global $id, $op, $user, $vote; if ($user->id) { - $user = user_load($user->userid); - switch($op) { case "Vote"; moderation_vote(check_input($id), check_input($vote)); diff --git a/node.php b/node.php index 996e2cfc5..de284b163 100644 --- a/node.php +++ b/node.php @@ -45,7 +45,7 @@ elseif ($number) { $theme->footer(); break; default: - if ($user->id) user_load($user->userid); + user_rehash(); node_view($node, 1); } } diff --git a/themes/example/example.theme b/themes/example/example.theme index ea196937f..085b2eb38 100644 --- a/themes/example/example.theme +++ b/themes/example/example.theme @@ -8,7 +8,7 @@ Description: Very basic theme for demonstration purposes. *********************************************************************/ - + class Theme { function header() { diff --git a/themes/jeroen/jeroen.theme b/themes/jeroen/jeroen.theme index 8889ed658..0aef27298 100644 --- a/themes/jeroen/jeroen.theme +++ b/themes/jeroen/jeroen.theme @@ -1,14 +1,14 @@