aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php79
1 files changed, 0 insertions, 79 deletions
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.