diff --git a/gosa-core/include/class_configRegistry.inc b/gosa-core/include/class_configRegistry.inc
index 7520310d7f0acc3b7555a24c4a83263627bbd260..0f623ee08366720af8f7c422d76a23d7750183fa 100644 (file)
public $config = NULL;
public $properties = array();
public $config = NULL;
public $properties = array();
- public $mapByClass = array();
- public $mapPropertyToClass = array();
public $ldapStoredProperties = array();
public $fileStoredProperties = array();
public $classToName = array();
public $ldapStoredProperties = array();
public $fileStoredProperties = array();
public $classToName = array();
$this->ldapStoredProperties = array();
$this->fileStoredProperties = array();
$this->properties = array();
$this->ldapStoredProperties = array();
$this->fileStoredProperties = array();
$this->properties = array();
- $this->mapByClass = array();
- $this->mapPropertyToClass = array();
-
+ $this->mapByName = array();
+
// Search for config flags defined in the config file (TAB section)
foreach($this->config->data['TABS'] as $tabname => $tabdefs){
foreach($tabdefs as $info){
// Search for config flags defined in the config file (TAB section)
foreach($this->config->data['TABS'] as $tabname => $tabdefs){
foreach($tabdefs as $info){
}
$this->status = 'finished';
}
}
$this->status = 'finished';
}
-
+
global $class_mapping;
foreach ($class_mapping as $cname => $path){
$cmethods = get_class_methods($cname);
global $class_mapping;
foreach ($class_mapping as $cname => $path){
$cmethods = get_class_methods($cname);
{
$id = count($this->properties);
$this->properties[$id] = new gosaProperty($this,$class,$data);
{
$id = count($this->properties);
$this->properties[$id] = new gosaProperty($this,$class,$data);
- $this->mapByName[$class][$data['name']] = $id;
- $this->mapByClass[$class][] = $id;
- $this->mapPropertyToClass[$id] = $class;
+ $p = strtolower("{$class}::{$data['name']}");
+ $this->mapByName[$p] = $id;
}
public function getAllProperties()
}
public function getAllProperties()
}
function propertyExists($class,$name)
}
function propertyExists($class,$name)
- {
- return(isset($this->mapByName[$class][$name]));
+ {
+ $p = strtolower("{$class}::{$name}");
+ return(isset($this->mapByName[$p]));
}
private function getId($class,$name)
{
}
private function getId($class,$name)
{
- return($this->mapByName[$class][$name]);
+ $p = strtolower("{$class}::{$name}");
+ if(!isset($this->mapByName[$p])){
+ return(-1);
+ }
+ return($this->mapByName[$p]);
}
function getProperty($class,$name)
}
function getProperty($class,$name)
foreach($this->properties as $prop){
$prop->save();
}
foreach($this->properties as $prop){
$prop->save();
}
+ $this->reload(TRUE);
}
}
}
}
if(isset($this->parent->ldapStoredProperties[$this->class][$this->name])){
$this->setStatus('ldap');
$this->value = $this->parent->ldapStoredProperties[$this->class][$this->name];
if(isset($this->parent->ldapStoredProperties[$this->class][$this->name])){
$this->setStatus('ldap');
$this->value = $this->parent->ldapStoredProperties[$this->class][$this->name];
+ return;
}
// Second check for values in the config file.
if(isset($this->parent->fileStoredProperties[$this->class][strtolower($this->name)])){
$this->setStatus('file');
$this->value = $this->parent->fileStoredProperties[$this->class][strtolower($this->name)];
}
// Second check for values in the config file.
if(isset($this->parent->fileStoredProperties[$this->class][strtolower($this->name)])){
$this->setStatus('file');
$this->value = $this->parent->fileStoredProperties[$this->class][strtolower($this->name)];
+ return;
}
// If there still wasn't found anything then fallback to the default.
}
// If there still wasn't found anything then fallback to the default.
if(!$ldap->count()){
$ldap->cd($dn);
$data = array(
if(!$ldap->count()){
$ldap->cd($dn);
$data = array(
- 'cn' => $this->class,
- 'objectClass' => array('top','gosaConfig'),
- 'gosaSetting' => $this->name.":".$this->value);
+ 'cn' => $this->class,
+ 'objectClass' => array('top','gosaConfig'),
+ 'gosaSetting' => $this->name.":".$this->value);
$ldap->add($data);
$ldap->add($data);
- if($ldap->success()){
- $this->status = 'ldap';
- }else{
+ if(!$ldap->success()){
echo $ldap->get_error();
}
echo $ldap->get_error();
}
+ $this->_restoreCurrentValue();
+
}else{
$attrs = $ldap->fetch();
$data = array();
}else{
$attrs = $ldap->fetch();
$data = array();
if(!$found) $data['gosaSetting'][] = "{$this->name}:{$this->value}";
$ldap->cd($dn);
$ldap->modify($data);
if(!$found) $data['gosaSetting'][] = "{$this->name}:{$this->value}";
$ldap->cd($dn);
$ldap->modify($data);
- if($ldap->success()){
- $this->status = 'ldap';
- }else{
+ if(!$ldap->success()){
echo $ldap->get_error();
}
echo $ldap->get_error();
}
+ $this->_restoreCurrentValue();
}
}elseif($this->getStatus() == 'removed'){
$ldap = $this->parent->config->get_ldap_link();
}
}elseif($this->getStatus() == 'removed'){
$ldap = $this->parent->config->get_ldap_link();
}
$ldap->cd($dn);
$ldap->modify($data);
}
$ldap->cd($dn);
$ldap->modify($data);
- if($ldap->success()){
- $this->_restoreCurrentValue();
- }else{
+ if(!$ldap->success()){
echo $ldap->get_error();
}
echo $ldap->get_error();
}
+ $this->_restoreCurrentValue();
}
}
}
}