Code

Fixed problem with missing parene object, when editing a phone account from the my...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jun 2008 06:52:10 +0000 (06:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 24 Jun 2008 06:52:10 +0000 (06:52 +0000)
- Added parent object, this should be logical.

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

gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc

index d7845277bb58c669d9c103d04839c31b7d2f92ab..c5796a68863f050f8454af4d950f4f055550cf61 100644 (file)
@@ -67,7 +67,19 @@ class phoneAccount extends plugin
     }
 
     /* Set parent object to tab object */
-    $this->parent = $parent->parent;
+    if(is_object($parent)){
+      $this->parent = $parent->parent;
+    }else{
+
+      /* Workaround ... 
+          FIXME, * If there is time, split this code into class_voip.inc and class_phoneaccount.inc
+                   This code is to much to be comprehensible and understandable.
+                 * We don't need a parent object here, we just need a reference to the users uid and cn.
+                
+       */
+      $this->parent = new usertabs($this->config,
+          $this->config->data['TABS']['USERTABS'],$this->dn);
+    }
 
     /* Set uid */
     if((isset($this->parent->by_object['user']->uid))&&(!empty($this->parent->by_object['user']->uid))){
@@ -76,6 +88,7 @@ class phoneAccount extends plugin
     if((isset($this->parent->by_object['user']->cn))&&(!empty($this->parent->by_object['user']->cn))){
       $this->cn  = $this->parent->by_object['user']->cn;
     }
+    
 
     /* Check server configurations 
      * Load all server configuration in $this->goFonHomeServers if available