PM-2430 "Admin > Users > Authentication Sources > New: Se..." SOLVED
Issue:
Admin > Users > Authentication Sources > New: Se muestra la opcion del plugin
ldapAdvanced aun cuando este esta en estado "Disable" en el workspace
Cause:
No se verifica si el plugin esta enabled/disabled
Solution:
Se verifica si el plugin esta enabled/disabled
This commit is contained in:
@@ -399,22 +399,19 @@ class PMPluginRegistry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get status plugin in the singleton
|
* Get status plugin in the singleton
|
||||||
*
|
*
|
||||||
* @param unknown_type $sNamespace
|
* @param string $name Plugin name
|
||||||
|
*
|
||||||
|
* return mixed Return a string with status plugin, 0 otherwise
|
||||||
*/
|
*/
|
||||||
public function getStatusPlugin ($sNamespace)
|
public function getStatusPlugin($name)
|
||||||
{
|
{
|
||||||
foreach ($this->_aPluginDetails as $namespace => $detail) {
|
try {
|
||||||
if ($sNamespace == $namespace) {
|
return (isset($this->_aPluginDetails[$name]))? (($this->_aPluginDetails[$name]->enabled)? "enabled" : "disabled") : 0;
|
||||||
if ($this->_aPluginDetails[$sNamespace]->enabled) {
|
} catch (Excepton $e) {
|
||||||
return 'enabled';
|
throw $e;
|
||||||
} else {
|
|
||||||
return 'disabled';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -149,16 +149,30 @@ try {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'authSourcesNew':
|
case 'authSourcesNew':
|
||||||
|
$pluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
|
|
||||||
$arr = Array ();
|
$arr = Array ();
|
||||||
$oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
|
$oDirectory = dir( PATH_RBAC . 'plugins' . PATH_SEP );
|
||||||
$aAuthSourceTypes = array ();
|
|
||||||
while ($sObject = $oDirectory->read()) {
|
while ($sObject = $oDirectory->read()) {
|
||||||
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
|
if (($sObject != '.') && ($sObject != '..') && ($sObject != '.svn') && ($sObject != 'ldap')) {
|
||||||
if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
|
if (is_file( PATH_RBAC . 'plugins' . PATH_SEP . $sObject )) {
|
||||||
$sType = trim( str_replace( 'class.', '', str_replace( '.php', '', $sObject ) ) );
|
$sType = trim(str_replace(array("class.", ".php"), "", $sObject));
|
||||||
$aAuthSourceTypes['sType'] = $sType;
|
|
||||||
$aAuthSourceTypes['sLabel'] = $sType;
|
$statusPlugin = $pluginRegistry->getStatusPlugin($sType);
|
||||||
$arr[] = $aAuthSourceTypes;
|
$flagAdd = false;
|
||||||
|
|
||||||
|
if (preg_match("/^(?:enabled|disabled)$/", $statusPlugin)) {
|
||||||
|
if ($statusPlugin == "enabled") {
|
||||||
|
$flagAdd = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$flagAdd = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($flagAdd) {
|
||||||
|
$arr[] = array("sType" => $sType, "sLabel" => $sType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user