summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86fb4a3)
raw | patch | inline | side by side (parent: 86fb4a3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 30 Jan 2007 05:20:12 +0000 (05:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 30 Jan 2007 05:20:12 +0000 (05:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5655 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_termDNS.inc | patch | blob | history |
index f0712a6b23c67949d03f1d0204b7cbfe3ed42a35..cb678cbccdff2900cf757a87e80b5298bd66a738 100644 (file)
class termDNS extends plugin
{
- /* CLI vars */
- var $cli_summary = "Manage server basic objects";
- var $cli_description = "Some longer text\nfor help";
- var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* attribute list for save action */
var $ignore_account = true;
var $autonet = false;
}
+ function netmaskIsCoherent($idZone)
+ {
+ $netmask = FlipIp(str_replace(".in-addr.arpa","",getNameFromMix($idZone)));
+ if(!strstr($this->ipHostNumber, $netmask)){
+ return false;
+ }else{
+ return true;
+ }
+ }
+
+
function getVarsForSaving($attrs)
{
foreach($this->attributes as $attr){
$smarty->assign("Zones",$this->Zones);
$smarty->assign("ZoneKeys",($this->Zones));
$smarty->assign("IPisMust",(($this->IPisMust)||($this->DNS_is_account)));
-
+
+ /* Create zone array */
+ $idZones = array();
+ foreach($this->Zones as $id => $zone){
+ if($this->netmaskIsCoherent($id)) {
+ $idZones[$id] = $zone;
+ }else{
+ $idZones[$id] = $zone." ("._("Not matching").")";
+ }
+ }
+ $smarty->assign("Zones",$idZones);
+ $smarty->assign("ZoneKeys", $this->Zones);
+
$tmp = $this->generateRecordsList();
$changeStateForRecords = $tmp['changeStateForRecords'];
$onlyOnce = array();
// $onlyOnce['cNAMERecord'] = 0;
+ $tmp = array_flip($this->Zones);
+ $tmp2 = $tmp[$this->dnsEntry['zoneName']];
+ if(!$this->netmaskIsCoherent($tmp2)){ //this->dnsEntry['zoneName'])){
+ $tmp2 = preg_replace("/^.*\//","",$tmp2);
+ $message[] =sprintf(_("The specified IP address '%s' is not matching the selected reverse zone entry '%s'."),$this->ipHostNumber,$tmp2);
+ }
/* Walk through all entries and detect duplicates or mismatches
*/