Code

fixed phone & nagios
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 2 Nov 2006 11:56:12 +0000 (11:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 2 Nov 2006 11:56:12 +0000 (11:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4997 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/main.inc
plugins/personal/nagios/main.inc

index aed88aa7c94b87b7d86297a983ceaba8049d0fe8..5b113a8fef47a049e19338c54032b21fabdf325f 100644 (file)
@@ -18,6 +18,8 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+$display       = "";
+$lock_msg      = "";
 if (!$remove_lock){
        /* Reset requested? */
        if (isset($_POST['edit_cancel']) ||
@@ -47,14 +49,17 @@ if (!$remove_lock){
                /* Check locking */
                if (($username= get_lock($ui->dn)) != ""){
                        $_SESSION['back_plugin']= $plug;
-                       gen_locked_message ($username, $ui->dn);
-                       exit ();
+                       $_SESSION['LOCK_VARS_TO_USE'] = array("/^edit$/","/^plug$/");
+                       $lock_msg =  gen_locked_message ($username, $ui->dn);
+
+               }else{
+
+                       /* Lock the current entry */
+                       add_lock ($ui->dn, $ui->dn);
+                       $_SESSION['dn']= $ui->dn;
+                       $_SESSION['edit']= TRUE;
                }
 
-               /* Lock the current entry */
-               add_lock ($ui->dn, $ui->dn);
-               $_SESSION['dn']= $ui->dn;
-               $_SESSION['edit']= TRUE;
        }
 
        /* save changes to LDAP and disable edit mode */
@@ -80,7 +85,11 @@ if (!$remove_lock){
        }
 
        /* Execute formular */
-       $display= $phoneAccount->execute ();
+       if($lock_msg){
+               $display.= $lock_msg;
+       }else{
+               $display.= $phoneAccount->execute ();
+       }
 
        /* Store changes  in session */
        if (isset ($_SESSION['edit'])){
@@ -88,7 +97,7 @@ if (!$remove_lock){
        }
 
        $info= "";
-       if ($phoneAccount->is_account){
+       if ($phoneAccount->is_account && empty($lock_msg)){
                $display.= "<p class=\"plugbottom\">";
 
                /* Are we in edit mode? */
index 800190568466a513409c8f6de31ded7c742d681a..0f58081124c1b5abdf6b1482516420f6500c965b 100644 (file)
@@ -18,6 +18,9 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+$display    = "";
+$lock_msg   = "";
+
 if (!$remove_lock){
   /* Reset requested? */
   if (isset($_POST['edit_cancel']) || 
@@ -46,14 +49,16 @@ if (!$remove_lock){
     /* Check locking */
     if (($username= get_lock($ui->dn)) != ""){
       $_SESSION['back_plugin']= $plug;
-      gen_locked_message ($username, $ui->dn);
-      exit ();
-    }
+      $_SESSION['LOCK_VARS_TO_USE'] = array("/^edit$/","/^plug$/");
+      $lock_msg =  gen_locked_message ($username, $ui->dn);
+
+    }else{
 
-    /* Lock the current entry */
-    add_lock ($ui->dn, $ui->dn);
-    $_SESSION['dn']= $ui->dn;
-    $_SESSION['edit']= TRUE;
+      /* Lock the current entry */
+      add_lock ($ui->dn, $ui->dn);
+      $_SESSION['dn']= $ui->dn;
+      $_SESSION['edit']= TRUE;
+    }
   }
 
   /* save changes to LDAP and disable edit mode */
@@ -78,7 +83,11 @@ if (!$remove_lock){
   }
 
   /* Execute formular */
-  $display= $nagiosAccount->execute ();
+  if($lock_msg){
+    $display.= $lock_msg;
+  }else{
+    $display.= $nagiosAccount->execute ();
+  }
 
   /* Store changes  in session */
   if (isset ($_SESSION['edit'])){
@@ -87,7 +96,7 @@ if (!$remove_lock){
 
   $info= "";
   /* Show page footer depending on the mode */
-  if ($nagiosAccount->is_account){
+  if ($nagiosAccount->is_account && empty($lock_msg)){
     $display.= "<p class=\"plugbottom\">";
 
     /* Are we in edit mode? */