Code

Moved idgen & minid from step2 to setup step1
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 10:47:21 +0000 (10:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Apr 2007 10:47:21 +0000 (10:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6120 594d385d-05f5-0310-b6e9-bd551577e9d8

contrib/gosa.conf
setup/class_setupStep_Config1.inc
setup/class_setupStep_Config2.inc
setup/setup_config1.tpl
setup/setup_config2.tpl

index e09ec62fc9e2ba341e1e8a354222c4c62b1154ef..b4de9cee84a929d7f22ce01082fe3c9f74b2130a 100644 (file)
 {if $cv.generic_settings.wws_ou_active}
                        winstations="{$cv.generic_settings.wws_ou}"
 {/if}
-{if $cv.generic_settings.idgen_active}
-                       idgen="{$cv.generic_settings.idgen}"
+{if $cv.id_settings.idgen_active}
+                       idgen="{$cv.id_settings.idgen}"
 {/if}
 {if $cv.strict}
                        strict="no"
 {else}
                        strict="yes"
 {/if}
-{if $cv.generic_settings.minid_active}
-                       minid="{$cv.generic_settings.minid}"
+{if $cv.id_settings.minid_active}
+                       minid="{$cv.id_settings.minid}"
 {/if}
 {if $cv.mail != "disabled"}
                        mailMethod="{$cv.mail}"
index 91bf20f8d938b54cc84e27e9e6f8c0e4e395182a..10e7806698d5bd8543dcf153be3e5477fdcb3bdb 100644 (file)
@@ -43,6 +43,11 @@ class Step_Config1 extends setup_step
                           "externalpwdhook" => "/path/to/your/script username oldpassword newpassword",
                           "externalpwdhook_active" => FALSE);
 
+  var $id_settings = array(       "idgen"         => "{%sn}-{%givenName[2-4]}",
+                                  "idgen_active"  => FALSE,
+                                  "minid"         => "100",
+                                  "minid_active"  => FALSE);
+
   var $crypt_methods  = array();
 
   var $attributes = array("peopleou","groupou","peopledn","uidbase","encryption","theme","errorlvl",
@@ -71,6 +76,7 @@ class Step_Config1 extends setup_step
   {
     $smarty = get_smarty();
     $smarty->assign("peopledns",array("uid","cn"));
+    $smarty->assign("id_settings",$this->id_settings);
     $smarty->assign("crypt_methods",$this->crypt_methods);
     $smarty->assign("themes",$this->get_themes());
     $smarty->assign("pwd_rules",$this->pwd_rules);
@@ -98,6 +104,10 @@ class Step_Config1 extends setup_step
   {
     $message = array();
 
+    if(isset($this->id_settings['minid_active']) && !is_numeric($this->id_settings['minid'])){
+      $message[] = sprintf(_("The specified value for '%s' must be a numeric value"),_("GID / UID min id"));
+    }
+
     if(preg_match("/,$/",$this->peopleou)){
       $message[] =sprintf(_("Don't add a trailing comma to '%s'."),_("People storage ou"));
     }
@@ -130,6 +140,25 @@ class Step_Config1 extends setup_step
         }
       }
 
+      if(isset($_POST['minid_active'])){
+        $this->id_settings['minid_active'] = TRUE;
+        if(isset($_POST['minid'])){
+          $this->id_settings['minid'] = $_POST['minid'];
+        }
+      }else{
+        $this->id_settings['minid_active'] = FALSE;
+      }
+
+      /* Generic settings */
+      if(isset($_POST['idgen_active'])){
+        $this->id_settings['idgen_active'] = TRUE;
+        if(isset($_POST['idgen'])){
+          $this->id_settings['idgen'] = $_POST['idgen'];
+        }
+      }else{
+        $this->id_settings['idgen_active'] = FALSE;
+      }
+
       /* Get password settings */ 
       if(isset($_POST['pwdiffer_active'])){
         $this->pwd_rules['pwdiffer_active'] = TRUE;
@@ -184,7 +213,7 @@ class Step_Config1 extends setup_step
   function get_attributes()
   {
     $tmp = setup_step::get_attributes();
-    foreach(array("pwd_rules") as $attr){
+    foreach(array("pwd_rules","id_settings") as $attr){
       $tmp[$attr]= $this->$attr;
     }
     return($tmp);
index 7dbced6b9e39908fc326e2eace71867dfdf34b6b..259e10430917b74aa82d4f6a25d36fddf14938a1 100644 (file)
 
 class Step_Config2 extends setup_step
 {
-  var $strict         = TRUE;
   var $governmentmode = FALSE;
   var $sambaidmapping = FALSE;
-  var $minid          = 100;       
+  var $strict         = TRUE;
   var $account_expiration  =FALSE;
   var $header_image = "images/ldapserver.png";
 
@@ -35,11 +34,7 @@ class Step_Config2 extends setup_step
   var $mail_settings = array("vacationdir"        => "/etc/gosa/vacation",
                              "vacationdir_active" => FALSE);
 
-  var $generic_settings  = array( "idgen"         => "{%sn}-{%givenName[2-4]}",
-                                  "idgen_active"  => FALSE,
-                                  "minid"         => "100",
-                                  "minid_active"  => FALSE,
-                                  "wws_ou"        => "ou=winstations",
+  var $generic_settings  = array( "wws_ou"        => "ou=winstations",
                                   "wws_ou_active" => FALSE,
                                   "snapshot_active"     => FALSE,
                                   "snapshot_base"       => "ou=snapshots,%base%",
@@ -52,6 +47,7 @@ class Step_Config2 extends setup_step
                                   "samba_sid_active" => FALSE,
                                   "samba_rid"        => 1000,
                                   "samba_rid_active" => FALSE); 
+
   var $attributes = array("strict","governmentmode","sambaidmapping","account_expiration","cyrusunixstyle","mail");
 
   function Step_Config2()
@@ -118,15 +114,6 @@ class Step_Config2 extends setup_step
         $this->mail_settings['vacationdir_active'] = FALSE;
       }
 
-      if(isset($_POST['minid_active'])){
-        $this->generic_settings['minid_active'] = TRUE;
-        if(isset($_POST['minid'])){
-          $this->generic_settings['minid'] = $_POST['minid'];
-        }
-      }else{
-        $this->generic_settings['minid_active'] = FALSE;
-      }
-
       if(isset($_POST['wws_ou_active'])){
         $this->generic_settings['wws_ou_active'] = TRUE;
         if(isset($_POST['wws_ou'])){
@@ -136,15 +123,6 @@ class Step_Config2 extends setup_step
         $this->generic_settings['wws_ou_active'] = FALSE;
       }
 
-      /* Generic settings */
-      if(isset($_POST['idgen_active'])){
-        $this->generic_settings['idgen_active'] = TRUE;
-        if(isset($_POST['idgen'])){
-          $this->generic_settings['idgen'] = $_POST['idgen'];
-        }
-      }else{
-        $this->generic_settings['idgen_active'] = FALSE;
-      }
       if(isset($_POST['snapshot_active'])){
         $this->generic_settings['snapshot_active'] = TRUE;
         if(isset($_POST['snapshot_base'])){
@@ -198,11 +176,6 @@ class Step_Config2 extends setup_step
   function check()
   {
     $message = array();
-    
-    if(isset($this->generic_settings['minid_active']) && !is_numeric($this->generic_settings['minid'])){
-      $message[] = sprintf(_("The specified value for '%s' must be a numeric value"),_("GID / UID min id"));
-    }
-  
     return($message);
   }
   
index 31b2ba89d1bebe2865a6ede2f2c26426f476a98e..e61893bfd8f1770d27851d51587fd1882f862f90 100644 (file)
@@ -43,7 +43,6 @@
         </div>
     </div>
 
-
        <div class='step4_container'>
         <div class='step4_name'>
             {t}Group storage subtree{/t}
         </div>
     </div>
 
+       <div class='step4_container'>
+        <div class='step4_name'>
+            {t}Automatic uids{/t}
+        </div>
+        <div class='step4_value'>
+            {if $id_settings.idgen_active == FALSE}
+                <input type='checkbox' value='1' name='idgen_active'
+                    onClick='changeState("idgen");'>
+                <input style='width:90%' id='idgen' name='idgen' type='text' value='{$id_settings.idgen}' disabled>
+            {else}
+                <input type='checkbox' value='1' name='idgen_active' checked>
+                <input style='width:90%' id='idgen' name='idgen' type='text' value='{$id_settings.idgen}'  >
+            {/if}
+        </div>
+    </div>
+
+       <div class='step4_container'>
+        <div class='step4_name'>
+            {t}GID / UID min id{/t}
+        </div>
+        <div class='step4_value'>
+            {if $id_settings.minid_active == FALSE}
+                <input type='checkbox' value='1' name='minid_active'
+                    onClick='changeState("minid");'>
+                <input style='width:90%' id='minid' name='minid' type='text' value='{$id_settings.minid}' disabled>
+            {else}
+                <input type='checkbox' value='1' name='minid_active' checked>
+                <input style='width:90%' id='minid' name='minid' type='text' value='{$id_settings.minid}'  >
+            {/if}
+        </div>
+    </div>
+
     <div class='step4_container' style="margin-bottom:5px;">
         <div class='step4_name'>
             {t}Number base for people/groups{/t}
index 5cde3b4d784b3bdd7ac385570ebc4128bff47656..c30887d790ebbeba49f3737f5777ba72bf362018 100644 (file)
 
     <p><b>{t}Additional GOsa settings{/t}</b></p>
        
-    <div class='step4_container'>
-        <div class='step4_name'>
-            {t}GID / UID min id{/t}
-        </div>
-        <div class='step4_value'>
-            {if $generic_settings.minid_active == FALSE}
-                <input type='checkbox' value='1' name='minid_active'
-                    onClick='changeState("minid");'>
-                <input style='width:90%' id='minid' name='minid' type='text' value='{$generic_settings.minid}' disabled>
-            {else}
-                <input type='checkbox' value='1' name='minid_active' checked>
-                <input style='width:90%' id='minid' name='minid' type='text' value='{$generic_settings.minid}'  >
-            {/if}
-        </div>
-    </div>
-
     <div class='step4_container'>
         <div class='step4_name'>
             {t}Relaxed naming policies{/t}
         </div>
     </div>
 
-       
-    <div class='step4_container'>
-        <div class='step4_name'>
-            {t}Automatic uids{/t}
-        </div>
-        <div class='step4_value'>
-            {if $generic_settings.idgen_active == FALSE}
-                <input type='checkbox' value='1' name='idgen_active'
-                    onClick='changeState("idgen");'>
-                <input style='width:90%' id='idgen' name='idgen' type='text' value='{$generic_settings.idgen}' disabled>
-            {else}
-                <input type='checkbox' value='1' name='idgen_active' checked>
-                <input style='width:90%' id='idgen' name='idgen' type='text' value='{$generic_settings.idgen}'  >
-            {/if}
-        </div>
-    </div>
     <div class='step4_container'>
         <div class='step4_name'>
             {t}Use account expiration{/t}