Code

Updated plugin creation && locking for all main.incs
[gosa.git] / gosa-core / plugins / admin / ogroups / main.inc
index aa6cd07ceacd07297ae8a7d69ecb884545cafd5f..6de420cc09e86f23ff170bf6c2985d335a4c23b1 100644 (file)
  */
 
 
-
+/* Remove locks created by this plugin
+*/
 if ($remove_lock){
   if(session::is_set('ogroup')){
-    $ogroup = session::get('ogroup');
-    $ogroup->remove_lock();
-    session::un_set ('ogroup');
+      $macl = session::get('ogroup');
+      $macl->remove_lock();
   }
-} else {
+}
+
+/* Remove this plugin from session
+*/
+if ( $cleanup ){
+  session::un_set('ogroup');
+}else{
 
   /* Create object object on demand */
-  if (!session::is_set('ogroup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
+  if (!session::is_set('ogroup')){
     session::set('ogroup',new ogroupManagement ($config));
+    
   }
   $ogroup = session::get('ogroup');
 
@@ -41,12 +48,12 @@ if ($remove_lock){
   $output= $ogroup->execute ();
 
   /* Page header*/
-  if (session::is_set('objectinfo')){
+  if (get_object_info() != ""){
     $display= print_header(get_template_path('plugins/ogroups/images/plugin.png'),
                           _("Object groups"),
                           "<img alt=\"\" align=\"middle\" src=\"".
                           get_template_path('images/lists/locked.png').
-                          "\"> ".@LDAP::fix(session::get('objectinfo')));
+                          "\"> ".LDAP::fix(get_object_info()));
   } else {
     $display= print_header(get_template_path('plugins/ogroups/images/plugin.png'), _("Object groups"));
   }