Code

Fixed dialog handling for the user-generic plugin.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Jun 2011 11:29:47 +0000 (11:29 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 28 Jun 2011 11:29:47 +0000 (11:29 +0000)
-Do not show an empty page after user properties of the own account were changed.

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

gosa-core/plugins/personal/generic/class_user.inc
gosa-core/plugins/personal/generic/main.inc

index f6de8cfad0f850a579116e6a91127c0270ed2d4f..b4224693b103b36dbbe60156af71e863e68984d1 100644 (file)
@@ -110,7 +110,7 @@ class user extends plugin
 
   var $manager = "";
   var $manager_name = "";
-
+  var $passwordClass = NULL;
 
   /* attribute list for save action */
   var $attributes= array("sn", "givenName", "uid", "personalTitle", "academicTitle",
index b7cbfc87b1eb05379208b2269ec2b336ccd59c1f..8eaa212350abe54d6c9efaa5e7b0f43480d87e66 100644 (file)
@@ -98,7 +98,9 @@ if ( $cleanup ){
               session::set('user',$user);
               $display.=$user->passwordClass->execute();
           } else {
-              session::un_set ('user');
+            $display.= $user->execute ();
+            session::un_set ('user');
+            session::un_set ('edit');
           }
 
       } else {
@@ -117,52 +119,53 @@ if ( $cleanup ){
       }else{
           $display.= $user->execute ();
       }
+  }
 
-      /* Store changes  in session */
-      if (session::is_set('edit')){
-          session::set('user',$user);
-      }
+  /* Store changes  in session */
+  if (session::is_set('edit')){
+      session::set('user',$user);
+  }
 
-      /* Show page footer depending on the mode */
-      if (!$user->cert_dialog && !$user->picture_dialog && !$user->dialog && $user->is_account && empty($lock_msg)){
-          $display.= "<p class=\"plugbottom\">";
+  /* Show page footer depending on the mode */
+  if (!$user->passwordClass && !$user->cert_dialog && !$user->picture_dialog && !$user->dialog && $user->is_account && empty($lock_msg)){
+      $display.= "<p class=\"plugbottom\">";
 
-          /* Are we in edit mode? */
-          if (session::is_set('edit')){
-              $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
-              $display.= "&nbsp;";
-              $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
+      /* Are we in edit mode? */
+      if (session::is_set('edit')){
+          $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
+          $display.= "&nbsp;";
+          $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
 
-              $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png').
-                  "\"> ".$ui->dn."&nbsp;";
+          $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png').
+              "\"> ".$ui->dn."&nbsp;";
+      } else {
+          /* 'viewid' may be set by i.e. the phonelist plugin. This
+             means that we want to go back... */
+          if (isset ($viewid)){
+              $str= msgPool::backButton();
+              $fn = "back";
           } else {
-              /* 'viewid' may be set by i.e. the phonelist plugin. This
-                 means that we want to go back... */
-              if (isset ($viewid)){
-                  $str= msgPool::backButton();
-                  $fn = "back";
-              } else {
-                  $str= msgPool::editButton();
-                  $fn = "edit";
-                  $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/unlocked.png').
-                      "\"> ".$ui->dn."&nbsp;";
-              }
+              $str= msgPool::editButton();
+              $fn = "edit";
+              $info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/unlocked.png').
+                  "\"> ".$ui->dn."&nbsp;";
+          }
 
-              /* Only display edit button if there is at least one attribute editable */
-              if(preg_match("/r/",$ui->get_permissions($ui->dn,"users/user"))){
-                  if ($fn == "edit"){
-                      $info.= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/on.png')."\"> ".
-                          msgPool::clickEditToChange();
-                      $display.= "<input type=submit name=\"$fn\" value=\"$str\">\n";
-                  }
+          /* Only display edit button if there is at least one attribute editable */
+          if(preg_match("/r/",$ui->get_permissions($ui->dn,"users/user"))){
+              if ($fn == "edit"){
+                  $info.= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/on.png')."\"> ".
+                      msgPool::clickEditToChange();
+                  $display.= "<input type=submit name=\"$fn\" value=\"$str\">\n";
               }
-
-              $display.= "<input type=\"hidden\" name=\"ignore\">\n";
           }
-          $display.= "</p>\n";
+
+          $display.= "<input type=\"hidden\" name=\"ignore\">\n";
       }
+      $display.= "</p>\n";
   }
 
+
   /* Page header*/
   $display= print_header(get_template_path('plugins/generic/images/plugin.png'),
       _("Generic user information"), $info).$display;