index d238af0455f89790251f38bde337ef73bef07166..404acb0a93f628686ecf4f9410088dedc517f3a7 100644 (file)
var $header_image = "images/ldapserver.png";
var $cyrusunixstyle = FALSE;
- var $mail = "none";
+ var $mail = "none";
var $mail_methods = array();
- var $mail_settings = array("vacationdir" => "/etc/gosa/vacation",
+ var $mail_settings = array("vacationdir" => "/etc/gosa/vacation",
"vacationdir_active" => FALSE);
+ var $mail_attrib = "";
- var $generic_settings = array( "enableCopyPaste" => false,
- "wws_ou" => "ou=winstations",
- "wws_ou_active" => FALSE,
- "snapshot_active" => FALSE,
- "snapshot_base" => "ou=snapshots,%base%",
- "snapshot_user" => "%admin%",
- "snapshot_password" => "",
- "snapshot_server" => "%connection%");
+ var $generic_settings = array(
+ "enableCopyPaste" => false,
+ "enableDNS" => false,
+ "enableDHCP" => false,
+ "wws_ou" => "ou=winstations",
+ "wws_ou_active" => FALSE);
var $samba_settings = array( "samba_sid" => "0-815-4711",
"samba_sid_active" => FALSE,
"smbhash" => 'SMBHASH',
"samba_rid_active" => FALSE);
- var $sambaDomain_found = FALSE;
+ var $sambaDomain_found = FALSE;
+ var $use_netatalk = FALSE;
+ var $enableFAI_management = FALSE;
+ var $enableMimeType = FALSE;
- var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail");
- var $called = FALSE;
+ var $timezone = "Europe/Berlin";
+ var $timezones = array();
+ var $attributes = array("mail_attrib","governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management","timezone","enableMimeType");
+ var $called = FALSE;
function Step_Config2()
{
$this->update_strings();
- $tmp = $this->get_available_mail_classes();
- foreach($tmp['name'] as $name){
- $this->mail_methods[$name] = $name;
- }
+ $this->mail_methods = $this->get_available_mail_classes();
/* Look for samba password generation method */
if(file_exists("/usr/bin/mkntpasswd")){
$pwdhash= 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"';
}
+ $this->timezones = _get_tz_zones();
$this->samba_settings['smbhash'] = $pwdhash;
}
$this->samba_settings['samba_sid_active'] = TRUE;
$this->samba_settings['samba_rid_active'] = TRUE;
}
-
- $this->called = TRUE;
- }
+
+ /* Check if we can enable netatalk plugin */
+ $tmp = $ldap->get_objectclasses();
+ if(is_array($tmp) && isset($tmp['apple-user'])) {
+ $this->use_netatalk = TRUE;
+ }
- /* Update snapshot values, with already collected values */
- foreach($this->generic_settings as $key => $value){
- 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]);
- }
- }
+ /* Check the FAI schema is used */
+ if(is_array($tmp) && isset($tmp['FAIclass'])){
+# $this->enableFAI_management = TRUE;
+ }
+
+ /* Check the MimeType schema is used */
+ if(is_array($tmp) && isset($tmp['gotoMimeType'])){
+ $this->enableMimeType = TRUE;
+ }
+
+ if(is_array($tmp) && isset($tmp['dhcpClass'])){
+ $this->generic_settings['enableDHCP'] = TRUE;
+ }
+
+ if(is_array($tmp) && isset($tmp['dNSZone'])){
+ $this->generic_settings['enableDNS'] = TRUE;
}
+
+ $this->called = TRUE;
}
$smarty = get_smarty();
$smarty->assign("mail_methods",$this->mail_methods);
$smarty->assign("samba_settings",$this->samba_settings);
$smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes")));
- foreach($this->attributes as $attr){
+ foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
}
+ $smarty->assign("timezone" ,$this->timezone);
+ $smarty->assign("timezones" ,$this->timezones);
return($smarty -> fetch (get_template_path("../setup/setup_config2.tpl")));
}
{
if(isset($_POST['step6_posted'])){
+ if(isset($_POST['timezone']) && isset($this->timezones['TIMEZONES'][$_POST['timezone']])){
+ $this->timezone = $_POST['timezone'];
+ }
+
+ $old_mail = $this->mail;
+
/* Get attributes */
foreach($this->attributes as $attr){
if(isset($_POST[$attr])){
if(isset($_POST['enableCopyPaste'])){
$this->generic_settings['enableCopyPaste'] = get_post('enableCopyPaste');
}
+ if(isset($_POST['enableDNS'])){
+ $this->generic_settings['enableDNS'] = get_post('enableDNS');
+ }
+ if(isset($_POST['enableDHCP'])){
+ $this->generic_settings['enableDHCP'] = get_post('enableDHCP');
+ }
if(isset($_POST['wws_ou_active'])){
$this->generic_settings['wws_ou_active'] = TRUE;
$this->generic_settings['wws_ou_active'] = FALSE;
}
- if(isset($_POST['snapshot_active'])){
- $this->generic_settings['snapshot_active'] = TRUE;
- if(isset($_POST['snapshot_base'])){
- $this->generic_settings['snapshot_base'] = get_post('snapshot_base');
- }
- if(isset($_POST['snapshot_user'])){
- $this->generic_settings['snapshot_user'] = get_post('snapshot_user');
- }
- if(isset($_POST['snapshot_password'])){
- $this->generic_settings['snapshot_password'] = get_post('snapshot_password');
- }
- if(isset($_POST['snapshot_server'])){
- $this->generic_settings['snapshot_server'] = get_post('snapshot_server');
- }
- }else{
- $this->generic_settings['snapshot_active'] = FALSE;
- }
-
/* Samba settings */
if(isset($_POST['samba_sid_active'])){
$this->samba_settings['samba_sid_active'] = TRUE;
}else{
$this->is_completed = FALSE;
}
+
+ /* Reload mail naming attribute */
+ if($old_mail != $this->mail && isset($this->mail_methods[$this->mail]['uattrib'])){
+ $this->mail_attrib = $this->mail_methods[$this->mail]['uattrib'];
+ }
}
$lensuf = strlen($suffix);
$prefix = ".inc";
$lenpre = strlen($prefix);
- $i = 0;
- while (($file = readdir($dir)) !== false){
+ $default_uattrib = "";
+ $m_class_vars = get_class_vars("mailMethod");
+ if(isset($m_class_vars['uattrib'])){
+ $default_uattrib = $m_class_vars['uattrib'];
+ }
+
+ while (($file = readdir($dir)) !== false){
if(stristr($file,$suffix)) {
+
+ require_once($file);
$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++;
+ $name = substr($file,$lensuf,($lenfile-$lensuf)-$lenpre);
+ $methods[$name]['file'] = $file;
+ $methods[$name]['name'] = $name;
+
+ $m_class_vars = get_class_vars("mailMethod".$methods[$name]['name']);
+ if(isset($m_class_vars['uattrib'])){
+ $methods[$name]['uattrib'] = $m_class_vars['uattrib'];
+ }else{
+ $methods[$name]['uattrib'] = $default_uattrib;
+ }
}
}
return($methods);