Code

Added some optional settings
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 4 Apr 2007 06:21:28 +0000 (06:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 4 Apr 2007 06:21:28 +0000 (06:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5962 594d385d-05f5-0310-b6e9-bd551577e9d8

contrib/gosa.conf
html/setup.php
include/class_ldap.inc
plugins/personal/mail/class_mailAccount.inc

index 296794d674b28069bfa7ea3e3b657c3d03e84018..e543c72ea64d3a392b05983f3b58601f59f37427 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+{literal}<?xml version="1.0"?>{/literal}
 <conf>
        <menu>
                <section name="My account">
        
        <main default="{$cv.location}"
 
-       {if $cv.pwd_rules.pwminlen_active}
+{if $cv.pwd_rules.pwminlen_active}
                pwminlen="{$cv.pwd_rules.pwminlen}"
-       {/if}
-       {if $cv.pwd_rules.pwdiffer_active}
+{/if}
+{if $cv.pwd_rules.pwdiffer_active}
                pwdiffer="{$cv.pwd_rules.pwdiffer}"
-       {/if}
-       {if $cv.pwd_rules.externalpwdhook_active}
+{/if}
+{if $cv.pwd_rules.externalpwdhook_active}
                pwdiffer="{$cv.pwd_rules.externalpwdhook}"
-       {/if}
-
-       {if $cv.errorlvl}
+{/if}
+{if $cv.errorlvl}
                displayerrors="true"
-       {else}
+{else}
                displayerrors="false"
-       {/if}
-
-       {if $cv.enable_schema_check}
+{/if}
+{if $cv.enable_schema_check}
                schema_check="true"
-       {else}
+{else}
                schema_check="false"
-       {/if}
-
-               lang="{$cv.lang}"
-               theme="{$cv.theme}"
-
+{/if}
+{if $cv.optional.enableCopyPaste}
+               enableCopyPaste="true" 
+{else}
                enableCopyPaste="false" 
-               ppd_path="/var/spool/ppd/" 
-               kde_applications_menu="" 
-               compile="/var/spool/gosa"
-               debuglevel="0"
+{/if}
+{if $cv.optional.forceglobals}
+               forceglobals="true"
+{else}
+               forceglobals="false"
+{/if}
+{if $cv.optional.forcessl}
+               forcessl="true"
+{else}
                forcessl="false"
+{/if}
+{if $cv.optional.warnssl}
+               warnssl="true"
+{else}
                warnssl="false"
-               iconsize="48x48"
-               forceglobals="false"
-               smbhash='SMBHASH'
-               session_lifetime="7200"
-               max_ldap_query_time="5.0"
-               
+{/if}
+{if $cv.optional.ppd_path_active}
+               ppd_path="{$cv.optional.ppd_path}"
+{/if}
+{if $cv.optional.kde_applications_menu_active}
+               kde_applications_menu="{$cv.optional.kde_applications_menu}"
+{/if}
+{if $cv.optional.max_ldap_query_time_active}   
+               max_ldap_query_time="{$cv.optional.max_ldap_query_time}"
+{/if}
+               lang="{$cv.lang}"
+               theme="{$cv.theme}"
+               session_lifetime="{$cv.optional.session_lifetime}"
+               compile="{$cv.optional.compile}"
+               debuglevel="{$cv.optional.debuglevel}"
+               smbhash='{$cv.optional.smbhash}'
                >
 
                <location name="{$cv.location}"
                        groups="{$cv.groupou}"
                        gidbase="{$cv.uidbase}"
                        uidbase="{$cv.uidbase}"
-               {if $cv.generic_settings.wws_ou_active}
+{if $cv.generic_settings.wws_ou_active}
                        winstations="{$cv.generic_settings.wws_ou}"
-               {/if}
-               {if $cv.generic_settings.idgen_active}
+{/if}
+{if $cv.generic_settings.idgen_active}
                        idgen="{$cv.generic_settings.idgen}"
-               {/if}
-               {if $cv.strict}
+{/if}
+{if $cv.strict}
                        strict="yes"
-               {else}
+{else}
                        strict="no"
-               {/if}
-               {if $cv.generic_settings.minid_active}
+{/if}
+{if $cv.generic_settings.minid_active}
                        minid="{$cv.generic_settings.minid}"
-               {/if}
-       {if $cv.mail != "disabled"}
+{/if}
+{if $cv.mail != "disabled"}
                        mailMethod="{$cv.mail}"
-               {if $cv.cyrusunixstyle}
+{if $cv.cyrusunixstyle}
                        cyrusunixstyle="true"
-               {else}
+{else}
                        cyrusunixstyle="false"
-               {/if}
-               {if $cv.mail_settings.vacationdir_active}
-                       {$cv.mail_settings.vacationdir}
-               {/if}
-       {/if}
-               {if $cv.tls}
+{/if}
+{if $cv.mail_settings.vacationdir_active}
+                       vacationdir="{$cv.mail_settings.vacationdir}"
+{/if}
+{/if}
+{if $cv.tls}
                        tls="true"
-               {/if}
-               {if $cv.governmentmode}
+{/if}
+{if $cv.governmentmode}
                        governmentmode="true"
-               {/if}
-               {if $cv.sambaidmapping}
+{/if}
+{if $cv.sambaidmapping}
                        sambaidmapping="true"
-               {/if}
-               {if $cv.account_expiration}
+{/if}
+{if $cv.account_expiration}
                        account_expiration="true"
-               {/if}
-               {if $cv.samba_settings.samba_sid_active}
+{/if}
+{if $cv.samba_settings.samba_sid_active}
                        SID="{$cv.samba_settings.samba_sid}"
-               {/if}
-               {if $cv.samba_settings.samba_rid_active}
+{/if}
+{if $cv.samba_settings.samba_rid_active}
                        RIDBASE="{$cv.samba_settings.samba_rid_active}"
-               {/if}
-       {if $cv.generic_settings.snapshot_active}               
+{/if}
+{if $cv.generic_settings.snapshot_active}      
                        enable_snapshot="true"
-               {if $cv.generic_settings.snapshot_base != ""}                   
+{if $cv.generic_settings.snapshot_base != ""}
                        snapshot_base="{$cv.generic_settings.snapshot_base}"
-               {/if}
-               {if $cv.generic_settings.snapshot_user != ""}                   
+{/if}
+{if $cv.generic_settings.snapshot_user != ""}
                        snapshot_user="{$cv.generic_settings.snapshot_user}"
-               {/if}
-               {if $cv.generic_settings.snapshot_password != ""}                       
+{/if}
+{if $cv.generic_settings.snapshot_password != ""}
                        snapshot_password="{$cv.generic_settings.snapshot_password}"
-               {/if}
-               {if $cv.generic_settings.snapshot_server != ""}
+{/if}
+{if $cv.generic_settings.snapshot_server != ""}
                        snapshot_server="{$cv.generic_settings.snapshot_server}"
-               {/if}
-       {/if}   
-                       sambaversion="SAMBAVERSION"
+{/if}
+{/if}
+{if $cv.samba_version != 0}
+                       sambaversion="{$cv.samba_version}"
+{/if}
                        config="ou=gosa,ou=configs,ou=systems,{$cv.base}">
 
                        <referral url="{$cv.connection}/{$cv.base}"
index dc02aad3d231852c85340cb030b6fb9fd1e56b77..8d2ef2e957e9ed840be4a982a8384867b01c011d 100644 (file)
@@ -33,6 +33,7 @@ require_once("../setup/class_setupStep3.inc");
 require_once("../setup/class_setupStep4.inc");
 require_once("../setup/class_setupStep5.inc");
 require_once("../setup/class_setupStep6.inc");
+require_once("../setup/class_setupStep6a.inc");
 require_once("../setup/class_setupStep7.inc");
 require_once("../setup/class_setupStep8.inc");
 
index b3ae4983b38e7ac0bfd609cd4e391325114fc3b2..fafa96c9765c561a0869b822dcf482b61050ac70 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*****************************************************************************
   newldap.inc - version 1.0
-  Copyright (C) 2003 Alejandro Escanero Blanco <aescanero@chaosdimension.org>
+  Copyright (C) 2003 Alejandro Escanero Blanco <aescanerochaosdimension.org>
   Copyright (C) 2004-2006 Cajus Pollmeier <pollmeier@gonicus.de>
 
   Based in code of ldap.inc of
@@ -95,18 +95,18 @@ class LDAP{
   {
     $this->hascon=false;
     $this->reconnect=false;
-    if ($this->cid= @ldap_connect($this->hostname)) {
-      @ldap_set_option($this->cid, LDAP_OPT_PROTOCOL_VERSION, 3);
+    if ($this->cid= ldap_connect($this->hostname)) {
+      ldap_set_option($this->cid, LDAP_OPT_PROTOCOL_VERSION, 3);
       if (function_exists("ldap_set_rebind_proc") && $this->follow_referral) {
-        @ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
-        @ldap_set_rebind_proc($this->cid, array(&$this, "rebind"));
+        ldap_set_option($this->cid, LDAP_OPT_REFERRALS, 1);
+        ldap_set_rebind_proc($this->cid, array(&$this, "rebind"));
       }
       if (function_exists("ldap_start_tls") && $this->tls){
-        @ldap_start_tls($this->cid);
+        ldap_start_tls($this->cid);
       }
 
       $this->error = "No Error";
-      if ($bid = @ldap_bind($this->cid, $this->fix($this->binddn), $this->bindpw)) {
+      if ($bid = ldap_bind($this->cid, $this->fix($this->binddn), $this->bindpw)) {
         $this->error = "Success";
         $this->hascon=true;
       } else {
@@ -126,7 +126,7 @@ class LDAP{
   function rebind($ldap, $referral)
   {
     $credentials= $this->get_credentials($referral);
-    if (@ldap_bind($ldap, $this->fix($credentials['ADMIN']), $credentials['PASSWORD'])) {
+    if (ldap_bind($ldap, $this->fix($credentials['ADMIN']), $credentials['PASSWORD'])) {
       $this->error = "Success";
       $this->hascon=true;
       $this->reconnect= true;
@@ -140,21 +140,21 @@ class LDAP{
   function reconnect()
   {
     if ($this->reconnect){
-      @ldap_unbind($this->cid);
+      ldap_unbind($this->cid);
       $this->cid = NULL;
     }
   }
 
   function unbind()
   {
-    @ldap_unbind($this->cid);
+    ldap_unbind($this->cid);
     $this->cid = NULL;
   }
 
   function disconnect()
   {
     if($this->hascon){
-      @ldap_close($this->cid);
+      ldap_close($this->cid);
       $this->hascon=false;
     }
   }
@@ -184,8 +184,8 @@ class LDAP{
       $start = microtime();
    
       $this->clearResult();
-      $this->sr = @ldap_search($this->cid, $this->fix($this->basedn), $filter, $attrs);
-      $this->error = @ldap_error($this->cid);
+      $this->sr = ldap_search($this->cid, $this->fix($this->basedn), $filter, $attrs);
+      $this->error = ldap_error($this->cid);
       $this->resetResult();
       $this->hasres=true;
    
@@ -217,8 +217,8 @@ class LDAP{
   
       $start = microtime();
 
-      $this->sr = @ldap_list($this->cid, $this->fix($basedn), $filter,$attrs);
-      $this->error = @ldap_error($this->cid);
+      $this->sr = ldap_list($this->cid, $this->fix($basedn), $filter,$attrs);
+      $this->error = ldap_error($this->cid);
       $this->resetResult();
       $this->hasres=true;
 
@@ -245,8 +245,8 @@ class LDAP{
       if ($this->reconnect) $this->connect();
       $this->clearResult();
       $filter = "(objectclass=*)";
-      $this->sr = @ldap_read($this->cid, $this->fix($dn), $filter,$attrs);
-      $this->error = @ldap_error($this->cid);
+      $this->sr = ldap_read($this->cid, $this->fix($dn), $filter,$attrs);
+      $this->error = ldap_error($this->cid);
       $this->resetResult();
       $this->hasres=true;
       return($this->sr);
@@ -260,10 +260,10 @@ class LDAP{
   {
     /* Ignore zero settings */
     if ($size == 0){
-      @ldap_set_option($this->cid, LDAP_OPT_SIZELIMIT, 10000000);
+      ldap_set_option($this->cid, LDAP_OPT_SIZELIMIT, 10000000);
     }
     if($this->hascon){
-      @ldap_set_option($this->cid, LDAP_OPT_SIZELIMIT, $size);
+      ldap_set_option($this->cid, LDAP_OPT_SIZELIMIT, $size);
     } else {
       $this->error = "Could not connect to LDAP server";
     }
@@ -277,16 +277,16 @@ class LDAP{
         if ($this->start == 0)
         {
           $this->start = 1;
-          $this->re= @ldap_first_entry($this->cid, $this->sr);
+          $this->re= ldap_first_entry($this->cid, $this->sr);
         } else {
-          $this->re= @ldap_next_entry($this->cid, $this->re);
+          $this->re= ldap_next_entry($this->cid, $this->re);
         }
         if ($this->re)
         {
-          $att= @ldap_get_attributes($this->cid, $this->re);
-          $att['dn']= trim($this->convert(@ldap_get_dn($this->cid, $this->re)));
+          $att= ldap_get_attributes($this->cid, $this->re);
+          $att['dn']= trim($this->convert(ldap_get_dn($this->cid, $this->re)));
         }
-        $this->error = @ldap_error($this->cid);
+        $this->error = ldap_error($this->cid);
         if (!isset($att)){
           $att= array();
         }
@@ -310,7 +310,7 @@ class LDAP{
   {
     if($this->hasres){
       $this->hasres = false;
-      @ldap_free_result($this->sr);
+      ldap_free_result($this->sr);
     }
   }
 
@@ -325,9 +325,9 @@ class LDAP{
           }
           else
           {
-          $rv = @ldap_get_dn($this->cid, $this->re);
+          $rv = ldap_get_dn($this->cid, $this->re);
         
-          $this->error = @ldap_error($this->cid);
+          $this->error = ldap_error($this->cid);
           return(trim($this->convert($rv)));
            }
       }else{
@@ -344,8 +344,8 @@ class LDAP{
   {
     if($this->hascon){
       if($this->hasres){
-        $rv = @ldap_count_entries($this->cid, $this->sr);
-        $this->error = @ldap_error($this->cid);
+        $rv = ldap_count_entries($this->cid, $this->sr);
+        $this->error = ldap_error($this->cid);
         return($rv);
       }else{
         $this->error = "Perform a Fetch with no Search";
@@ -364,8 +364,8 @@ class LDAP{
       if ($dn == "")
         $dn = $this->basedn;
 
-      $r = @ldap_mod_del($this->cid, $this->fix($dn), $attrs);
-      $this->error = @ldap_error($this->cid);
+      $r = ldap_mod_del($this->cid, $this->fix($dn), $attrs);
+      $this->error = ldap_error($this->cid);
       return($r);
     }else{
       $this->error = "Could not connect to LDAP server";
@@ -380,8 +380,8 @@ class LDAP{
       if ($dn == "")
         $dn = $this->basedn;
 
-      $r = @ldap_mod_replace($this->cid, $this->fix($dn), $attrs);
-      $this->error = @ldap_error($this->cid);
+      $r = ldap_mod_replace($this->cid, $this->fix($dn), $attrs);
+      $this->error = ldap_error($this->cid);
       return($r);
     }else{
       $this->error = "Could not connect to LDAP server";
@@ -393,8 +393,8 @@ class LDAP{
   {
     if($this->hascon){
       if ($this->reconnect) $this->connect();
-      $r = @ldap_delete($this->cid, $this->fix($deletedn));
-      $this->error = @ldap_error($this->cid);
+      $r = ldap_delete($this->cid, $this->fix($deletedn));
+      $this->error = ldap_error($this->cid);
       return($r ? $r : 0);
     }else{
       $this->error = "Could not connect to LDAP server";
@@ -432,8 +432,8 @@ class LDAP{
       }
       
       /* Finally Delete own Node */
-      $r = @ldap_delete($this->cid, $this->fix($deletedn));
-      $this->error = @ldap_error($this->cid);
+      $r = ldap_delete($this->cid, $this->fix($deletedn));
+      $this->error = ldap_error($this->cid);
       return($r ? $r : 0);
     }else{
       $this->error = "Could not connect to LDAP server";
@@ -448,16 +448,16 @@ class LDAP{
     error_reporting(E_ALL);
     
     if($is_first){
-      echo "<h2>".sprintf(_("Creating copy of %s"),"<i>".@LDAP::fix($sourcedn)."</i>")."</h2>";
+      echo "<h2>".sprintf(_("Creating copy of %s"),"<i>".LDAP::fix($sourcedn)."</i>")."</h2>";
     }else{
       if(preg_match("/^ou=/",$sourcedn)){
-        echo "<h3>"._("Processing")." <i>".@LDAP::fix($destinationdn)."</i></h3>";
+        echo "<h3>"._("Processing")." <i>".LDAP::fix($destinationdn)."</i></h3>";
       }else{
         $tmp = split(",",$sourcedn);
         
         echo "&nbsp;<b>"._("Object").":</b> ";
 
-        $deststr = @LDAP::fix($destinationdn);
+        $deststr = LDAP::fix($destinationdn);
         if(strlen($deststr) > 96){
           $deststr = substr($deststr,0,96)."...";
         }
@@ -533,7 +533,7 @@ class LDAP{
             if(in_array($key ,array("FAItemplateFile","FAIscript", "gotoLogonScript", "gosaApplicationIcon","gotoMimeIcon"))){
               $sr= ldap_read($this->cid, $this->fix($sourcedn), "$key=*", array($key));
               $ei= ldap_first_entry($this->cid, $sr);
-              if ($tmp= @ldap_get_values_len($this->cid, $ei,$key)){
+              if ($tmp= ldap_get_values_len($this->cid, $ei,$key)){
                 $attr[$key] = $tmp;
               }
             }
@@ -618,8 +618,8 @@ class LDAP{
     }
     if($this->hascon){
       if ($this->reconnect) $this->connect();
-      $r = @ldap_modify($this->cid, $this->fix($this->basedn), $attrs);
-      $this->error = @ldap_error($this->cid);
+      $r = ldap_modify($this->cid, $this->fix($this->basedn), $attrs);
+      $this->error = ldap_error($this->cid);
       return($r ? $r : 0);
     }else{
       $this->error = "Could not connect to LDAP server";
@@ -631,8 +631,8 @@ class LDAP{
   {
     if($this->hascon){
       if ($this->reconnect) $this->connect();
-      $r = @ldap_add($this->cid, $this->fix($this->basedn), $attrs);
-      $this->error = @ldap_error($this->cid);
+      $r = ldap_add($this->cid, $this->fix($this->basedn), $attrs);
+      $this->error = ldap_error($this->cid);
       return($r ? $r : 0);
     }else{
       $this->error = "Could not connect to LDAP server";
@@ -738,13 +738,13 @@ class LDAP{
   {
     $data= "";
     if ($this->reconnect) $this->connect();
-    $sr= @ldap_read($this->cid, $this->fix($dn), "objectClass=*", array("$name"));
+    $sr= ldap_read($this->cid, $this->fix($dn), "objectClass=*", array("$name"));
 
     /* fill data from LDAP */
     if ($sr) {
-      $ei= @ldap_first_entry($this->cid, $sr);
+      $ei= ldap_first_entry($this->cid, $sr);
       if ($ei) {
-        if ($info= @ldap_get_values_len($this->cid, $ei, "$name")){
+        if ($info= ldap_get_values_len($this->cid, $ei, "$name")){
           $data= $info[0];
         }
 
@@ -763,7 +763,7 @@ class LDAP{
   function get_additional_error()
   {
     $error= "";
-    @ldap_get_option ($this->cid, LDAP_OPT_ERROR_STRING, $error);
+    ldap_get_option ($this->cid, LDAP_OPT_ERROR_STRING, $error);
     return ($error);
   }
 
@@ -859,10 +859,10 @@ class LDAP{
     }
 
     /* Searching Ldap Tree */
-    $sr= @ldap_read($this->cid, $this->fix($dn), $filter, $name);
+    $sr= ldap_read($this->cid, $this->fix($dn), $filter, $name);
 
     /* Get the first entry */   
-    $entry= @ldap_first_entry($this->cid, $sr);
+    $entry= ldap_first_entry($this->cid, $sr);
 
     /* Get all attributes related to that Objekt */
     $atts = array();
@@ -874,14 +874,14 @@ class LDAP{
     /* Reset index */
     $i = 1 ; 
   $identifier = array();
-    $attribute= @ldap_first_attribute($this->cid,$entry,$identifier);
+    $attribute= ldap_first_attribute($this->cid,$entry,$identifier);
     while ($attribute) {
       $i++;
       $atts[$i]['name']  = $attribute;
-      $atts[$i]['value'] = @ldap_get_values_len($this->cid, $entry, "$attribute");
+      $atts[$i]['value'] = ldap_get_values_len($this->cid, $entry, "$attribute");
 
       /* Next one */
-      $attribute= @ldap_next_attribute($this->cid,$entry,$identifier);
+      $attribute= ldap_next_attribute($this->cid,$entry,$identifier);
     }
 
     foreach($atts as $at)
@@ -889,7 +889,7 @@ class LDAP{
       for ($i= 0; $i<$at['value']['count']; $i++){
 
         /* Check if we must encode the data */
-        if(!preg_match('/^[a-z0-9+@#.=, \/ -]+$/i', $at['value'][$i])) {
+        if(!preg_match('/^[a-z0-9+#.=, \/ -]+$/i', $at['value'][$i])) {
           $ret .= $at['name'].":: ".base64_encode($at['value'][$i])."\n";
         } else {
           $ret .= $at['name'].": ".$at['value'][$i]."\n";
@@ -903,7 +903,7 @@ class LDAP{
 
   function dn_exists($dn)
   {
-    return @ldap_list($this->cid, $this->fix($dn), "(objectClass=*)", array("objectClass"));
+    return ldap_list($this->cid, $this->fix($dn), "(objectClass=*)", array("objectClass"));
   }
   
 
@@ -1187,8 +1187,8 @@ class LDAP{
          $objectclasses = array();
        
          # Get base to look for schema 
-         $sr = @ldap_read ($this->cid, NULL, "objectClass=*", array("subschemaSubentry"));
-         $attr = @ldap_get_entries($this->cid,$sr);
+         $sr = ldap_read ($this->cid, NULL, "objectClass=*", array("subschemaSubentry"));
+         $attr = ldap_get_entries($this->cid,$sr);
          if (!isset($attr[0]['subschemasubentry'][0])){
            return array();
          }
@@ -1221,7 +1221,7 @@ class LDAP{
     }
   }
 
-  /* added by Guido Serra aka Zeph <zeph@purotesto.it> */
+  /* added by Guido Serra aka Zeph <zephpurotesto.it> */
   function getCn($dn){
     $simple= split(",", $dn);
 
@@ -1245,8 +1245,8 @@ class LDAP{
     $r= ldap_bind ($ds, $admin, $password);
 
     /* Get base to look for naming contexts */
-    $sr  = @ldap_read ($ds, "", "objectClass=*", array("namingContexts"));
-    $attr= @ldap_get_entries($ds,$sr);
+    $sr  = ldap_read ($ds, "", "objectClass=*", array("namingContexts"));
+    $attr= ldap_get_entries($ds,$sr);
     
     return ($attr[0]['namingcontexts']);
   }
index 289e15420bcdd9ea9ac6e891866f64aacbe80cce..e6c11cf383e6b9c6eac360fa4d5c73fb7481dfaa 100644 (file)
@@ -672,6 +672,10 @@ class mailAccount extends plugin
     @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, "Save");
     $ldap->cd($this->dn);
     $this->cleanup();
+
+    print_a($this->attrs);
+    exit();
+
     $ldap->modify ($this->attrs); 
 
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/mail account with dn '%s' failed."),$this->dn));