/** * Find the requested admin script and execute it if the user has permissions to view it * */ function RunAdminScript() { global $dataDir, $langmessage; //resolve request for /Admin_Theme_Content if the request is for /Admin_Theme_Conent/1234 $parts = explode('/', $this->requested); do { $request_string = implode('/', $parts); $scriptinfo = false; $scripts = admin_tools::AdminScripts(); if (isset($scripts[$request_string])) { $scriptinfo = $scripts[$request_string]; if (admin_tools::HasPermission($request_string)) { if (isset($scriptinfo['addon'])) { gpPlugin::SetDataFolder($scriptinfo['addon']); } admin_display::OrganizeFrequentScripts($request_string); if (isset($scriptinfo['script'])) { require $dataDir . $scriptinfo['script']; } if (isset($scriptinfo['class'])) { new $scriptinfo['class'](); } gpPlugin::ClearDataFolder(); return; } else { message($langmessage['not_permitted']); $parts = array(); } } elseif (count($scripts) > 0) { //check case $case_check = array_keys($scripts); $case_check = array_combine($case_check, $case_check); $case_check = array_change_key_case($case_check, CASE_LOWER); $lower = strtolower($request_string); if (isset($case_check[$lower])) { $location = common::GetUrl($case_check[$lower], '', false); common::Redirect($location); } } //these are here because they should be available to everyone switch ($request_string) { case 'Admin_Browser': includeFile('admin/admin_browser.php'); new admin_browser(); return; case 'Admin_Preferences': includeFile('admin/admin_preferences.php'); new admin_preferences(); return; case 'Admin_About': includeFile('admin/admin_about.php'); new admin_about(); return; case 'Admin_Finder': includeFile('thirdparty/elfinder/connector.php'); return; } } while (array_pop($parts)); $this->AdminPanel(); }
/** * Find the requested admin script and execute it if the user has permissions to view it * */ function RunAdminScript() { global $dataDir, $langmessage; //resolve request for /Admin_Theme_Content if the request is for /Admin_Theme_Conent/1234 $parts = explode('/', $this->requested); do { $request_string = implode('/', $parts); $scriptinfo = false; $scripts = admin_tools::AdminScripts(); if (isset($scripts[$request_string])) { $scriptinfo = $scripts[$request_string]; if (admin_tools::HasPermission($request_string)) { admin_display::OrganizeFrequentScripts($request_string); gpOutput::ExecInfo($scriptinfo); return; } else { message($langmessage['not_permitted']); $parts = array(); } } elseif (count($scripts) > 0) { //check case $case_check = array_keys($scripts); $case_check = array_combine($case_check, $case_check); $case_check = array_change_key_case($case_check, CASE_LOWER); $lower = strtolower($request_string); if (isset($case_check[$lower])) { $location = common::GetUrl($case_check[$lower], http_build_query($_GET), false); common::Redirect($location); } } //these are here because they should be available to everyone switch ($request_string) { case 'Admin_Browser': includeFile('admin/admin_browser.php'); new admin_browser(); return; case 'Admin_Preferences': $this->label = $langmessage['Preferences']; includeFile('admin/admin_preferences.php'); new admin_preferences(); return; case 'Admin_About': $this->label = 'About gpEasy'; includeFile('admin/admin_about.php'); new admin_about(); return; case 'Admin_Finder': if (admin_tools::HasPermission('Admin_Uploaded')) { includeFile('thirdparty/finder/connector.php'); return; } break; } array_pop($parts); } while (count($parts)); $this->AdminPanel(); }