From: hickert Date: Thu, 2 Nov 2006 11:56:12 +0000 (+0000) Subject: fixed phone & nagios X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9c9a6cd78a4d0ebdcc930feef036e971e0ffbd91;p=gosa.git fixed phone & nagios git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4997 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/phoneaccount/main.inc b/plugins/gofon/phoneaccount/main.inc index aed88aa7c..5b113a8fe 100644 --- a/plugins/gofon/phoneaccount/main.inc +++ b/plugins/gofon/phoneaccount/main.inc @@ -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.= "

"; /* Are we in edit mode? */ diff --git a/plugins/personal/nagios/main.inc b/plugins/personal/nagios/main.inc index 800190568..0f5808112 100644 --- a/plugins/personal/nagios/main.inc +++ b/plugins/personal/nagios/main.inc @@ -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.= "

"; /* Are we in edit mode? */