From f3b74cdeb69484881f7e96b1b846cf6d9bb94425 Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 15 Sep 2008 16:31:31 +0000 Subject: Removed privileged path code since this is no longer used git-svn-id: https://code.elgg.org/elgg/trunk@2083 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 79 -------------------------------------------------- 1 file changed, 79 deletions(-) (limited to 'engine') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 87fd40172..1562fd003 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1634,85 +1634,6 @@ } return false; } - - /** - * A utility function which returns true if the code is currently running with - * extended privileges (as provided by execute_privileged_codeblock().) - * - * This is essentially a wrapper around call_gatekeeper(). - * - * @return bool - */ - /*function is_privileged() - { - global $CONFIG; - - return call_gatekeeper('execute_privileged_codeblock', $CONFIG->path . 'engine/lib/elgglib.php'); - }*/ - - /** - * Execute a function as a privileged user. - * - * Privileged code blocks should be in the format of "function(array $params)" whether they - * are in a class or a standalone object. - * - * Before executing it triggers an event "execute_privileged_codeblock" which gives code the option - * to deny access based on a number factors (simply return false). - * - * @param mixed $function The function (or array(object,method)) to execute. - * @param array $params The parameters passed to the function as an array - * @return the result of the executed codeblock - * @throws SecurityException - */ - /*function execute_privileged_codeblock($function, array $params = null) - { - // Test path first - if (can_path_execute_privileged_codeblock()) - { - // Test to see if we can actually execute code by calling any other functions - if (trigger_elgg_event("execute_privileged_codeblock", "all")) - { - // Execute - $result = null; - - if (is_array($function)) - $result = $function[0]->$function[1]($params); - else - $result = $function($params); - - // Return value - return $result; - } - } - - throw new SecurityException(elgg_echo("SecurityException:Codeblock")); - }*/ - - /** - * Validate that a given path has privileges to execute a piece of privileged code. - * - */ - /*function can_path_execute_privileged_codeblock() - { - global $CONFIG; - - // Get a list of paths - $callstack = debug_backtrace(); - $call_paths = array(); - foreach ($callstack as $call) - $call_paths[] = sanitise_string($call['file']); - - // Get privileged paths - $paths = get_data("SELECT * from {$CONFIG->dbprefix}privileged_paths"); - - foreach ($paths as $p) - { - if (in_array( $p->path, $call_paths)) - return true; - } - - return false; - }*/ /** * Get the full URL of the current page. -- cgit v1.2.3