Navigation Menu

Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Add some checks - Do not display plugins that are disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 5, 2015
1 parent 71a8e44 commit fb38ca7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Expand Up @@ -1956,6 +1956,7 @@ public function switchAction($action, $httpVars, $fileVars)
$pInstNode->setAttribute("type", "group_switch:".$fieldName);
$typePlugs = AJXP_PluginsService::getInstance()->getPluginsByType($instType);
foreach ($typePlugs as $typePlug) {
if(!$typePlug->isEnabled()) continue;
if($typePlug->getId() == "auth.multi") continue;
$checkErrorMessage = "";
try {
Expand Down
Expand Up @@ -68,7 +68,7 @@ public function performChecks()
if(!isSet($this->options)) return;
$test = AJXP_Utils::cleanDibiDriverParameters($this->options["SQL_CUSTOM_DRIVER"]);
if (!count($test)) {
throw new Exception("You probably did something wrong! To fix this issue you have to remove the file \"bootstrap.json\" and rename the backup file \"bootstrap.json.bak\" into \"bootsrap.json\" in data/plugins/boot.conf/");
throw new Exception("Could not find any driver definition for CustomDB plugin! To fix this issue you have to remove the file \"bootstrap.json\" and rename the backup file \"bootstrap.json.bak\" into \"bootsrap.json\" in data/plugins/boot.conf/");
}
}

Expand Down
3 changes: 3 additions & 0 deletions core/src/plugins/auth.multi/class.multiAuthDriver.php
Expand Up @@ -60,6 +60,9 @@ public function init($options)
if (!is_object($instance)) {
throw new Exception("Cannot find plugin $name for type 'auth'");
}
if (!$instance->isEnabled()){
throw new Exception("You have selected a disabled plugin ($name) for type 'auth'");
}
$instance->init($options);
if ($name != $this->getOption("MASTER_DRIVER")) {
$this->slaveName = $name;
Expand Down
2 changes: 1 addition & 1 deletion core/src/plugins/core.auth/class.CoreAuthLoader.php
Expand Up @@ -55,7 +55,7 @@ public function getAuthImpl()
}
$masterName = is_array($this->pluginConf["MASTER_INSTANCE_CONFIG"]) ? $this->pluginConf["MASTER_INSTANCE_CONFIG"]["instance_name"] : $this->pluginConf["MASTER_INSTANCE_CONFIG"];
$masterName = str_replace("auth.", "", $masterName);
if (!empty($this->pluginConf["SLAVE_INSTANCE_CONFIG"])) {
if (!empty($this->pluginConf["SLAVE_INSTANCE_CONFIG"]) && !empty($this->pluginConf["MULTI_MODE"])) {
$slaveName = is_array($this->pluginConf["SLAVE_INSTANCE_CONFIG"]) ? $this->pluginConf["SLAVE_INSTANCE_CONFIG"]["instance_name"] : $this->pluginConf["SLAVE_INSTANCE_CONFIG"];
$slaveName = str_replace("auth.", "", $slaveName);
// Manually set up a multi config
Expand Down

0 comments on commit fb38ca7

Please sign in to comment.