Code

A
[gosa.git] / plugins / personal / generic / class_user.inc
index bcbd2d14c63dc078d8668492909404a18d311ec7..7e3d3f45c8d0f05f711246cd27130282fe1cf772 100644 (file)
@@ -76,6 +76,8 @@ class user extends plugin
   var $role= "";
   var $publicVisible= "";
 
+  var $dialog;
+
   /* variables to trigger password changes */
   var $pw_storage= "crypt";
   var $last_pw_storage= "unset";
@@ -206,8 +208,8 @@ class user extends plugin
   /* execute generates the html output for this node */
   function execute()
   {
-       /* Call parent execute */
-       plugin::execute();
+    /* Call parent execute */
+    plugin::execute();
 
     $smarty= get_smarty();
 
@@ -269,6 +271,27 @@ class user extends plugin
       return;
     }
 
+    /* Base select dialog */
+    if(isset($_POST['chooseBase'])){
+      $this->dialog = new baseSelectDialog($this->config);
+      $this->dialog->setCurrentBase($this->base);
+    }
+
+    /* Dialog handling */
+    if(is_object($this->dialog)){
+      /* Must be called before save_object */
+      $this->dialog->save_object();
+   
+      if($this->dialog->isClosed()){
+        $this->dialog = false;
+      }elseif($this->dialog->isSelected()){
+        $this->base = $this->dialog->isSelected();
+        $this->dialog= false;
+      }else{
+        return($this->dialog->execute());
+      }
+    }
+
     /* Want picture edit dialog? */
     if (isset($_POST['edit_picture'])){
       /* Save values for later recovery, in case some presses
@@ -442,7 +465,7 @@ class user extends plugin
     /* Show us the edit screen */
     @$smarty->assign("bases", $this->allowedBasesToMoveTo());
 #  $smarty->assign("bases", $this->config->idepartments);
-    $smarty->assign("base_select", $this->base);
+    $smarty->assign("base_select",      trim($this->config->idepartments[$this->base]));
     $smarty->assign("selectmode",       chkacl($this->acl, "create"));
     $smarty->assign("certificatesACL",  chkacl($this->acl, "certificates"));
     $smarty->assign("jpegPhotoACL",     chkacl($this->acl, "jpegPhoto"));