summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88c3dc2)
raw | patch | inline | side by side (parent: 88c3dc2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Feb 2006 09:42:38 +0000 (09:42 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Feb 2006 09:42:38 +0000 (09:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2633 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_servDNS.inc | patch | blob | history | |
plugins/admin/systems/class_servDNSeditZone.inc | patch | blob | history |
index 121b4318a4d3f2e93fda3f41e766e18c488cea20..6039a29bb9557f9090b251e64208bb1cd5ee833e 100644 (file)
$this->DNSinitially_was_account = $this->is_account;
}
+
+ /* this is used to flip the ip address for example
+ 12.3.45 -> 54.3.12
+ Because some entries (like zones) are store like that 54.3.12.in-addr.arpa
+ but we want to display 12.3.45.
+ */
function FlipIp($ip)
{
$tmp = array_reverse(split("\.",$ip));
/* check posts for delete zone */
if(preg_match("/^delZone_/",$name)&&!$once){
+
+
$once =true;
$tmp = preg_replace("/^delZone_/","",$name);
$tmp = base64_decode(preg_replace("/_.*$/","",$tmp));
- unset($this->Zones[$tmp]);
+
+ $zones = $this->getUsedZoneNames();
+ $rev = $this->Zones[$tmp]['ReverseZone'];
+ $res = array_merge(($zones[$tmp]),($zones[$rev.".in-addr.arpa"]));
+
+ if(count($res)){
+ $i = 2;
+ $str ="";
+ foreach($res as $dn){
+ if($i > 0 ){
+ $i --;
+ $str.=$dn." ";
+ }
+ }
+ if(count($res)> 2) $str .=" ... ";
+ print_red(sprintf(_("Can't delete the selected zone, because it is still in use by these entry/entries '%s'"),trim($str)));
+ }else{
+ unset($this->Zones[$tmp]);
+ }
}
}
return($display);
}
+
+ /* 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","relativeDomainName","tXTRecord"));
+ while($attr = $ldap->fetch()){
+ if(preg_match("/in-addr\.arpa/",$attr['zoneName'][0])){
+ $ret[$attr['zoneName'][0]][] = $attr['dn'];
+ }else{
+ $ret[$attr['zoneName'][0]][] = $attr['dn'];
+ }
+ }
+ return($ret);
+ }
+
+
/* Remove dns service */
function remove_from_parent()
{
diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc
index 49e904d71014f17f1c0fba5573b910628346db4f..eda11ea1986ed819198d95cae97abbbf107a9678 100644 (file)
return ($message);
}
+ /* This funtion returns all used Zonenames */
function getUsedZoneNames()
{
$ret = array();
return($ret);
}
-
+ /* this is used to flip the ip address for example
+ 12.3.45 -> 54.3.12
+ Because some entries (like zones) are store like that 54.3.12.in-addr.arpa
+ but we want to display 12.3.45.
+ */
function FlipIp($ip)
{
$tmp = array_reverse(split("\.",$ip));
return($ret);
}
+
+ /* This function generate a table row for each used record.
+ This table row displays the recordtype in a select box
+ and the specified value for the record, and a remove button.
+ The last element of the table also got an 'add' button.
+ */
function generateRecordsList($changeStateForRecords="")
{
$changeStateForRecords = "";
return($str);
}
+ /* This function generates a select box out of $this->RecordTypes options.
+ The Parameter $selected is used to predefine an attribute.
+ $name is used to specify a post name
+ */
function generateRecordListBox($selected,$name)
{
$str = "<select name='".$name."' id='".$name."'>";