diff --git a/plugins/admin/systems/class_servDNSeditZoneEntries.inc b/plugins/admin/systems/class_servDNSeditZoneEntries.inc
index 3a13bde7dbfac17fc1f0b18238cb336979970ad1..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'];
$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){