5 This authentication plugin maps wiki actions and/or page names to the ring
7 ring 0 is for admin functionality (superuser)
8 ring 1 for advanced / privileged functions (moderators)
9 ring 2 are all standard/default things (editors)
10 ring 3 only allows access to a small subset of the wiki (browsing only)
15 $ewiki_perm_rings = array_merge(
23 "view/SecretPage" => 1,
27 "*" => 2, #- anything else requires this ring level
29 (array)@$ewiki_perm_rings
34 $ewiki_plugins["auth_perm"][0] = "ewiki_auth_handler_ring_permissions";
37 function ewiki_auth_handler_ring_permissions($id, $data, $action, $required_ring) {
39 global $ewiki_plugins, $ewiki_ring, $ewiki_perm_rings;
41 if ("ALWAYS_DO_THIS" || ($required_ring===false)) {
43 $id = strtolower($id);
44 $action = strtolower($action);
46 foreach ($ewiki_perm_rings as $string => $ring) {
48 $string = strtolower($string);
50 if (($string == "*") ||
52 ($string == $action) ||
53 ($string == "$action/$id") ||
54 (strtok($string, "/") == $action) )
56 $required_ring = $ring;
64 return(($required_ring===false) || isset($ewiki_ring) && ($ewiki_ring <= $required_ring));