X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=setup%2Fclass_setupStep_Config1.inc;h=8d4cf4f969e7e4ad43987f6af7b1937aa3278505;hb=f9e2a15ea3578c6c86efef30a0c8ebededefbb9e;hp=1afc3b07de0c84ff6b81aa65105aa39dc80d3604;hpb=9344a78adfff20e74b35bae122944829784c2323;p=gosa.git diff --git a/setup/class_setupStep_Config1.inc b/setup/class_setupStep_Config1.inc index 1afc3b07d..8d4cf4f96 100644 --- a/setup/class_setupStep_Config1.inc +++ b/setup/class_setupStep_Config1.inc @@ -27,32 +27,36 @@ class Step_Config1 extends setup_step var $groupou = "ou=groups"; var $peopledn = "cn"; var $uidbase = 1000; + var $krbsasl = FALSE; + var $strict = TRUE; - var $base_hook = "/usr/bin/sudo myscript"; + var $header_image = "images/ldapserver.png"; + var $account_expiration =FALSE; + var $base_hook = ""; var $base_hook_active = FALSE; var $encryption = "crypt"; - var $mail = "none"; var $theme = "default"; var $errorlvl = FALSE; - var $cyrusunixstyle = FALSE; + + var $include_personal_title = FALSE; var $pwd_rules = array("pwminlen" => 6, "pwminlen_active" => FALSE, "pwdiffer" => 5, "pwdiffer_active" => FALSE, - "externalpwdhook" => "/path/to/your/script username oldpassword newpassword", + "externalpwdhook" => "", "externalpwdhook_active" => FALSE); - var $mail_settings = array("vacationdir" => "/etc/gosa/vacation", - "vacationdir_active" => FALSE); - - var $crypt_methods = array(); - var $mail_methods = array(); + 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","mail","theme","errorlvl","cyrusunixstyle", - "base_hook","base_hook_active"); + var $attributes = array("peopleou","groupou","peopledn","uidbase","encryption","theme","errorlvl","krbsasl", + "base_hook","base_hook_active","account_expiration","strict","include_personal_title"); function Step_Config1() { @@ -62,10 +66,6 @@ class Step_Config1 extends setup_step foreach($tmp['name'] as $name){ $this->crypt_methods[$name] = $name; } - $tmp = $this->get_available_mail_classes(); - foreach($tmp['name'] as $name){ - $this->mail_methods[$name] = $name; - } } @@ -81,45 +81,23 @@ 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("mail_methods",$this->mail_methods); $smarty->assign("themes",$this->get_themes()); $smarty->assign("pwd_rules",$this->pwd_rules); - $smarty->assign("mail_settings",$this->mail_settings); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); - $smarty->assign("warnings" ,$this->check()); - $smarty->assign("warnings_cnt" ,count($this->check())); foreach($this->attributes as $attr){ $smarty->assign($attr,$this->$attr); } + + /* !!! Attention strict is inverse. If you change this, + * don't forget to change save_object too + */ + $smarty->assign("strict",!$this->strict); return($smarty -> fetch (get_template_path("../setup/setup_config1.tpl"))); } - /* Returns the classnames auf the mail classes */ - function get_available_mail_classes() - { - $dir = opendir( "../include"); - $methods = array(); - $suffix = "class_mail-methods-"; - $lensuf = strlen($suffix); - $prefix = ".inc"; - $lenpre = strlen($prefix); - $i = 0; - while (($file = readdir($dir)) !== false){ - - if(stristr($file,$suffix)) { - $lenfile = strlen($file); - $methods['name'][$i] = substr($file,$lensuf,($lenfile-$lensuf)-$lenpre); - $methods['file'][$i] = $file; - $methods[$i]['file'] = $file; - $methods[$i]['name'] = substr($file,$lensuf,($lenfile-$lensuf)-$lenpre); - $i++; - } - } - return($methods); - } - function get_themes() { $dir = opendir( "../ihtml/themes/"); @@ -136,6 +114,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")); } @@ -155,7 +137,6 @@ class Step_Config1 extends setup_step $message[] = _("The given password differ value is not numeric."); } return($message); - } function save_object() @@ -169,6 +150,36 @@ class Step_Config1 extends setup_step } } + /* !!! Attention strict is inverse. If you change this, + * don't forget to change the smarty assignment too + */ + if(isset($_POST['strict'])){ + if($_POST['strict']){ + $this->strict = FALSE; + }else{ + $this->strict = TRUE; + } + } + + 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; @@ -189,17 +200,7 @@ class Step_Config1 extends setup_step $this->pwd_rules['pwminlen_active'] = FALSE; } - /* Mail settings */ - if(isset($_POST['vacationdir_active'])){ - $this->mail_settings['vacationdir_active'] = TRUE; - if(isset($_POST['vacationdir'])){ - $this->mail_settings['vacationdir'] = $_POST['vacationdir']; - } - }else{ - $this->mail_settings['vacationdir_active'] = FALSE; - } - - /* Mail settings */ + /* External pwd settings */ if(isset($_POST['externalpwdhook_active'])){ $this->pwd_rules['externalpwdhook_active'] = TRUE; if(isset($_POST['externalpwdhook'])){ @@ -209,7 +210,7 @@ class Step_Config1 extends setup_step $this->pwd_rules['externalpwdhook_active'] = FALSE; } - /* Mail settings */ + /* base hook settings */ if(isset($_POST['base_hook_active'])){ $this->pwd_rules['base_hook_active'] = TRUE; if(isset($_POST['base_hook'])){ @@ -233,7 +234,7 @@ class Step_Config1 extends setup_step function get_attributes() { $tmp = setup_step::get_attributes(); - foreach(array("pwd_rules","mail_settings") as $attr){ + foreach(array("pwd_rules","id_settings") as $attr){ $tmp[$attr]= $this->$attr; } return($tmp);