summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 69ecf53)
raw | patch | inline | side by side (parent: 69ecf53)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 13:58:53 +0000 (13:58 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 13:58:53 +0000 (13:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6236 594d385d-05f5-0310-b6e9-bd551577e9d8
setup/class_setupStep_Config2.inc | patch | blob | history | |
setup/setup_config2.tpl | patch | blob | history |
index 8eab8885f68696eb644f538ff0bad3ff01c94abf..408b2f828f05ed66f79fd6e472a513d7363e42c9 100644 (file)
"smbhash" => 'SMBHASH',
"samba_rid_active" => FALSE);
+ var $sambaDomain_found = FALSE;
+
var $attributes = array("governmentmode","sambaidmapping","cyrusunixstyle","mail");
+ var $called = FALSE;
+
function Step_Config2()
{
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){
}
$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);
$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();
index 679fee9a273c2eb6d471c7ed93cd20a0f8cd2a1d..5b35c4ecb0c9fca889a0bfe497a9bdcd63bb3ecb 100644 (file)
--- a/setup/setup_config2.tpl
+++ b/setup/setup_config2.tpl
onClick='changeState("samba_sid");'>
<input size=20 id='samba_sid' name='samba_sid' type='text' value='{$samba_settings.samba_sid}' disabled>
{else}
- <input type='checkbox' value='1' name='samba_sid_active' checked>
+ <input type='checkbox' value='1' name='samba_sid_active' checked {if !$sambaDomain_found} disabled {/if}>
<input size=20 id='samba_sid' name='samba_sid' type='text' value='{$samba_settings.samba_sid}' >
{/if}
</div>
onClick='changeState("samba_rid");'>
<input size=20 id='samba_rid' name='samba_rid' type='text' value='{$samba_settings.samba_rid}' disabled>
{else}
- <input type='checkbox' value='1' name='samba_rid_active' checked>
+ <input type='checkbox' value='1' name='samba_rid_active' checked {if !$sambaDomain_found} disabled {/if}>
<input size=20 id='samba_rid' name='samba_rid' type='text' value='{$samba_settings.samba_rid}' >
{/if}
</div>