~ubuntu-branches/ubuntu/precise/gosa/precise

« back to all changes in this revision

Viewing changes to plugins/admin/systems/class_termDNS.inc

  • Committer: Bazaar Package Importer
  • Author(s): Benoit Mortier
  • Date: 2009-05-29 18:23:00 UTC
  • mfrom: (1.2.8 upstream) (7.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090529182300-9z5k9r1e9djshrus
Tags: 2.5.19-1
* New upstream release
* Added basque debconf template (Closes: #502289)
* Added italian debconf template (Closes: #502465)
* Added japanese debconf template (Closes: #512979)
* Added finish debconf template (Closes: #501937)
* Added russian debconf template (Closes: #502888)
* Missing attributes in group ACL menu (Closes: #528179)
* Added test in apache for php5 apache module presence (Closes: #523461)
* Corrected bashism in mailqueue script (Closes: #530093)
* Cleaned debian packaging
* Updated German Translation.
* Applied patch to allow selecting the primary Group when copying users
* Added a section how to report a bug
* Added Benoit Mortier as uploader

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
  var $dnsEntry                 = array();
41
41
  var $DNSenabled               = false;
42
42
  var $hide_dns_check_box       = FALSE;
43
 
 
 
43
  var $namingAttr               = "cn";
 
44
  
44
45
  /*  Terminal dns 
45
46
   */
46
 
  function termDNS ($config, $dn,$objectClasses,$IPisMust = false)
 
47
  function termDNS ($config, $dn,$objectClasses,$IPisMust = false, $namingAttr = "cn")
47
48
  {
48
49
    /* We need to know which objectClasses are used, to store the ip/mac
49
50
     * Because of different type of devices   
50
51
     */
51
52
    $this->objectclasses  =  $objectClasses;
52
53
    $this->IPisMust       = $IPisMust;
 
54
    $this->namingAttr     = $namingAttr;
53
55
 
54
56
    plugin::plugin ($config, $dn);
55
57
 
56
 
    if(isset($this->attrs['cn'][0])){
57
 
      $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
58
 
      $this->cn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]);
 
58
    if(isset($this->attrs[$this->namingAttr][0])){
 
59
      $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs[$this->namingAttr][0]);
 
60
      $this->cn = preg_replace("/\\\$\$/","",$this->attrs[$this->namingAttr][0]);
59
61
    }
60
62
 
61
63
 
101
103
     */
102
104
    $DNSenabled = false;
103
105
    foreach($this->config->data['TABS']['SERVTABS'] as $tab){
104
 
      if(preg_match("/^servdns$/",$tab['CLASS'])){
 
106
      if(preg_match("/^servdns$/i",$tab['CLASS'])){
105
107
        $this->DNSenabled = true;
106
108
      }
107
109
    }
448
450
      $message[]= _("Wrong IP format in field IP-address.");
449
451
    }
450
452
 
451
 
    /* Check if mac is empty 
452
 
     */
453
 
    if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
454
 
      $message[]= _("The required field 'MAC-address' is not set.");
 
453
    if($this->MACisMust || $this->dhcp_is_Account){
 
454
      /* Check if mac is empty 
 
455
       */
 
456
      if ($this->macAddress == "" && chkacl ($this->acl, "macAddress") == ""){
 
457
        $message[]= _("The required field 'MAC-address' is not set.");
 
458
      }
455
459
    }
456
460
 
457
461
    /* Check if given mac is valid mac 
458
462
     */
459
 
    if(!is_mac($this->macAddress)){
 
463
    if(!empty($this->macAddress) && !is_mac($this->macAddress)){
460
464
      $message[]=(_("The given macaddress is invalid. There must be 6 2byte segments seperated by ':'."));
461
465
    }
462
466