public function getPref($prefName)
 {
     if ($prefName == "lang") {
         // Migration path
         if (isset($this->mergedRole)) {
             $l = $this->mergedRole->filterParameterValue("core.conf", "lang", AJXP_REPO_SCOPE_ALL, "");
             if ($l != "") {
                 return $l;
             }
         }
     }
     if (isset($this->prefs[$prefName])) {
         return $this->prefs[$prefName];
     }
     return "";
 }
Exemplo n.º 2
0
 public function testRolesParametersAdditivity()
 {
     $r1 = new \AJXP_Role("role1");
     $r2 = new \AJXP_Role("role2");
     $r1->setParameterValue("type.id", "param_name", "param_value1", "repository_id");
     $this->assertEquals("param_value1", $r1->filterParameterValue("type.id", "param_name", "repository_id", "anyvalue1"));
     $r2->setParameterValue("type.id", "param_name", "param_value2", "repository_id");
     $r3 = $r2->override($r1);
     $this->assertEquals("param_value2", $r3->filterParameterValue("type.id", "param_name", "repository_id", "anyvalue"));
     $r1->setParameterValue("type.id", "param_name", "param_value1", "repository_id");
     $r2->setParameterValue("type.id", "param_name", AJXP_VALUE_CLEAR, "repository_id");
     $r3 = $r2->override($r1);
     $this->assertEquals("anyvalue2", $r3->filterParameterValue("type.id", "param_name", "repository_id", "anyvalue2"));
     $r1->setParameterValue("type.id", "param_name", "param_value1", "repository_id");
     $r2->setParameterValue("type.id", "param_name", "", "repository_id");
     $r3 = $r2->override($r1);
     $this->assertEquals("param_value1", $r3->filterParameterValue("type.id", "param_name", "repository_id", "anyvalue2"));
 }