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 /modules/access.module | |
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 'modules/access.module')
-rw-r--r-- | modules/access.module | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/access.module b/modules/access.module index 7126d4584..9addd0732 100644 --- a/modules/access.module +++ b/modules/access.module @@ -21,7 +21,15 @@ function access_help() { } function access_perm() { - return array("access administration pages", "view content", "search content", "post content", "edit roles and permissions"); + return array("access administration pages", "access content", "search content", "post content", "administer roles and permissions"); +} + +function access_link($type) { + if ($type == "admin" && user_access("administer roles and permissions")) { + $links[] = "<a href=\"admin.php?mod=access\">roles and permissions</a>"; + } + + return $links ? $links : array(); } function access_get_role($rid) { @@ -125,9 +133,9 @@ function access_init() { } function access_admin() { - global $user, $edit, $op, $id; + global $edit, $op, $id; - if (user_access($user, "edit roles and permissions")) { + if (user_access("administer roles and permissions")) { print "<SMALL><A HREF=\"admin.php?mod=access&op=add\">add new role</A> | <A HREF=\"admin.php?mod=access&op=role\">role overview</A> | <A HREF=\"admin.php?mod=access&op=perm\">permission overview</A> | <A HREF=\"admin.php?mod=access&op=help\">help</A></SMALL><HR>\n"; |