From 73886e4ff753ebb42dbced8222270d8394dfedfc Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 Apr 2007 10:47:21 +0000 Subject: [PATCH] Moved idgen & minid from step2 to setup step1 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6120 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/gosa.conf | 8 ++++---- setup/class_setupStep_Config1.inc | 31 ++++++++++++++++++++++++++++- setup/class_setupStep_Config2.inc | 33 +++---------------------------- setup/setup_config1.tpl | 33 ++++++++++++++++++++++++++++++- setup/setup_config2.tpl | 32 ------------------------------ 5 files changed, 69 insertions(+), 68 deletions(-) diff --git a/contrib/gosa.conf b/contrib/gosa.conf index e09ec62fc..b4de9cee8 100644 --- a/contrib/gosa.conf +++ b/contrib/gosa.conf @@ -336,16 +336,16 @@ {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}" diff --git a/setup/class_setupStep_Config1.inc b/setup/class_setupStep_Config1.inc index 91bf20f8d..10e780669 100644 --- a/setup/class_setupStep_Config1.inc +++ b/setup/class_setupStep_Config1.inc @@ -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); diff --git a/setup/class_setupStep_Config2.inc b/setup/class_setupStep_Config2.inc index 7dbced6b9..259e10430 100644 --- a/setup/class_setupStep_Config2.inc +++ b/setup/class_setupStep_Config2.inc @@ -22,10 +22,9 @@ 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); } diff --git a/setup/setup_config1.tpl b/setup/setup_config1.tpl index 31b2ba89d..e61893bfd 100644 --- a/setup/setup_config1.tpl +++ b/setup/setup_config1.tpl @@ -43,7 +43,6 @@ -
{t}Group storage subtree{/t} @@ -53,6 +52,38 @@
+
+
+ {t}Automatic uids{/t} +
+
+ {if $id_settings.idgen_active == FALSE} + + + {else} + + + {/if} +
+
+ +
+
+ {t}GID / UID min id{/t} +
+
+ {if $id_settings.minid_active == FALSE} + + + {else} + + + {/if} +
+
+
{t}Number base for people/groups{/t} diff --git a/setup/setup_config2.tpl b/setup/setup_config2.tpl index 5cde3b4d7..c30887d79 100644 --- a/setup/setup_config2.tpl +++ b/setup/setup_config2.tpl @@ -59,22 +59,6 @@

{t}Additional GOsa settings{/t}

-
-
- {t}GID / UID min id{/t} -
-
- {if $generic_settings.minid_active == FALSE} - - - {else} - - - {/if} -
-
-
{t}Relaxed naming policies{/t} @@ -97,22 +81,6 @@
- -
-
- {t}Automatic uids{/t} -
-
- {if $generic_settings.idgen_active == FALSE} - - - {else} - - - {/if} -
-
{t}Use account expiration{/t} -- 2.30.2