75 $session->register_acl_type('create_page', AUTH_WIKIMODE, 'Create pages', Array(), 'Article|User|Project|Template|File|Help|System|Category|Special'); |
75 $session->register_acl_type('create_page', AUTH_WIKIMODE, 'Create pages', Array(), 'Article|User|Project|Template|File|Help|System|Category|Special'); |
76 $session->register_acl_type('php_in_pages', AUTH_DISALLOW, 'Embed PHP code in pages', Array('edit_page'), 'Article|User|Project|Template|File|Help|System|Category|Admin'); |
76 $session->register_acl_type('php_in_pages', AUTH_DISALLOW, 'Embed PHP code in pages', Array('edit_page'), 'Article|User|Project|Template|File|Help|System|Category|Admin'); |
77 $session->register_acl_type('edit_acl', AUTH_DISALLOW, 'Edit access control lists', Array('read', 'post_comments', 'edit_comments', 'edit_page', 'view_source', 'mod_comments', 'history_view', 'history_rollback', 'history_rollback_extra', 'protect', 'rename', 'clear_logs', 'vote_delete', 'vote_reset', 'delete_page', 'set_wiki_mode', 'password_set', 'password_reset', 'mod_misc', 'edit_cat', 'even_when_protected', 'upload_files', 'upload_new_version', 'create_page', 'php_in_pages')); |
77 $session->register_acl_type('edit_acl', AUTH_DISALLOW, 'Edit access control lists', Array('read', 'post_comments', 'edit_comments', 'edit_page', 'view_source', 'mod_comments', 'history_view', 'history_rollback', 'history_rollback_extra', 'protect', 'rename', 'clear_logs', 'vote_delete', 'vote_reset', 'delete_page', 'set_wiki_mode', 'password_set', 'password_reset', 'mod_misc', 'edit_cat', 'even_when_protected', 'upload_files', 'upload_new_version', 'create_page', 'php_in_pages')); |
78 |
78 |
79 // DO NOT add new admin pages here! Use a plugin to call $paths->addAdminNode(); |
79 // DO NOT add new admin pages here! Use a plugin to call $paths->addAdminNode(); |
80 $this->addAdminNode('General', 'General Configuration', 'GeneralConfig'); |
80 $this->addAdminNode('adm_cat_general', 'adm_page_general_config', 'GeneralConfig'); |
81 $this->addAdminNode('General', 'File uploads', 'UploadConfig'); |
81 $this->addAdminNode('adm_cat_general', 'adm_page_file_uploads', 'UploadConfig'); |
82 $this->addAdminNode('General', 'Allowed file types', 'UploadAllowedMimeTypes'); |
82 $this->addAdminNode('adm_cat_general', 'adm_page_file_types', 'UploadAllowedMimeTypes'); |
83 $this->addAdminNode('General', 'Manage Plugins', 'PluginManager'); |
83 $this->addAdminNode('adm_cat_general', 'adm_page_plugins', 'PluginManager'); |
84 $this->addAdminNode('General', 'Backup database', 'DBBackup'); |
84 $this->addAdminNode('adm_cat_general', 'adm_page_db_backup', 'DBBackup'); |
85 $this->addAdminNode('Content', 'Manage Pages', 'PageManager'); |
85 $this->addAdminNode('adm_cat_content', 'adm_page_manager', 'PageManager'); |
86 $this->addAdminNode('Content', 'Edit page content', 'PageEditor'); |
86 $this->addAdminNode('adm_cat_content', 'adm_page_editor', 'PageEditor'); |
87 $this->addAdminNode('Content', 'Manage page groups', 'PageGroups'); |
87 $this->addAdminNode('adm_cat_content', 'adm_page_pg_groups', 'PageGroups'); |
88 $this->addAdminNode('Appearance', 'Manage themes', 'ThemeManager'); |
88 $this->addAdminNode('adm_cat_appearance', 'adm_page_themes', 'ThemeManager'); |
89 $this->addAdminNode('Users', 'Manage users', 'UserManager'); |
89 $this->addAdminNode('adm_cat_users', 'adm_page_users', 'UserManager'); |
90 $this->addAdminNode('Users', 'Edit groups', 'GroupManager'); |
90 $this->addAdminNode('adm_cat_users', 'adm_page_user_groups', 'GroupManager'); |
91 $this->addAdminNode('Users', 'COPPA support', 'COPPA'); |
91 $this->addAdminNode('adm_cat_users', 'adm_page_coppa', 'COPPA'); |
92 $this->addAdminNode('Users', 'Mass e-mail', 'MassEmail'); |
92 $this->addAdminNode('adm_cat_users', 'adm_page_mass_email', 'MassEmail'); |
93 $this->addAdminNode('Security', 'Security log', 'SecurityLog'); |
93 $this->addAdminNode('adm_cat_security', 'adm_page_security_log', 'SecurityLog'); |
94 $this->addAdminNode('Security', 'Ban control', 'BanControl'); |
94 $this->addAdminNode('adm_cat_security', 'adm_page_ban_control', 'BanControl'); |
95 |
95 |
96 $code = $plugins->setHook('acl_rule_init'); |
96 $code = $plugins->setHook('acl_rule_init'); |
97 foreach ( $code as $cmd ) |
97 foreach ( $code as $cmd ) |
98 { |
98 { |
99 eval($cmd); |
99 eval($cmd); |
491 return ( isset($ret) ) ? $ret : false; |
491 return ( isset($ret) ) ? $ret : false; |
492 } |
492 } |
493 // Parses a (very carefully formed) array into Javascript code compatible with the Tigra Tree Menu used in the admin menu |
493 // Parses a (very carefully formed) array into Javascript code compatible with the Tigra Tree Menu used in the admin menu |
494 function parseAdminTree() |
494 function parseAdminTree() |
495 { |
495 { |
|
496 global $lang; |
|
497 |
496 $k = array_keys($this->admin_tree); |
498 $k = array_keys($this->admin_tree); |
497 $i = 0; |
499 $i = 0; |
498 $ret = ''; |
500 $ret = ''; |
499 $ret .= "var TREE_ITEMS = [\n ['Administration panel home', 'javascript:ajaxPage(\'".$this->nslist['Admin']."Home\');',\n "; |
501 $ret .= "var TREE_ITEMS = [\n ['" . $lang->get('adm_btn_home') . "', 'javascript:ajaxPage(\'".$this->nslist['Admin']."Home\');',\n "; |
500 foreach($k as $key) |
502 foreach($k as $key) |
501 { |
503 { |
502 $i++; |
504 $i++; |
503 $ret .= "['".$key."', 'javascript:trees[0].toggle($i)', \n"; |
505 $name = ( preg_match('/^[a-z0-9_]+$/', $key) ) ? $lang->get($key) : $key; |
|
506 $ret .= "['".$name."', 'javascript:trees[0].toggle($i)', \n"; |
504 foreach($this->admin_tree[$key] as $c) |
507 foreach($this->admin_tree[$key] as $c) |
505 { |
508 { |
506 $i++; |
509 $i++; |
507 $ret .= " ['".$c['name']."', 'javascript:ajaxPage(\\'".$this->nslist['Admin'].$c['pageid']."\\');'],\n"; |
510 $name = ( preg_match('/^[a-z0-9_]+$/', $key) ) ? $lang->get($c['name']) : $c['name']; |
|
511 |
|
512 $ret .= " ['".$name."', 'javascript:ajaxPage(\\'".$this->nslist['Admin'].$c['pageid']."\\');'],\n"; |
508 } |
513 } |
509 $ret .= " ],\n"; |
514 $ret .= " ],\n"; |
510 } |
515 } |
511 $ret .= " ['Log out of admin panel', 'javascript:ajaxPage(\\'".$this->nslist['Admin']."AdminLogout\\');'],\n"; |
516 $ret .= " ['" . $lang->get('adm_btn_logout') . "', 'javascript:ajaxPage(\\'".$this->nslist['Admin']."AdminLogout\\');'],\n"; |
512 $ret .= " ['<span id=\\'keepalivestat\\'>Loading keep-alive control...</span>', 'javascript:ajaxToggleKeepalive();', |
517 $ret .= " ['<span id=\\'keepalivestat\\'>" . $lang->get('adm_btn_keepalive_loading') . "</span>', 'javascript:ajaxToggleKeepalive();', |
513 ['About keep-alive', 'javascript:aboutKeepAlive();'] |
518 ['" . $lang->get('adm_btn_keepalive_about') . "', 'javascript:aboutKeepAlive();'] |
514 ],\n"; |
519 ],\n"; |
515 // I used this while I painstakingly wrote the Runt code that auto-expands certain nodes based on the value of a bitfield stored in a cookie. *shudders* |
520 // I used this while I painstakingly wrote the Runt code that auto-expands certain nodes based on the value of a bitfield stored in a cookie. *shudders* |
516 // $ret .= " ['(debug) Clear menu bitfield', 'javascript:createCookie(\\'admin_menu_state\\', \\'1\\', 365);'],\n"; |
521 // $ret .= " ['(debug) Clear menu bitfield', 'javascript:createCookie(\\'admin_menu_state\\', \\'1\\', 365);'],\n"; |
517 $ret .= "]\n];"; |
522 $ret .= "]\n];"; |
518 return $ret; |
523 return $ret; |