diff --git a/gosa-plugins/goto/personal/environment/main.inc b/gosa-plugins/goto/personal/environment/main.inc
index 094ffd70f5235a3a2a86a270d98cfeeb768d9230..141322066148ee80012083c48efa0193f090d53d 100644 (file)
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-$lock_msg = "";
-/* Remove classes and variables from session
- */
+/* Remove locks created by this plugin
+*/
+$lock_msg="";
+if ($remove_lock || isset($_POST['edit_cancel'])){
+ if(session::is_set('environment') && session::is_set('edit')){
+ del_lock($ui->dn);
+ }
+}
+
+/* Remove this plugin from session
+*/
if ( $cleanup ){
session::un_set('environment');
session::un_set('edit');
if ( $cleanup ){
session::un_set('environment');
session::un_set('edit');
-}
-
-if ( $remove_lock){
- if(session::is_set('environment') && session::is_set('edit')){
- del_lock ($ui->dn);
- }
}else{
/* Reset requested? */
}else{
/* Reset requested? */
- if (isset($_POST['edit_cancel']) ||
- (isset($_GET['reset']) && $_GET['reset'] == 1)){
-
- /* Only remove lock if object was opened
- */
- if(session::is_set('environment') && session::is_set('edit')){
- del_lock ($ui->dn);
- }
+ if (isset($_POST['edit_cancel'])){
session::un_set ('edit');
session::un_set ('environment');
}
session::un_set ('edit');
session::un_set ('environment');
}