Code

Fixed saving of POST values for read_only tabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Mar 2011 09:09:05 +0000 (09:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Mar 2011 09:09:05 +0000 (09:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20621 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/personal/myaccount/main.inc

index 282325215a6c5f10a7e56f3358947c4bf21a49ab..b300a97c11a33e3e4e05dca44379c79ba5984604 100644 (file)
@@ -53,6 +53,7 @@ if (! $cleanup ){
 
             $MyAccountTabs= new MyAccountTabs($config,$config->data['TABS']['MYACCOUNTTABS'], $ui->dn, "users", true, true); 
             $MyAccountTabs->setReadOnly(TRUE);
+            $MyAccountTabs->enableAutoSaveObject(FALSE);
             session::set('MyAccountTabs',$MyAccountTabs);
         }
     }
@@ -60,6 +61,9 @@ if (! $cleanup ){
     if(session::is_set('MyAccountTabs')){
         $MyAccountTabs = session::get('MyAccountTabs');
 
+
+        $call_save_object = !$MyAccountTabs->read_only;
+
         /* Enter edit mode? */
         if ((isset($_POST['edit'])) && (!session::is_set('edit'))){
 
@@ -115,6 +119,12 @@ if (! $cleanup ){
             if($lock_msg){
                 $display = $lock_msg;
             }else{
+
+                // Reenabled auto saveing of POST values.
+                if($call_save_object){
+                    $MyAccountTabs->enableAutoSaveObject(TRUE);
+                }
+
                 $display.= $MyAccountTabs->execute ();
             }
         }