Code

Fixed locking in myAccountTabs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 Apr 2010 07:38:31 +0000 (07:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 Apr 2010 07:38:31 +0000 (07:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17727 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index ccd0cdc4ae2735216df316cb88d3fbc507204a4c..7074303489a8091150a0169f56137d808b34f4b9 100644 (file)
@@ -25,9 +25,9 @@
 */
 $lock_msg="";
 if ($remove_lock || isset($_POST['edit_cancel']) || isset($_POST['password_cancel'])){
+  del_lock($ui->dn);
   if(session::is_set('MyAccountTabs') && session::is_set('edit')){
     session::un_set('MyAccountTabs');
-    del_lock($ui->dn);
   }
 }
 
@@ -51,19 +51,19 @@ if (! $cleanup ){
   
   /* Enter edit mode? */
   if ((isset($_POST['edit'])) && (!session::is_set('edit'))){
-    $MyAccountTabs->setReadOnly(FALSE);
     
     /* Check locking */
     if (($username= get_lock($ui->dn)) != ""){
       session::set('back_plugin',$plug);
       session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/"));
-      $lock_msg =  gen_locked_message ($username, $ui->dn);
+      $lock_msg =  gen_locked_message ($username, array($ui->dn));
 
     }else{
 
       /* Lock the current entry */
       add_lock ($ui->dn, $ui->dn);
       session::set('edit',TRUE);
+      $MyAccountTabs->setReadOnly(FALSE);
     }
   }