Code

Added new flag ignoreLdapProperties which ignores settings made in the property editor.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 May 2010 16:01:02 +0000 (16:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 18 May 2010 16:01:02 +0000 (16:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18536 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/contrib/gosa.conf
gosa-core/include/class_configRegistry.inc

index 62c53a6e8b7fa1a073969b451797f27a82807309..1b600d1c054b6e6097b3341256341c04c9aad5b7 100644 (file)
        the gosa.conf(5) manual page.
 
   -->
-  <main default="{$cv.location}">
+  <!-- If you broke your setup using the propertyEditor, then set 'ignoreLdapProperties' to true. -->
+  <main default="{$cv.location}"
+        ignoreLdapProperties="false"
+    >
 
     <!-- Location definition -->
     <location name="{$cv.location}"
index f5b51d861d4d2013664aafc7e286d24808aaf09a..192330579c8915469f48a813078f0749ae9b72fb 100644 (file)
@@ -10,6 +10,9 @@ class configRegistry{
 
     public $status = 'none';
 
+    // Excludes property values defined in ldap 
+    public $ignoreLdapProperties = FALSE;
+
     function __construct($config)
     {
         $this->config = &$config;
@@ -76,8 +79,15 @@ class configRegistry{
             }
         }
 
+        // Skip searching for LDAP defined properties if 'ignoreLdapProperties' is set to 'true'
+        //  in the config. 
+        if(isset($this->fileStoredProperties['core'][strtolower('ignoreLdapProperties')]) && 
+            preg_match("/(true|on)/i", $this->fileStoredProperties['core'][strtolower('ignoreLdapProperties')])){
+            $this->ignoreLdapProperties = TRUE;
+        }
+
         // Search for all config flags defined in the LDAP - BUT only if we ARE logged in. 
-        if(!empty($this->config->current['CONFIG'])){
+        if(!$this->ignoreLdapProperties && !empty($this->config->current['CONFIG'])){
             $ldap = $this->config->get_ldap_link();
             $ldap->cd($this->config->current['CONFIG']);
             $ldap->search('(&(objectClass=gosaConfig)(gosaSetting=*))', array('cn','gosaSetting'));