From 688e7ca5c7431e132b35918dc75cf5e08fe06eae Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 29 Jun 2006 08:48:18 +0000 Subject: [PATCH] Added "if ($remove_lock){" part to main.inc git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3980 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/mimetypes/main.inc | 58 ++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/plugins/admin/mimetypes/main.inc b/plugins/admin/mimetypes/main.inc index 6f6cce79d..1595f185e 100755 --- a/plugins/admin/mimetypes/main.inc +++ b/plugins/admin/mimetypes/main.inc @@ -18,32 +18,40 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* Create MimeTypeManagement object on demand */ -if (!isset($_SESSION['MimeTypeManagement']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['MimeTypeManagement']= new mimetypeManagement ($config, $_SESSION['ui']); -} - -/* Get object */ -$MimeTypeManagement= $_SESSION['MimeTypeManagement']; -$MimeTypeManagement->save_object(); -$output= $MimeTypeManagement->execute(); - -/* Page header*/ -if (isset($_SESSION['objectinfo'])){ - $display= print_header(get_template_path('images/mimetypes.png'), _("Mimetype management"), "\"\" ".@LDAP::fix($_SESSION['objectinfo'])); +if ($remove_lock){ + if(isset($_SESSION['MimeTypeManagement'])){ + $MimeTypeManagement= $_SESSION['MimeTypeManagement']; + $MimeTypeManagement->remove_lock(); + del_lock ($ui->dn); + sess_del ('MimeTypeManagement'); + } } else { - $display= print_header(get_template_path('images/mimetypes.png'), _("Mimetype management")); -} -/* Reset requested? */ -if (isset($_GET['reset']) && $_GET['reset'] == 1){ - del_lock ($ui->dn); - sess_del ('MimeTypeManagement'); + /* Create MimeTypeManagement object on demand */ + if (!isset($_SESSION['MimeTypeManagement']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + $_SESSION['MimeTypeManagement']= new mimetypeManagement ($config, $_SESSION['ui']); + } + + /* Get object */ + $MimeTypeManagement= $_SESSION['MimeTypeManagement']; + $MimeTypeManagement->save_object(); + $output= $MimeTypeManagement->execute(); + + /* Page header*/ + if (isset($_SESSION['objectinfo'])){ + $display= print_header(get_template_path('images/mimetypes.png'), _("Mimetype management"), "\"\" ".@LDAP::fix($_SESSION['objectinfo'])); + } else { + $display= print_header(get_template_path('images/mimetypes.png'), _("Mimetype management")); + } + + /* Reset requested? */ + if (isset($_GET['reset']) && $_GET['reset'] == 1){ + del_lock ($ui->dn); + sess_del ('MimeTypeManagement'); + } + + /* Show and save dialog */ + $display.= $output; + $_SESSION['MimeTypeManagement']= $MimeTypeManagement; } - -/* Show and save dialog */ -$display.= $output; -$_SESSION['MimeTypeManagement']= $MimeTypeManagement; - ?> -- 2.30.2