summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2010-11-21 00:46:01 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2010-11-21 00:46:01 -0500
commit2c438e9ecc3d3cb5191921d03ab343f4c5f53cc6 (patch)
tree1ae61ed9323ba4b35e9636ea79c6e56aa8220a9f
parentd6877baca9b8c56ce3e1565791fa260cdc983d95 (diff)
Check if a plugin _exists_, not whether it is loaded, when enabling/disabling it. (Needed for previous commit to be useful)
pluginenable.php: check if a file exists, not if it's been loaded.
-rw-r--r--actions/pluginenable.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/actions/pluginenable.php b/actions/pluginenable.php
index 826874ae5..4662f4368 100644
--- a/actions/pluginenable.php
+++ b/actions/pluginenable.php
@@ -104,8 +104,14 @@ class PluginEnableAction extends Action
}
$this->plugin = $this->arg('plugin');
- $pluginList = StatusNet::getPlugins();
- if (!array_key_exists($this->plugin, $pluginList)) {
+ $files = StatusNet::pluginFiles($this->plugin);
+ $found = false;
+ foreach ($files as $file) {
+ if (file_exists($file)) {
+ $found = true;
+ }
+ }
+ if (!$found) {
$this->clientError(_('No such plugin.'));
return false;
}