summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 88132e0)
raw | patch | inline | side by side (parent: 88132e0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Feb 2006 08:04:41 +0000 (08:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Feb 2006 08:04:41 +0000 (08:04 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2630 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_termDNS.inc | patch | blob | history |
index 44917cf9889f57a0b78311fda187cc9c2b6bdd79..1d1ea145ca915b6fa29240adf23ebb0b1c9b7593 100644 (file)
var $macAddress =""; // Mac address
var $cn =""; // CN of currently edited device
- var $Zones = array(); // All Available Zones like array("3.2.1.in-addr.arpa"=>"MyServer.de")
+ var $Zones = array(); // All Available Zones like array("3.2.1"=>"MyServer.de")
var $RecordTypes= array(); // Possible record types
var $dNSClass = "IN"; // dNSClass name
/* If there is a record attribute */
if(isset($attrs[$name])){
-
+
+
/* get all entries */
for($i = 0 ; $i < $attrs[$value]['count']; $i ++){
+ if(($value == "aRecord")&&($this->ipHostNumber==$attrs[$value][$i])){
+ continue;
+ }
$types[] =array("type"=>$name,"inittype"=>$name,"value"=>$attrs[$value][$i],"status"=>"edited","dn"=>$attrs['dn']);
}
}
function check()
{
$message= array();
+
+ /* Check if mac is empty */
+ if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
+ $message[]= _("The required field 'MAC-address' is not set.");
+ }
+
+ /* Check if ip is empty */
+ if ($this->ipHostNumber == "" && chkacl ($this->acl, "ipHostNumber") == ""){
+ $message[]= _("The required field 'IP-address' is not set.");
+ }
+
+ /* check if given ip is valid ip*/
+ $num="(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";
+ if (!preg_match("/^$num\\.$num\\.$num\\.$num$/", $this->ipHostNumber)){
+ $message[]= _("Wrong IP format in field IP-address.");
+ }
+
+ /* Check if given mac is valid mac */
+ $tr = count(split(":",$this->macAddress));
+ if($tr!=6){
+ $message[]=(_("The given macaddress is invalid. There must be 6 1byte segments seperated by ':'."));
+ }
+
+ if($this->DNS_is_account){
+ foreach($this->types as $name => $values){
+ if(($values['type'] == "aRecord")&&($values['value'] == $this->ipHostNumber)&&($values['status']!="deleted")){
+ $message[]=sprintf(_("The device IP '%s' is added as 'A Record', this will be done automatically, please remove the record."),$this->ipHostNumber);
+ }
+ }
+ }
+
return ($message);
}
}
}
if(count($aRecords)){
+
+ /* Add ipHostNumber as default aRecord */
+ $aRecords[] = $this->ipHostNumber;
+
$dn = "relativeDomainName=".$this->cn.",".$this->dn;
foreach($aRecords as $rec){
$entries[$dn]['aRecord'][] = $rec;