From 9c43e8fc7a192dfe768c76a539373915bddaa0aa Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 29 Jun 2001 22:08:57 +0000 Subject: Extremely large commit: - Fixed tiny quote problem in account.php. - Fixed tiny bug in comment.inc. - Fixed tiny bug in comment.module. - Fixed tiny bug in meta.module. - Simplified user_access() API. - Rewrote link system: still needs fine-tuning and testing so don't upgrade if you are running a production site. ;) Updated all modules and themes to reflect this change. All other themes and modules need updating too! --- modules/account.module | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'modules/account.module') diff --git a/modules/account.module b/modules/account.module index db464623f..117c71433 100644 --- a/modules/account.module +++ b/modules/account.module @@ -33,7 +33,15 @@ function account_help() { } function account_perm() { - return array("add and edit user accounts"); + return array("administer users"); +} + +function account_link($type) { + if ($type == "admin" && user_access("administer users")) { + $links[] = "user accounts"; + } + + return $links ? $links : array(); } function account_conf_options() { @@ -42,10 +50,9 @@ function account_conf_options() { } function account_search($keys) { - global $user; $result = db_query("SELECT * FROM users WHERE userid LIKE '%$keys%' LIMIT 20"); while ($account = db_fetch_object($result)) { - $find[$i++] = array("title" => $account->userid, "link" => (user_access($user, "add and edit user accounts") ? "admin.php?mod=account&op=view&name=". urlencode($account->userid) : "account.php?op=view&name=". urlencode($account->userid)), "user" => $account->userid); + $find[$i++] = array("title" => $account->userid, "link" => (user_access("administer users") ? "admin.php?mod=account&op=view&name=". urlencode($account->userid) : "account.php?op=view&name=". urlencode($account->userid)), "user" => $account->userid); } return $find; } @@ -248,9 +255,9 @@ function account_query($type = "") { } function account_admin() { - global $user, $op, $edit, $id, $mod, $keys, $order, $name, $query; + global $op, $edit, $id, $mod, $keys, $order, $name, $query; - if (user_access($user, "add and edit user accounts")) { + if (user_access("administer users")) { print "access control | add new account | account listings | search account | overview | help
"; $query = $query ? $query : 0; -- cgit v1.2.3