From: hickert Date: Wed, 4 Apr 2007 06:12:38 +0000 (+0000) Subject: Added setup step with optional settings X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1604bae20390b695adf90b476c5b0f02bf1314b8;p=gosa.git Added setup step with optional settings git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5961 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/setup/class_setup.inc b/setup/class_setup.inc index c2223069d..987fa0f21 100644 --- a/setup/class_setup.inc +++ b/setup/class_setup.inc @@ -22,7 +22,7 @@ require_once("class_setupStep.inc"); class setup { - var $i_steps = 8; // Number of setup steps + var $i_steps = 9; // Number of setup steps var $i_current= 1; // Current step var $i_last = 1; // Last setup step; var $o_steps = array(); @@ -37,8 +37,9 @@ class setup $this->o_steps[4] = new setup_step_4(); $this->o_steps[5] = new setup_step_5(); $this->o_steps[6] = new setup_step_6(); - $this->o_steps[7] = new setup_step_7(); - $this->o_steps[8] = new setup_step_8(); + $this->o_steps[7] = new setup_step_6a(); + $this->o_steps[8] = new setup_step_7(); + $this->o_steps[9] = new setup_step_8(); foreach($this->o_steps as $key => $step){ $this->o_steps[$key]->parent = $this; diff --git a/setup/class_setupStep5.inc b/setup/class_setupStep5.inc index 7cad07cc0..bff22d5a3 100644 --- a/setup/class_setupStep5.inc +++ b/setup/class_setupStep5.inc @@ -51,8 +51,8 @@ class setup_step_5 extends setup_step function setup_step_5() { - $this->s_title = _("GOsa settings 1/2"); - $this->s_title_long = _("GOsa generic settings, page 1/2"); + $this->s_title = _("GOsa settings 1/3"); + $this->s_title_long = _("GOsa generic settings, page 1/3"); $this->s_info = _("This dialog allows you to setup GOsa behaviour"); $tmp = @passwordMethod::get_available_methods_if_not_loaded(); diff --git a/setup/class_setupStep6.inc b/setup/class_setupStep6.inc index d5afff820..2f978e146 100644 --- a/setup/class_setupStep6.inc +++ b/setup/class_setupStep6.inc @@ -48,8 +48,8 @@ class setup_step_6 extends setup_step function setup_step_6() { - $this->s_title = _("GOsa settings 2/2"); - $this->s_title_long = _("GOsa generic settings, page 2/2"); + $this->s_title = _("GOsa settings 2/3"); + $this->s_title_long = _("GOsa generic settings, page 2/3"); $this->s_info = _("This dialog allows you to setup GOsa behaviour"); } diff --git a/setup/class_setupStep6a.inc b/setup/class_setupStep6a.inc new file mode 100644 index 000000000..69463a0da --- /dev/null +++ b/setup/class_setupStep6a.inc @@ -0,0 +1,143 @@ + false, + "forceglobals" => false, + "forcessl" => false, + "warnssl" => false, + "ppd_path" => "/var/spool/ppd/", + "ppd_path_active" => FALSE, + "kde_applications_menu" => "", + "kde_applications_menu_active" => FALSE, + "compile" => "/var/spool/gosa", + "debuglevel" => 0, + "session_lifetime" => 7200, + "max_ldap_query_time" => "5.0", + "max_ldap_query_time_active" => FALSE, + "smbhash" => 'SMBHASH'); + + + function setup_step_6a() + { + $this->s_title = _("GOsa settings 3/3"); + $this->s_title_long = _("GOsa generic settings, page 3/3"); + $this->s_info = _("This dialog allows you to setup GOsa behaviour"); + } + + + function execute() + { + $smarty = get_smarty(); + $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); + + $smarty->assign("optional", $this->optional); + + foreach($this->attributes as $attr){ + $smarty->assign($attr,$this->$attr); + } + + $smarty->assign("warnings" ,$this->check()); + $smarty->assign("warnings_cnt" ,count($this->check())); + + return($smarty -> fetch (get_template_path("../setup/setup_step6a.tpl"))); + } + + + function save_object() + { + if(isset($_POST['step6a_posted'])){ + + /* Get attributes */ + foreach($this->attributes as $attr){ + if(isset($_POST[$attr])){ + $this->$attr = validate($_POST[$attr]); + } + } + + foreach(array("enableCopyPaste","forceglobals","forcessl","warnssl","compile","debuglevel","session_lifetime","smbhash") as $name){ + if(isset($_POST[$name])){ + $this->optional[$name] = $_POST[$name]; + } + } + + if(isset($_POST['ppd_path_active'])){ + $this->optional['ppd_path_active'] = TRUE; + if(isset($_POST['ppd_path'])){ + $this->optional['ppd_path'] = $_POST['ppd_path']; + } + }else{ + $this->optional['ppd_path_active'] = FALSE; + } + + if(isset($_POST['kde_applications_menu_active'])){ + $this->optional['kde_applications_menu_active'] = TRUE; + if(isset($_POST['kde_applications_menu'])){ + $this->optional['kde_applications_menu'] = $_POST['kde_applications_menu']; + } + }else{ + $this->optional['kde_applications_menu_active'] = FALSE; + } + + if(isset($_POST['max_ldap_query_time_active'])){ + $this->optional['max_ldap_query_time_active'] = TRUE; + if(isset($_POST['max_ldap_query_time'])){ + $this->optional['max_ldap_query_time'] = $_POST['max_ldap_query_time']; + } + }else{ + $this->optional['max_ldap_query_time_active'] = FALSE; + } + + } + + $tmp = $this->check(); + if(count($tmp) == 0){ + $this->is_completed = TRUE; + }else{ + $this->is_completed = FALSE; + } + } + + + function check() + { + $message = array(); + return($message); + } + + + /* Attributes that are interesting for configuration generation */ + function get_attributes() + { + $tmp = setup_step::get_attributes(); + foreach(array("optional") as $attr){ + $tmp[$attr]= $this->$attr; + } + return($tmp); + } + +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/setup/setup_step6a.tpl b/setup/setup_step6a.tpl new file mode 100644 index 000000000..de4d3da4d --- /dev/null +++ b/setup/setup_step6a.tpl @@ -0,0 +1,209 @@ + +{if $warnings_cnt} +Errors: +{foreach from=$warnings item=val key=key} +
+ {$val} +{/foreach} +{/if} + +
+
+ {t}Optional settings{/t} +
+ + + +
+
+ {t}Enable Copy & Paste{/t} +
+
+ + +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Force globals{/t} +
+
+ + +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Force SSL{/t} +
+
+ + +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Warn SSL{/t} +
+
+ + +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}PPd path{/t} +
+
+ {if $optional.ppd_path_active == FALSE} + + + {else} + + + {/if} +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Kde applications menu{/t} +
+
+ {if $optional.kde_applications_menu_active == FALSE} + + + {else} + + + {/if} +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Smarty compile directory{/t} +
+
+ +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}SMB hash{/t} +
+
+ +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Session lifetime{/t} +
+
+ +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Maximal ldap query time{/t} +
+
+ {if $optional.max_ldap_query_time_active == FALSE} + + + {else} + + + {/if} +
+
+ {t}Infos in FAQ{/t}  + +
+
+ +
+
+ {t}Debuglevel{/t} +
+
+ +
+
+ {t}Infos in FAQ{/t}  + +
+
+ + +