Code

Updated gophoneHardware
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Oct 2008 12:55:15 +0000 (12:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Oct 2008 12:55:15 +0000 (12:55 +0000)
-Updated check(); macAddress is must

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12756 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc

index 41072b9383ba53eba5bff9b8510b135e121811a9..f40e3cb71ab0cce6ed3cf3f0df79a3d97dc1026d 100644 (file)
@@ -55,6 +55,7 @@ class phoneGeneric extends plugin
   {
     plugin::plugin ($config, $dn, $parent);
     $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
+    $this->netConfigDNS->MACisMust =TRUE;
 
     /* Set base */
     if ($this->dn == "new"){
@@ -423,6 +424,9 @@ class phoneGeneric extends plugin
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
+      if (!$ldap->success()){
+        msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+      }
       new log("create","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
       $this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
     } else {
@@ -434,6 +438,9 @@ class phoneGeneric extends plugin
       $this->cleanup();
       $ldap->modify ($this->attrs); 
       new log("modify","phone/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      if (!$ldap->success()){
+        msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+      }
 
       // $user_phone_reload   
       $ldap->cd ($this->config->current['BASE']);