Code

Added "if ($remove_lock){" part to main.inc
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jun 2006 08:48:18 +0000 (08:48 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jun 2006 08:48:18 +0000 (08:48 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3980 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/mimetypes/main.inc

index 6f6cce79d83602f84c85930006bc850fa6bab1f3..1595f185e86ff1f82469511171011ca7c8e2b677 100755 (executable)
    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"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".@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"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".@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;
-
 ?>