Code

Updated plugin creation && locking for all main.incs
[gosa.git] / gosa-core / plugins / admin / ogroups / main.inc
index 84b7b4019d6b2a0093ce1fe802da9150089d1bef..6de420cc09e86f23ff170bf6c2985d335a4c23b1 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-if (!$remove_lock){
+
+/* Remove locks created by this plugin
+*/
+if ($remove_lock){
+  if(session::is_set('ogroup')){
+      $macl = session::get('ogroup');
+      $macl->remove_lock();
+  }
+}
+
+/* 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');
 
@@ -32,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"));
   }