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

Commit

Permalink
Fix problems with specific values when saving roles parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 19, 2014
1 parent 789e2cf commit f7f5126
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/core/classes/class.AJXP_Role.php
Expand Up @@ -181,7 +181,7 @@ public function bunchUpdate($roleData)
public function setParameterValue($pluginId, $parameterName, $parameterValue, $repositoryId = null)
{
if($repositoryId === null) $repositoryId = AJXP_REPO_SCOPE_ALL;
if (empty($parameterValue) && $parameterValue !== false) {
if (empty($parameterValue) && $parameterValue !== false && $parameterValue !== "0") {
if (isSet($this->parameters[$repositoryId][$pluginId][$parameterName])) {
unset($this->parameters[$repositoryId][$pluginId][$parameterName]);
if(!count($this->parameters[$repositoryId][$pluginId])) unset($this->parameters[$repositoryId][$pluginId]);
Expand Down
2 changes: 1 addition & 1 deletion core/src/core/classes/class.AuthService.php
Expand Up @@ -426,7 +426,7 @@ public static function bootSequence(&$START_PARAMETERS)
}
}
}
if(!empty($dashId)) $rootRole->setParameterValue("core.conf", "DEFAULT_REPOSITORY", $dashId);
if(!empty($dashId)) $rootRole->setParameterValue("core.conf", "DEFAULT_START_REPOSITORY", $dashId);
$paramNodes = AJXP_PluginsService::searchAllManifests("//server_settings/param[@scope]", "node", false, false, true);
if (is_array($paramNodes) && count($paramNodes)) {
foreach ($paramNodes as $xmlNode) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/core.conf/class.AbstractConfDriver.php
Expand Up @@ -651,8 +651,8 @@ public function switchAction($action, $httpVars, $fileVars)
$pluginId = $parentNode->nodeName.".".$parentNode->getAttribute("name");
}
$name = $xmlNode->getAttribute("name");
if (isSet($data[$name]) || $data[$name] == "") {
if ($data[$name] == "" || $userObject->parentRole == null || $userObject->parentRole->filterParameterValue($pluginId, $name, AJXP_REPO_SCOPE_ALL, "") != $data[$name]) {
if (isSet($data[$name]) || $data[$name] === "") {
if ($data[$name] === "" || $userObject->parentRole == null || $userObject->parentRole->filterParameterValue($pluginId, $name, AJXP_REPO_SCOPE_ALL, "") != $data[$name]) {
$userObject->personalRole->setParameterValue($pluginId, $name, $data[$name]);
$rChanges = true;
}
Expand Down

0 comments on commit f7f5126

Please sign in to comment.