Code

Updated plugin creation && locking for all main.incs
[gosa.git] / gosa-core / plugins / admin / ogroups / main.inc
index e571d7c2157f1348690d897e0c8f06228cba29f6..6de420cc09e86f23ff170bf6c2985d335a4c23b1 100644 (file)
  */
 
 
-
+/* Remove locks created by this plugin
+*/
 if ($remove_lock){
   if(session::is_set('ogroup')){
-    $ogroup = session::get('ogroup');
-    $ogroup->remove_lock();
+      $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');