Code

Updated gosa.conf and class_config.
[gosa.git] / gosa-core / include / class_config.inc
index 8d839877c5eec731614953a4f46417164195eea7..ad109f53492a91a49ca0473ac76dd89612c6d9b6 100644 (file)
@@ -287,6 +287,9 @@ class config  {
   {
     $this->current= $this->data['LOCATIONS'][$name];
 
+    if (!isset($this->current['SAMBAVERSION'])){
+      $this->current['SAMBAVERSION']= 3;
+    }
     if (!isset($this->current['PEOPLE'])){
       $this->current['PEOPLE']= "ou=people";
     }
@@ -382,12 +385,18 @@ class config  {
     if ($this->current['MAILMETHOD'] == ""){
       $ldap->search ("(objectClass=goMailServer)", array('cn'));
       $this->data['SERVERS']['IMAP']= array();
-      error_reporting(0);
       while ($attrs= $ldap->fetch()){
         $name= $attrs['cn'][0];
-        $this->data['SERVERS']['IMAP'][$name]= $name;
+        $this->data['SERVERS']['IMAP'][$name]= 
+          array( 
+              "server_dn"   => $attrs['dn'],
+              "connect"     => "",
+              "admin"       => "",
+              "password"    => "",
+              "sieve_server"=> "",
+              "sieve_option"=> "",
+              "sieve_port"  => "");
       }
-      error_reporting(E_ALL);
     } else {
       $ldap->search ("(&(objectClass=goImapServer)(goImapSieveServer=*))", 
                     array('goImapName', 'goImapConnect', 'goImapAdmin', 'goImapPassword',
@@ -850,7 +859,7 @@ class config  {
 
     foreach($res as $entry){
         
-        $acl = $ui->get_permissions($entry['dn'],"server/goShareServer","");
+        $acl = $ui->get_permissions($entry['dn'],"server","");
         if(isset($entry['goExportEntry']['count'])){
           unset($entry['goExportEntry']['count']);
         }
@@ -928,6 +937,23 @@ class config  {
   }
 
 
+  function get_cfg_value($name, $default= "") {
+    $name= strtoupper($name);
+
+    /* Check if we have a current value for $name */
+    if (isset($this->current[$name])){
+      return ($this->current[$name]);
+    }
+
+    /* Check if we have a global value for $name */
+    if (isset($this->data["MAIN"][$name])){
+      return ($this->data["MAIN"][$name]);
+    }
+
+    return ($default);
+  }
+
+
   function check_config_version()
   {
     /* Skip check, if we've already mentioned the mismatch