summaryrefslogtreecommitdiff
path: root/modules/conf.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-06-20 20:00:40 +0000
committerDries Buytaert <dries@buytaert.net>2001-06-20 20:00:40 +0000
commit72065fb8351b54eee5f1928c18e06ad81aa9b502 (patch)
tree59052fb790134eed81b52b69150a1e231bd44083 /modules/conf.module
parent7752dc4c7c4cffda07152d8ee89bce05f16a5d6c (diff)
downloadbrdo-72065fb8351b54eee5f1928c18e06ad81aa9b502.tar.gz
brdo-72065fb8351b54eee5f1928c18e06ad81aa9b502.tar.bz2
- Added a brand-new access.module which allows you to manage 'roles'
(groups) and 'permissions' ... (inspired by Zope's system). + Once installed, click the help-link for more information. + See updates/2.00-to-x.xx.sql for the SQL updates. - Modified loads of code to use our new access.module. The system still has to mature though: new permissions have to be added and existing permissions need stream-lining. Awaiting suggestions. - As a direct result of the new access system, I had to rewrite the way the top-level links in admin.php are rendered and displayed, and xhtml-ified admin.php while I was at it. TODO - Home-brewed modules need updating, home-brewed themes not. (Examples: file.module, trip_link.module) - As soon we *finished* the refactoring of the user system (KJ has been working on this refactoring already) we should consider to embed this role and permission code into account.module ...
Diffstat (limited to 'modules/conf.module')
-rw-r--r--modules/conf.module46
1 files changed, 28 insertions, 18 deletions
diff --git a/modules/conf.module b/modules/conf.module
index 4a03a1a99..ba55d82b6 100644
--- a/modules/conf.module
+++ b/modules/conf.module
@@ -12,6 +12,10 @@ function conf_help() {
<?php
}
+function conf_perm() {
+ return array("edit configuration options");
+}
+
function conf_view_options() {
global $conf, $cmodes, $corder, $themes;
@@ -97,24 +101,30 @@ function conf_view($type) {
}
function conf_admin() {
- global $edit, $op, $type;
-
- print "<SMALL><A HREF=\"admin.php?mod=conf&type=options\">site settings</A> | <A HREF=\"admin.php?mod=conf&type=filter\">content filters</A> | <A HREF=\"admin.php?mod=conf&op=help\">help</A></SMALL><HR>\n";
-
- switch ($op) {
- case "help":
- conf_help();
- break;
- case "Reset to defaults":
- print status(conf_default($edit));
- print conf_view($type);
- break;
- case "Save configuration":
- print status(conf_save($edit));
- print conf_view($type);
- break;
- default:
- print conf_view($type);
+ global $user, $edit, $op, $type;
+
+ if (user_access($user, "edit configuration options")) {
+
+ print "<SMALL><A HREF=\"admin.php?mod=conf&type=options\">site settings</A> | <A HREF=\"admin.php?mod=conf&type=filter\">content filters</A> | <A HREF=\"admin.php?mod=conf&op=help\">help</A></SMALL><HR>\n";
+
+ switch ($op) {
+ case "help":
+ conf_help();
+ break;
+ case "Reset to defaults":
+ print status(conf_default($edit));
+ print conf_view($type);
+ break;
+ case "Save configuration":
+ print status(conf_save($edit));
+ print conf_view($type);
+ break;
+ default:
+ print conf_view($type);
+ }
+ }
+ else {
+ print message_access();
}
}