diff --git a/plugins/admin/systems/class_servDNSeditZone.inc b/plugins/admin/systems/class_servDNSeditZone.inc
index 5ddf04346082fd579dc8f67cf4af281b127a4e79..7fcef3aa0e0f1e601189aed6e9f507385ac5fdaa 100644 (file)
var $isNew = true;
+ var $ZoneObject = array();
+
function servdnseditZone ($config, $dn= NULL,$attrs = array())
{
plugin::plugin ($config, $dn);
$this->InitialzoneName = "";//$attrs['InitialzoneName'];
$this->InitialReverseZone = "";//$attrs['InitialReverseZone'];
}else{
+ $this->ZoneObject = $attrs;
+
$this->OldZoneName = $attrs['zoneName'];
$this->OldReverseZone = $attrs['ReverseZone'];
$smarty= get_smarty();
$display= "";
-
/* Open Zone Entry Edit Dialog
*/
- if(isset($_POST['EditZoneEntries'])){
- $this->dialog= new servDNSeditZoneEntries($this->config,$this->dn,$this->InitialzoneName,FlipIp($this->InitialReverseZone));
+ if(!count($this->ZoneObject)){
+ $smarty->assign("AllowZoneEdit" , false);
+ }else{
+ $smarty->assign("AllowZoneEdit" , true);
+ if(isset($_POST['EditZoneEntries'])){
+ $this->dialog= new servDNSeditZoneEntries($this->config,$this->dn,$this->ZoneObject);
+ }
}
/* Save Zone Entry Edit Dialog
/* Check supplied data */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
/* Check if zoneName is already in use */
$usedZones = $this->getUsedZoneNames();
if(($this->isNew == true)||($this->zoneName != $this->InitialzoneName)||($this->ReverseZone != $this->InitialReverseZone)){
}
}
+ if(empty($this->zoneName)){
+ $message[] =sprintf(_("Please choose a valid zone name."));
+ }
+
+ if(empty($this->ReverseZone)){
+ $message[] =sprintf(_("Please choose a valid reverse zone name."));
+ }
+
if(!preg_match("/\.$/",$this->sOAprimary)){
$message[] = _("Primary dns server must end with '.' to be a valid entry.");
}