summaryrefslogtreecommitdiff
path: root/admin.php
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 /admin.php
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 'admin.php')
-rw-r--r--admin.php43
1 files changed, 25 insertions, 18 deletions
diff --git a/admin.php b/admin.php
index 4a359ad91..ffc4cdfcc 100644
--- a/admin.php
+++ b/admin.php
@@ -2,9 +2,6 @@
include_once "includes/common.inc";
-// validate user access:
-if (!user_access($user)) exit();
-
function status($message) {
if ($message) return "<B>Status:</B> $message<HR>\n";
}
@@ -14,33 +11,43 @@ function admin_page($mod) {
function module($name) {
global $menu, $user;
- if (function_exists($name. "_admin") && user_access($user, $name)) $output .= "<A HREF=\"admin.php?mod=$name\">$name</A> | ";
+ if (module_hook($name, "admin")) $output .= "<A HREF=\"admin.php?mod=$name\">$name</A> | ";
$menu .= $output;
}
?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <HEAD><TITLE><?php echo variable_get(site_name, "drupal"); ?> administration</TITLE></HEAD>
- <STYLE>
+ <html>
+ <head>
+ <title><?php echo variable_get(site_name, "drupal"); ?> administration pages</title>
+ </head>
+ <style>
body { font-family: helvetica, arial; }
h1 { font-famile: helvetica, arial; font-size: 18pt; font-weight: bold; color: #660000; }
h2 { font-family: helvetica, arial; font-size: 18pt; font-weight: bold; color: #000066; }
h3 { font-family: helvetica, arial; font-size: 14pt; font-weight: bold; color: #006600; }
th { font-family: helvetica, arial; text-align: center; vertical-align: top; background-color: #CCCCCC; color: #995555; }
td { font-family: helvetica, arial; }
- </STYLE>
- <BODY BGCOLOR="#FFFFFF" LINK="#005599" VLINK="#004499" ALINK="#FF0000">
- <H1>Administration</H1>
- <?php module_iterate("module"); ?>
- <HR><?php echo $menu; ?><A HREF="index.php">home</A><HR>
- <?php if (user_access($user, $mod)) module_invoke($mod, "admin"); ?>
- </BODY>
- </HTML>
+ </style>
+ <body bgcolor="#FFFFFF" link="#005599" vlink="#004499" alink="#FF0000">
+ <h1>Administration</h1>
+ <?php
+ foreach (module_list() as $name) {
+ if (module_hook($name, "admin")) $links[] = "<a href=\"admin.php?mod=$name\">$name</a>";
+ }
+ $links[] = "<a href=\"index.php\">home</a>";
+
+ print implode(" | ", $links) ."<hr />";
+
+ if ($mod) module_invoke($mod, "admin");
+ ?>
+ </body>
+ </html>
<?php
}
-user_rehash();
-admin_page($mod);
+if (user_access($user, "access administration pages")) {
+ user_rehash();
+ admin_page($mod);
+}
?> \ No newline at end of file