diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-20 13:00:41 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-20 13:00:41 +0000 |
commit | 6341f41c7e48912e03c3fdb01d108bff8539df06 (patch) | |
tree | 8f8f726825c2e9477f07a9ea8d299801a47f3785 /engine/lib/plugins.php | |
parent | e84c224e72f12b8592e1e9f9ae82d63c8224a75d (diff) | |
download | elgg-6341f41c7e48912e03c3fdb01d108bff8539df06.tar.gz elgg-6341f41c7e48912e03c3fdb01d108bff8539df06.tar.bz2 |
Closes #60: Enable/disable plugins on a site by site basis
http://trac.elgg.org/elgg/ticket/60
git-svn-id: https://code.elgg.org/elgg/trunk@1021 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/plugins.php')
-rw-r--r-- | engine/lib/plugins.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 0edf46bfb..464163f2b 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -304,6 +304,9 @@ */ function is_plugin_enabled($plugin, $site_guid = 0) { + //return execute_privileged_codeblock('__is_plugin_enabled_priv', array('plugin'=>$plugin, 'site_guid' => $site_guid)); + // Does this need to be in privileged? Doesn't seem to... + global $CONFIG; $site_guid = (int) $site_guid; @@ -320,6 +323,32 @@ return false; } + + /** + * Privileged execution so code can run before user logged in. + * + * @param array $params + * @return bool + */ + /*function __is_plugin_enabled_priv(array $params = null) + { + global $CONFIG; + + $plugin = $params['plugin']; + $site_guid = (int) $params['site_guid']; + if ($site_guid == 0) + $site_guid = $CONFIG->site_guid; + + $site = get_entity($site_guid); + if (!($site instanceof ElggSite)) + throw new InvalidClassException(sprintf(elgg_echo('InvalidClassException:NotValidElggStar'), $site_guid, "ElggSite")); + + $enabled = find_metadata("enabled_plugins", $plugin, "site", "", 10, 0, "", $site_guid); + if ($enabled) + return true; + + return false; + }*/ /** * Run once and only once. |