From 72065fb8351b54eee5f1928c18e06ad81aa9b502 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 20 Jun 2001 20:00:40 +0000 Subject: - 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 ... --- modules/aggregator.module | 104 +++++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 47 deletions(-) (limited to 'modules/aggregator.module') diff --git a/modules/aggregator.module b/modules/aggregator.module index 460084c44..8befa5beb 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -6,6 +6,10 @@ function import_help() { add new bundle | add new feed | available bundles | available items | overview | help
"; - - switch($op) { - case "help": - print import_help(); - break; - case "add": - if ($type == "bundle") - print import_form_bundle(); - else - print import_form_feed(); - break; - case "edit": - if ($type == "bundle") - print import_form_bundle(import_get_bundle($id)); - else - print import_form_feed(import_get_feed($id)); - break; - case "remove": - print status(import_remove(import_get_feed($id))); - print import_view_feed(); - break; - case "update": - print status(import_update(import_get_feed($id))); - print import_view_feed(); - break; - case "Save attributes": - print status(import_save_attributes($edit)); - print import_view_item(); - break; - case "Delete": - $edit[title] = 0; - // fall through: - case "Submit": - if ($type == "bundle") - print status(import_save_bundle($edit)); - else - print status(import_save_feed($edit)); - // fall through: - default: - if ($type == "bundle") - print import_view_bundle(); - else if ($type == "item") - print import_view_item(); - else + global $user, $op, $id, $type, $edit; + + if (user_access($user, "add and edit news feeds")) { + + print "add new bundle | add new feed | available bundles | available items | overview | help
"; + + switch($op) { + case "help": + print import_help(); + break; + case "add": + if ($type == "bundle") + print import_form_bundle(); + else + print import_form_feed(); + break; + case "edit": + if ($type == "bundle") + print import_form_bundle(import_get_bundle($id)); + else + print import_form_feed(import_get_feed($id)); + break; + case "remove": + print status(import_remove(import_get_feed($id))); + print import_view_feed(); + break; + case "update": + print status(import_update(import_get_feed($id))); print import_view_feed(); + break; + case "Save attributes": + print status(import_save_attributes($edit)); + print import_view_item(); + break; + case "Delete": + $edit[title] = 0; + // fall through: + case "Submit": + if ($type == "bundle") + print status(import_save_bundle($edit)); + else + print status(import_save_feed($edit)); + // fall through: + default: + if ($type == "bundle") + print import_view_bundle(); + else if ($type == "item") + print import_view_item(); + else + print import_view_feed(); + } + } + else { + print message_access(); } } -- cgit v1.2.3