Code

Fixed base assignment, undefined index error in user->cahngePicture fixed
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Dec 2005 13:52:16 +0000 (13:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Dec 2005 13:52:16 +0000 (13:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2190 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/generic/class_user.inc

index 30e789ffe55f8d8b84dc1677e0e89356f53c749e..8de21f7e6bdea9449806a6e73c45d4e2ce689432 100644 (file)
@@ -565,11 +565,13 @@ class user extends plugin
       /* Save base and pw_storage, since these are no LDAP attributes */
       if (isset($_POST['base'])){
         foreach(array("base", "pw_storage") as $val){
-          $data= validate($_POST[$val]);
-          if ($data != $this->$val){
-            $this->is_modified= TRUE;
+          if(isset($_POST[$val])){
+            $data= validate($_POST[$val]);
+            if ($data != $this->$val){
+              $this->is_modified= TRUE;
+            }
+            $this->$val= $data;
           }
-          $this->$val= $data;
         }
       }
     }
@@ -1170,7 +1172,16 @@ class user extends plugin
           }
         }
       }
+      if(count($allowed) == 0){
+        foreach($this->config->idepartments as $key => $dep) {
+          if($this->base==$key){
+            $allowed[$key] = $dep;
+          }
+        }
+      }  
+  
       return($allowed);
+      
     }else{
       return($this->config->idepartments);
     }