index 30dd7f931cacdd233eb14bc44ef6f573d99fff19..8f3e499a73b0f7d0c1fc6b0aaf3f983a02b972f3 100644 (file)
*/
-class setup_step_6 extends setup_step
+class Step_Config2 extends setup_step
{
- var $strict = TRUE;
var $governmentmode = FALSE;
var $sambaidmapping = FALSE;
- var $minid = 100;
- var $account_expiration =FALSE;
+ var $header_image = "images/ldapserver.png";
- var $generic_settings = array( "idgen" => "{%sn}-{%givenName[2-4]}",
- "idgen_active" => FALSE,
- "minid" => "100",
- "minid_active" => FALSE,
+ var $cyrusunixstyle = FALSE;
+ var $mail = "none";
+ var $mail_methods = array();
+ var $mail_settings = array("vacationdir" => "/etc/gosa/vacation",
+ "vacationdir_active" => FALSE);
+
+ var $generic_settings = array( "enableCopyPaste" => false,
"wws_ou" => "ou=winstations",
"wws_ou_active" => FALSE,
"snapshot_active" => FALSE,
"snapshot_base" => "ou=snapshots,%base%",
- "snapshot_ldap_base" => "%base%",
"snapshot_user" => "cn=ldapadmin,%base%",
"snapshot_password" => "",
"snapshot_server" => "%connection%");
"samba_sid_active" => FALSE,
"samba_rid" => 1000,
"samba_rid_active" => FALSE);
- var $attributes = array("strict","governmentmode","sambaidmapping","account_expiration");
- function setup_step_6()
+ var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail");
+
+ function Step_Config2()
{
$this->update_strings();
+ $tmp = $this->get_available_mail_classes();
+ foreach($tmp['name'] as $name){
+ $this->mail_methods[$name] = $name;
+ }
}
function update_strings()
{
$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");
+ $this->s_title_long = _("GOsa settings 2/3");
+ $this->s_info = _("Customize special parameters");
}
{
/* Update snapshot values, with already collected values */
foreach($this->generic_settings as $key => $value){
- foreach(array("snapshot_ldap_base","snapshot_base","snapshot_user","snapshot_server") as $attr){
+ foreach(array("snapshot_base","snapshot_user","snapshot_server") as $attr){
foreach($this->parent->captured_values as $replace_name => $replace_value){
if(is_string($replace_value)) {
$this->generic_settings[$attr] = preg_replace("/%".$replace_name."%/",$replace_value,$this->generic_settings[$attr]);
$smarty = get_smarty();
$smarty->assign("generic_settings",$this->generic_settings);
+ $smarty->assign("mail_settings",$this->mail_settings);
+ $smarty->assign("mail_methods",$this->mail_methods);
$smarty->assign("samba_settings",$this->samba_settings);
- $smarty->assign("warnings" ,$this->check());
- $smarty->assign("warnings_cnt" ,count($this->check()));
$smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes")));
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
}
- return($smarty -> fetch (get_template_path("../setup/setup_step6.tpl")));
+ return($smarty -> fetch (get_template_path("../setup/setup_config2.tpl")));
}
function save_object()
}
}
- if(isset($_POST['minid_active'])){
- $this->generic_settings['minid_active'] = TRUE;
- if(isset($_POST['minid'])){
- $this->generic_settings['minid'] = $_POST['minid'];
+ /* 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->generic_settings['minid_active'] = FALSE;
+ $this->mail_settings['vacationdir_active'] = FALSE;
+ }
+
+ if(isset($_POST['enableCopyPaste'])){
+ $this->generic_settings['enableCopyPaste'] = $_POST['enableCopyPaste'];
}
if(isset($_POST['wws_ou_active'])){
$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'])){
if(isset($_POST['snapshot_server'])){
$this->generic_settings['snapshot_server'] = $_POST['snapshot_server'];
}
- if(isset($_POST['snapshot_ldap_base'])){
- $this->generic_settings['snapshot_ldap_base'] = $_POST['snapshot_ldap_base'];
- }
}else{
$this->generic_settings['snapshot_active'] = FALSE;
}
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);
}
function get_attributes()
{
$tmp = setup_step::get_attributes();
- foreach(array("samba_settings","generic_settings") as $attr){
+ foreach(array("samba_settings","generic_settings","mail_settings") as $attr){
$tmp[$attr]= $this->$attr;
}
return($tmp);
}
+/* 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);
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: