diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc
index f7d983982a8cd58029d95145183506b0428c6b72..50812871960c60f872fcc874222198b83a7f53d2 100644 (file)
class servDNSeditZoneEntries extends plugin
{
class servDNSeditZoneEntries 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;
/* attribute list for save action */
var $ignore_account = TRUE;
- var $attributes = array();
+ var $attributes = array("cn");
var $objectclasses = array("whatever");
var $Devices = array();
var $objectclasses = array("whatever");
var $Devices = array();
var $RecordTypes = array(); // Possible record type.
var $disableDialog = false; // Dialog will be disabled, if this zone is new
var $RecordTypes = array(); // Possible record type.
var $disableDialog = false; // Dialog will be disabled, if this zone is new
+ var $cn;
function servDNSeditZoneEntries ($config,$dn, $zoneObject)
{
function servDNSeditZoneEntries ($config,$dn, $zoneObject)
{
/* Initialise class
*/
$this->RecordTypes = getDnsRecordTypes();
/* Initialise class
*/
$this->RecordTypes = getDnsRecordTypes();
- $this->dn = "zoneName=".$zoneObject['InitialzoneName'].",".$dn;
+ $this->dn = "zoneName=".getNameFromMix($zoneObject['InitialzoneName']).",".$dn;
$this->zoneName = $zoneObject['InitialzoneName'];
$this->reverseName = $zoneObject['InitialReverseZone'];
$this->zoneName = $zoneObject['InitialzoneName'];
$this->reverseName = $zoneObject['InitialReverseZone'];
$this->Devices[$attrs['relativeDomainName'][0]]['OrigCn'] = $attrs['relativeDomainName'][0];
}
$this->Devices[$attrs['relativeDomainName'][0]]['OrigCn'] = $attrs['relativeDomainName'][0];
}
- if(!count($this->Devices)){
- $this->disableDialog = true;
+ $ldap->cat($this->dn,array("objectClass"));
+
+ $this->disableDialog = true;
+ if(count($this->Devices)|| $ldap->count()){
+ $this->disableDialog = false;
}
}
}
}
$entry['exists'] = true;
$entry['zoneName'] = $this->zoneName;
$entry['RECORDS'][] = array("type" => "aRecord" , "value"=>"");
$entry['exists'] = true;
$entry['zoneName'] = $this->zoneName;
$entry['RECORDS'][] = array("type" => "aRecord" , "value"=>"");
- $this->Devices[_("New Entry")] = $entry;
+ $this->Devices[_("New entry")] = $entry;
}
if(count($tmp2) != 2) continue;
}
if(count($tmp2) != 2) continue;
$ldap->cd($this->config->current['BASE']);
$names = array();
$ldap->cd($this->config->current['BASE']);
$names = array();
+
foreach($this->Devices as $DevName => $device){
foreach($this->Devices as $DevName => $device){
+ /* skip checking empty attributes */
+ if(count($this->Devices[$DevName]['RECORDS']) == 0){
+ return;
+ }
+
/* Checking entry name
*/
if((!is_uid($DevName)) | (empty($DevName))){
/* Checking entry name
*/
if((!is_uid($DevName)) | (empty($DevName))){
/* Renaming check for existing devices
*/
if(isset($device['OrigCn']) && ($DevName != $device['OrigCn'] )){
/* Renaming check for existing devices
*/
if(isset($device['OrigCn']) && ($DevName != $device['OrigCn'] )){
- $ldap->cd($this->config->current['BASE']);
+ $ldap->cd($this->dn);
$ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName"));
if($ldap->count()){
$message[] = sprintf(_("Can not rename '%s' to '%s',the destination name already exists."),$device['OrigCn'],$DevName);
}
}elseif(!isset($device['OrigCn'])){
$ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName"));
if($ldap->count()){
$message[] = sprintf(_("Can not rename '%s' to '%s',the destination name already exists."),$device['OrigCn'],$DevName);
}
}elseif(!isset($device['OrigCn'])){
- $ldap->cd($this->config->current['BASE']);
+ $ldap->cd($this->dn);
$ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName"));
if($ldap->count()){
$message[] = sprintf(_("Can not create '%s',the destination name already exists."),$DevName);
$ldap->search("(relativeDomainName=".$DevName.")",array("relativeDomainName"));
if($ldap->count()){
$message[] = sprintf(_("Can not create '%s',the destination name already exists."),$DevName);
/* Names should be written in lowercase
*/
/* Names should be written in lowercase
*/
+
+
if(strtolower($DevName) != $DevName){
$message[] = sprintf(_("The host name '%s' should be written in lowercase."), $DevName);
}
if(strtolower($DevName) != $DevName){
$message[] = sprintf(_("The host name '%s' should be written in lowercase."), $DevName);
}
$todo = array();
$todo = array();
+
/* Create todolist
*/
foreach($this->Devices as $name => $dev){
/* Create todolist
*/
foreach($this->Devices as $name => $dev){
<input type='text' value='".$record['value']."' name='ValueSelection_".$name."' style='width:250px;'>
</td>
<td style='width:50px;text-align:right;'>
<input type='text' value='".$record['value']."' name='ValueSelection_".$name."' style='width:250px;'>
</td>
<td style='width:50px;text-align:right;'>
- <input type='image' name='AddRecord_".$name."' src='images/crossref.png' alt='"._("Add")."' title='"._("Add")."'>
+ <input type='image' name='AddRecord_".$name."' src='images/list_new.png' alt='"._("Add")."' title='"._("Add")."'>
<input type='image' name='RemoveRecord_".$name."' src='images/edittrash.png' alt='"._("Remove")."' title='"._("Remove")."'>
</td>
</tr>";
<input type='image' name='RemoveRecord_".$name."' src='images/edittrash.png' alt='"._("Remove")."' title='"._("Remove")."'>
</td>
</tr>";