diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-06-29 22:08:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-06-29 22:08:57 +0000 |
commit | 9c43e8fc7a192dfe768c76a539373915bddaa0aa (patch) | |
tree | 32dfe7f04171c2600be4164ca529d7f42766ec32 /includes/user.inc | |
parent | 124694ee4dbcc1df5dfc2d419ed2393619883071 (diff) | |
download | brdo-9c43e8fc7a192dfe768c76a539373915bddaa0aa.tar.gz brdo-9c43e8fc7a192dfe768c76a539373915bddaa0aa.tar.bz2 |
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!
Diffstat (limited to 'includes/user.inc')
-rw-r--r-- | includes/user.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/user.inc b/includes/user.inc index 5e0bf2274..9e1370f6b 100644 --- a/includes/user.inc +++ b/includes/user.inc @@ -52,12 +52,14 @@ function user_save($account, $array) { return user_load(($account->userid ? $account->userid : $array[userid])); } -function user_access($account, $perm) { - if ($account->id == 1) { +function user_access($perm) { + global $user; + + if ($user->id == 1) { return 1; } - else if ($account->perm) { - return strstr($account->perm, $perm); + else if ($user->perm) { + return strstr($user->perm, $perm); } else { return db_fetch_object(db_query("SELECT * FROM role WHERE name = 'anonymous user' AND perm LIKE '%$perm%'")); |