From 16e0a7b0c81c677c0888671b67b1faabec4c62ce Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 10 Jul 2008 12:05:09 +0000 Subject: [PATCH] Fixed lock detection and locking in connectivity plugin. - Locked entries caused a white screen ;) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11593 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/connectivity/main.inc | 63 ++++++++++--------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/gosa-plugins/connectivity/personal/connectivity/main.inc b/gosa-plugins/connectivity/personal/connectivity/main.inc index a51269b6b..76b926ade 100644 --- a/gosa-plugins/connectivity/personal/connectivity/main.inc +++ b/gosa-plugins/connectivity/personal/connectivity/main.inc @@ -51,20 +51,19 @@ if (!$remove_lock){ } /* Enter edit mode? */ - if (isset($_POST['edit'])){ + if (isset($_POST['edit']) || isset($_POST['delete_lock'])){ /* Check locking */ if ((($username= get_lock($ui->dn)) != "") && (!session::is_set('edit'))){ session::set('back_plugin',$plug); - gen_locked_message ($username, $ui->dn); - exit (); - } - + $display = gen_locked_message ($username, $ui->dn); + }else{ - /* Lock the current entry */ - add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); - session::set('edit',TRUE); + /* Lock the current entry */ + add_lock ($ui->dn, $ui->dn); + session::set('dn',$ui->dn); + session::set('edit',TRUE); + } } /* save changes to LDAP and disable edit mode */ @@ -88,32 +87,34 @@ if (!$remove_lock){ } /* Execute formular */ - $display= $connectivity->execute (); + $info= ""; + if(!isset($display)){ + $display= $connectivity->execute (); - /* Store changes in session */ - if (session::is_set('edit')){ - session::set('connectivity',$connectivity); - } + /* Store changes in session */ + if (session::is_set('edit')){ + session::set('connectivity',$connectivity); + } - $info= ""; - $display.="
"; - if (session::is_set('edit')){ - $display.= "\n"; - $display.= " "; - $display.= "\n"; - $info= "\"\" ".$ui->dn." "; - } else { - $info= "\"\" ".$ui->dn." "; - - $info.= "\"\"".msgPool::clickEditToChange(); - $display.= "\n"; - $display.= "\n"; + $display.="
"; + if (session::is_set('edit')){ + $display.= "\n"; + $display.= " "; + $display.= "\n"; + $info= "\"\" ".$ui->dn." "; + } else { + $info= "\"\" ".$ui->dn." "; + + $info.= "\"\"".msgPool::clickEditToChange(); + $display.= "\n"; + $display.= "\n"; + } + $display.="
"; } - $display.="
"; /* Page header*/ $display= print_header(get_template_path('plugins/connectivity/images/plugin.png'), -- 2.30.2