index 408b2f828f05ed66f79fd6e472a513d7363e42c9..e6b96b10cd333da4261ba4a26cda2fd7828709d3 100644 (file)
"vacationdir_active" => FALSE);
var $generic_settings = array( "enableCopyPaste" => false,
"vacationdir_active" => FALSE);
var $generic_settings = array( "enableCopyPaste" => false,
+ "enableDNS" => false,
+ "enableDHCP" => false,
"wws_ou" => "ou=winstations",
"wws_ou_active" => FALSE,
"snapshot_active" => FALSE,
"snapshot_base" => "ou=snapshots,%base%",
"wws_ou" => "ou=winstations",
"wws_ou_active" => FALSE,
"snapshot_active" => FALSE,
"snapshot_base" => "ou=snapshots,%base%",
- "snapshot_user" => "cn=ldapadmin,%base%",
+ "snapshot_user" => "%admin%",
"snapshot_password" => "",
"snapshot_server" => "%connection%");
"snapshot_password" => "",
"snapshot_server" => "%connection%");
"smbhash" => 'SMBHASH',
"samba_rid_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("governmentmode","sambaidmapping","cyrusunixstyle","mail","use_netatalk","enableFAI_management","timezone","enableMimeType");
+ var $called = FALSE;
function Step_Config2()
{
function Step_Config2()
{
$pwdhash= 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"';
}
$pwdhash= 'perl -MCrypt::SmbHash -e "print join(q[:], ntlmgen \$ARGV[0]), $/;"';
}
+ $this->timezones = _get_tz_zones();
$this->samba_settings['smbhash'] = $pwdhash;
}
$this->samba_settings['smbhash'] = $pwdhash;
}
$this->samba_settings['samba_sid_active'] = TRUE;
$this->samba_settings['samba_rid_active'] = TRUE;
}
$this->samba_settings['samba_sid_active'] = TRUE;
$this->samba_settings['samba_rid_active'] = TRUE;
}
-
+
+ /* Check if we can enable netatalk plugin */
+ $tmp = $ldap->get_objectclasses();
+ if(is_array($tmp) && isset($tmp['apple-user'])) {
+ $this->use_netatalk = TRUE;
+ }
+
+ /* 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;
}
$this->called = TRUE;
}
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$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")));
}
return($smarty -> fetch (get_template_path("../setup/setup_config2.tpl")));
}
{
if(isset($_POST['step6_posted'])){
{
if(isset($_POST['step6_posted'])){
+ if(isset($_POST['timezone']) && isset($this->timezones['TIMEZONES'][$_POST['timezone']])){
+ $this->timezone = $_POST['timezone'];
+ }
+
/* Get attributes */
foreach($this->attributes as $attr){
if(isset($_POST[$attr])){
/* Get attributes */
foreach($this->attributes as $attr){
if(isset($_POST[$attr])){
- $this->$attr = validate($_POST[$attr]);
+ $this->$attr = validate(get_post($attr));
}
}
}
}
if(isset($_POST['vacationdir_active'])){
$this->mail_settings['vacationdir_active'] = TRUE;
if(isset($_POST['vacationdir'])){
if(isset($_POST['vacationdir_active'])){
$this->mail_settings['vacationdir_active'] = TRUE;
if(isset($_POST['vacationdir'])){
- $this->mail_settings['vacationdir'] = $_POST['vacationdir'];
+ $this->mail_settings['vacationdir'] = get_post('vacationdir');
}
}else{
$this->mail_settings['vacationdir_active'] = FALSE;
}
if(isset($_POST['enableCopyPaste'])){
}
}else{
$this->mail_settings['vacationdir_active'] = FALSE;
}
if(isset($_POST['enableCopyPaste'])){
- $this->generic_settings['enableCopyPaste'] = $_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;
if(isset($_POST['wws_ou'])){
}
if(isset($_POST['wws_ou_active'])){
$this->generic_settings['wws_ou_active'] = TRUE;
if(isset($_POST['wws_ou'])){
- $this->generic_settings['wws_ou'] = $_POST['wws_ou'];
+ $this->generic_settings['wws_ou'] = get_post('wws_ou');
}
}else{
$this->generic_settings['wws_ou_active'] = FALSE;
}
}else{
$this->generic_settings['wws_ou_active'] = FALSE;
if(isset($_POST['snapshot_active'])){
$this->generic_settings['snapshot_active'] = TRUE;
if(isset($_POST['snapshot_base'])){
if(isset($_POST['snapshot_active'])){
$this->generic_settings['snapshot_active'] = TRUE;
if(isset($_POST['snapshot_base'])){
- $this->generic_settings['snapshot_base'] = $_POST['snapshot_base'];
+ $this->generic_settings['snapshot_base'] = get_post('snapshot_base');
}
if(isset($_POST['snapshot_user'])){
}
if(isset($_POST['snapshot_user'])){
- $this->generic_settings['snapshot_user'] = $_POST['snapshot_user'];
+ $this->generic_settings['snapshot_user'] = get_post('snapshot_user');
}
if(isset($_POST['snapshot_password'])){
}
if(isset($_POST['snapshot_password'])){
- $this->generic_settings['snapshot_password'] = $_POST['snapshot_password'];
+ $this->generic_settings['snapshot_password'] = get_post('snapshot_password');
}
if(isset($_POST['snapshot_server'])){
}
if(isset($_POST['snapshot_server'])){
- $this->generic_settings['snapshot_server'] = $_POST['snapshot_server'];
+ $this->generic_settings['snapshot_server'] = get_post('snapshot_server');
}
}else{
$this->generic_settings['snapshot_active'] = FALSE;
}
}else{
$this->generic_settings['snapshot_active'] = FALSE;
if(isset($_POST['samba_sid_active'])){
$this->samba_settings['samba_sid_active'] = TRUE;
if(isset($_POST['samba_sid'])){
if(isset($_POST['samba_sid_active'])){
$this->samba_settings['samba_sid_active'] = TRUE;
if(isset($_POST['samba_sid'])){
- $this->samba_settings['samba_sid'] = $_POST['samba_sid'];
+ $this->samba_settings['samba_sid'] = get_post('samba_sid');
}
}else{
$this->samba_settings['samba_sid_active'] = FALSE;
}
}else{
$this->samba_settings['samba_sid_active'] = FALSE;
if(isset($_POST['samba_rid_active'])){
$this->samba_settings['samba_rid_active'] = TRUE;
if(isset($_POST['samba_rid'])){
if(isset($_POST['samba_rid_active'])){
$this->samba_settings['samba_rid_active'] = TRUE;
if(isset($_POST['samba_rid'])){
- $this->samba_settings['samba_rid'] = $_POST['samba_rid'];
+ $this->samba_settings['samba_rid'] = get_post('samba_rid');
}
}else{
$this->samba_settings['samba_rid_active'] = FALSE;
}
if(isset($_POST['smbhash'])){
}
}else{
$this->samba_settings['samba_rid_active'] = FALSE;
}
if(isset($_POST['smbhash'])){
- $this->samba_settings['smbhash'] = $_POST['smbhash'];
+ $this->samba_settings['smbhash'] = get_post('smbhash');
}
if(!$this->sambaDomain_found){
}
if(!$this->sambaDomain_found){