From 3cd0a71e84aa17fa30933f4150acf9ff1b88e9bb Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 2 May 2007 13:58:53 +0000 Subject: [PATCH] Added rid/sid check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6236 594d385d-05f5-0310-b6e9-bd551577e9d8 --- setup/class_setupStep_Config2.inc | 34 +++++++++++++++++++++++++++++++ setup/setup_config2.tpl | 4 ++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/setup/class_setupStep_Config2.inc b/setup/class_setupStep_Config2.inc index 8eab8885f..408b2f828 100644 --- a/setup/class_setupStep_Config2.inc +++ b/setup/class_setupStep_Config2.inc @@ -47,7 +47,11 @@ class Step_Config2 extends setup_step "smbhash" => 'SMBHASH', "samba_rid_active" => FALSE); + var $sambaDomain_found = FALSE; + var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail"); + var $called = FALSE; + function Step_Config2() { @@ -80,6 +84,31 @@ class Step_Config2 extends setup_step function execute() { + /* On first call check for rid/sid base */ + $cv = $this->parent->captured_values; + $ldap = new LDAP($cv['admin'], + $cv['password'], + $cv['connection'], + FALSE, + $cv['tls']); + + $ldap->cd($cv['base']); + $ldap->search("(objectClass=sambaDomain)",array("dn")); + if($ldap->count()){ + $this->sambaDomain_found =TRUE; + }else{ + $this->sambaDomain_found =FALSE; + } + + if(!$this->called){ + if(!$this->sambaDomain_found){ + $this->samba_settings['samba_sid_active'] = TRUE; + $this->samba_settings['samba_rid_active'] = TRUE; + } + + $this->called = 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){ @@ -92,6 +121,7 @@ class Step_Config2 extends setup_step } $smarty = get_smarty(); + $smarty->assign("sambaDomain_found",$this->sambaDomain_found); $smarty->assign("generic_settings",$this->generic_settings); $smarty->assign("mail_settings",$this->mail_settings); $smarty->assign("mail_methods",$this->mail_methods); @@ -176,6 +206,10 @@ class Step_Config2 extends setup_step $this->samba_settings['smbhash'] = $_POST['smbhash']; } + if(!$this->sambaDomain_found){ + $this->samba_settings['samba_sid_active'] = TRUE; + $this->samba_settings['samba_rid_active'] = TRUE; + } } $tmp = $this->check(); diff --git a/setup/setup_config2.tpl b/setup/setup_config2.tpl index 679fee9a2..5b35c4ecb 100644 --- a/setup/setup_config2.tpl +++ b/setup/setup_config2.tpl @@ -20,7 +20,7 @@ onClick='changeState("samba_sid");'> {else} - + {/if} @@ -36,7 +36,7 @@ onClick='changeState("samba_rid");'> {else} - + {/if} -- 2.30.2