summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f64f68d)
raw | patch | inline | side by side (parent: f64f68d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Feb 2008 11:17:12 +0000 (11:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 13 Feb 2008 11:17:12 +0000 (11:17 +0000) |
- DNS zones can't be modified anymore, if the are used.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8892 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8892 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc | patch | blob | history | |
gosa-plugins/dns/admin/systems/services/dns/servdnseditzone.tpl | patch | blob | history |
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
index 9242662a8edd3d9424f65274a001c8d89a519600..bb7053e70eb6438b6f12a14d1e0c0256bd9bb751 100644 (file)
var $isNew = true;
var $ZoneObject = array();
+ var $Zone_is_used = FALSE;
function servdnseditZone (&$config, $dn= NULL,$attrs = array())
{
}else{
$this->sOAserial = date("Ymd")."01";
}
+
+ /* Check if this used, in this case disable forward and reverse configuration */
+ $tmp = $this->getUsedZoneNames();
+ $this->Zone_is_used = FALSE;
+ if(isset($tmp[DNS::FlipIp($this->InitialReverseZone).".in-addr.arpa"])){
+ $this->Zone_is_used = TRUE;
+ }
}
/* Detect Network class */
/* Call parent execute */
plugin::execute();
-
-
/* Fill templating stuff */
$smarty= get_smarty();
+ $smarty->assign("Zone_is_used",$this->Zone_is_used);
$ui = get_userinfo();
$smarty->assign("ACLs",$this->parent->getacl(""));
{
//plugin::save_object();
foreach($this->attributes as $attr){
+
+ if($this->Zone_is_used && in_array($attr,array("ReverseZone","zoneName"))){
+ continue;
+ }
+
if(isset($_POST[$attr])){
$this->$attr = $_POST[$attr];
}
}
}
- if(isset($_POST['NetworkClass'])){
+ if(isset($_POST['NetworkClass']) && !$this->Zone_is_used){
$this->NetworkClass = $_POST['NetworkClass'];
}
return ($message);
}
- /* This funtion returns all used Zonenames */
+
+ /* This funtion returns all used Zonenames
+ */
function getUsedZoneNames()
{
$ret = array();
$ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
- $ldap->search("(&(objectClass=dNSZone)(relativeDomainName=@)(zoneName=*))",array("zoneName","tXTRecord"));
+ $ldap->search("(&(objectClass=dNSZone)(!(relativeDomainName=@))(zoneName=*))",array("zoneName","relativeDomainName"));
while($attr = $ldap->fetch()){
- if(preg_match("/in-addr\.arpa/",$attr['zoneName'][0])){
- if(isset($attr['tXTRecord'][0])){
- $zn = preg_replace("/zoneName\=/","",$attr['tXTRecord'][0]);
- $ret[$zn] =DNS::FlipIp(preg_replace("/\.in-addr\.arpa/","",$attr['zoneName'][0]));
- }
- }else{
- $ret[$attr['zoneName'][0]]="";
- }
+ $ret[$attr['zoneName'][0]][] = $attr['dn'];
}
return($ret);
}
+
/* Save to LDAP */
function save()
{
$str.="</select>";
return($str);
}
-}
+
+}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/gosa-plugins/dns/admin/systems/services/dns/servdnseditzone.tpl b/gosa-plugins/dns/admin/systems/services/dns/servdnseditzone.tpl
index 1136dba537a09e3435f173680e32ce65cf9054ac..60b39101fbaeba766e5230aa248d871bf5f96783 100644 (file)
<td style="width:50%;vertical-align:top;border-right:1px solid #b0b0b0;">
<table summary="">
<tr>
- <td>{t}Zone name{/t}{$must}
+ <td style='vertical-align:top'>{t}Zone name{/t}{$must}
</td>
<td>
{render acl=$ACLs}
- <input type="text" name="zoneName" value="{$zoneName}" {if $NotNew} disabled {/if}>
+ <input type="text" name="zoneName" value="{$zoneName}" {if $NotNew | $Zone_is_used} disabled {/if}>
{/render}
</td>
</tr>
<tr>
- <td>{t}Network address{/t}{$must}
+ <td style='vertical-align:top'>{t}Network address{/t}{$must}
</td>
<td>
{render acl=$ACLs}
- <input type="text" name="ReverseZone" value="{$ReverseZone}" {if $NotNew} disabled {/if}>
+ <input type="text" name="ReverseZone" value="{$ReverseZone}" {if $NotNew | $Zone_is_used} disabled {/if}>
{/render}
</td>
</tr>
</td>
<td>
{render acl=$ACLs}
- <select name="NetworkClass" {if $NotNew} disabled {/if}>
+ <select name="dummy3" {if $NotNew | $Zone_is_used} disabled {/if}>
{html_options options=$NetworkClasses selected=$NetworkClass }
</select>
{/render}
</td>
</tr>
+ {if $Zone_is_used}
+ <tr>
+ <td colspan="2">
+ <i>{t}Zone is in use, network settings can't be modified.{/t}</i>
+ </td>
+ </tr>
+ {/if}
</table>
</td>
<td style="vertical-align:top;">