From: hickert Date: Fri, 12 Dec 2008 07:05:08 +0000 (+0000) Subject: Removed session::set from My Account plugins. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3bf2f41556304a0026112295e2b40acf2512b311;p=gosa.git Removed session::set from My Account plugins. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13266 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index 6c2a5e7e4..1d568288b 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -196,10 +196,17 @@ if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){ } /* Check if we need to delete a lock */ + +print_a(array($old_plugin_dir,$plugin_dir,$old_plugin_dir,getcwd())); + if ($old_plugin_dir != $plugin_dir && $old_plugin_dir != ""){ + if (is_file("$old_plugin_dir/main.inc")){ $remove_lock= true; + echo "Jaa . "."$old_plugin_dir/main.inc"; require_once ("$old_plugin_dir/main.inc"); + }else{ + echo "No"; } } $remove_lock= false; diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc index b0687b880..6e3bfe7b0 100644 --- a/gosa-core/plugins/personal/generic/main.inc +++ b/gosa-core/plugins/personal/generic/main.inc @@ -23,7 +23,13 @@ /* Preset display */ $display = ""; $lock_msg = ""; -if (!$remove_lock){ + +if ( $remove_lock){ + if(session::is_set('user') && session::is_set('edit')){ + del_lock ($ui->dn); + } +}else{ + /* Reset requested? */ if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -60,7 +66,7 @@ if (!$remove_lock){ session::global_set('back_plugin',$plug); session::global_set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/")); $lock_msg = gen_locked_message ($username, $ui->dn); - + }else{ /* Lock the current entry */ @@ -133,7 +139,7 @@ if (!$remove_lock){ $display.= $smarty->fetch(get_template_path('password.tpl', TRUE)); return ($display); } else { - session::un_set ('user'); + session::un_set ('user'); } } else { @@ -167,7 +173,7 @@ if (!$remove_lock){ $display.= "\n"; $info= "\"\" ".$ui->dn." "; + "\"> ".$ui->dn." "; } else { /* 'viewid' may be set by i.e. the phonelist plugin. This means that we want to go back... */ @@ -178,7 +184,7 @@ if (!$remove_lock){ $str= msgPool::editButton(); $fn = "edit"; $info= "\"\" ".$ui->dn." "; + "\"> ".$ui->dn." "; } /* Only display edit button if there is at least one attribute editable */ @@ -197,7 +203,7 @@ if (!$remove_lock){ /* Page header*/ $display= print_header(get_template_path('plugins/generic/images/plugin.png'), - _("Generic user information"), $info).$display; + _("Generic user information"), $info).$display; } diff --git a/gosa-core/plugins/personal/posix/main.inc b/gosa-core/plugins/personal/posix/main.inc index af4e0cabc..8ef7774ad 100644 --- a/gosa-core/plugins/personal/posix/main.inc +++ b/gosa-core/plugins/personal/posix/main.inc @@ -23,7 +23,12 @@ /* Clear display */ $display = ""; $lock_msg = ""; -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('posixAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -65,7 +70,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-plugins/connectivity/personal/connectivity/main.inc b/gosa-plugins/connectivity/personal/connectivity/main.inc index da38f9d2d..b19aec384 100644 --- a/gosa-plugins/connectivity/personal/connectivity/main.inc +++ b/gosa-plugins/connectivity/personal/connectivity/main.inc @@ -18,14 +18,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('connectivity') && session::is_set('edit')){ + del_lock ($ui->dn); + } +}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('connectivity-') && session::is_set('edit')){ + if(session::is_set('connectivity') && session::is_set('edit')){ del_lock ($ui->dn); } session::un_set ('edit'); @@ -65,7 +70,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-plugins/goto/personal/environment/main.inc b/gosa-plugins/goto/personal/environment/main.inc index 3b55b3285..4fb93711f 100644 --- a/gosa-plugins/goto/personal/environment/main.inc +++ b/gosa-plugins/goto/personal/environment/main.inc @@ -18,7 +18,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ $lock_msg = ""; -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('environment') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ /* Reset requested? */ if (isset($_POST['edit_cancel']) || @@ -61,7 +66,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-plugins/mail/personal/mail/main.inc b/gosa-plugins/mail/personal/mail/main.inc index df0e7495e..205083bca 100644 --- a/gosa-plugins/mail/personal/mail/main.inc +++ b/gosa-plugins/mail/personal/mail/main.inc @@ -20,7 +20,13 @@ $lock_msg =""; $display =""; -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('mailAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ + /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -62,7 +68,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-plugins/nagios/personal/nagios/main.inc b/gosa-plugins/nagios/personal/nagios/main.inc index de4dcfd45..750e2ee04 100644 --- a/gosa-plugins/nagios/personal/nagios/main.inc +++ b/gosa-plugins/nagios/personal/nagios/main.inc @@ -21,7 +21,13 @@ $display = ""; $lock_msg = ""; -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('nagiosAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ + /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -63,7 +69,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-plugins/netatalk/personal/netatalk/main.inc b/gosa-plugins/netatalk/personal/netatalk/main.inc index 65e02834d..83ecfbc29 100644 --- a/gosa-plugins/netatalk/personal/netatalk/main.inc +++ b/gosa-plugins/netatalk/personal/netatalk/main.inc @@ -20,7 +20,13 @@ */ $lock_msg = ""; -if (!$remove_lock) { +if ( $remove_lock){ + if(session::is_set('netatalk') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ + /* Reset requested? */ if (isset ($_POST['edit_cancel']) || (isset ($_GET['reset']) && $_GET['reset'] == 1)) { @@ -59,7 +65,6 @@ if (!$remove_lock) { /* Lock the current entry */ add_lock($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } diff --git a/gosa-plugins/samba/personal/samba/main.inc b/gosa-plugins/samba/personal/samba/main.inc index 856478df4..f1dc45a06 100644 --- a/gosa-plugins/samba/personal/samba/main.inc +++ b/gosa-plugins/samba/personal/samba/main.inc @@ -20,7 +20,13 @@ $display = ""; $lock_msg = ""; -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('sambaAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ + /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -62,7 +68,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-plugins/scalix/personal/scalix/main.inc b/gosa-plugins/scalix/personal/scalix/main.inc index 4a6463fa4..ae033b073 100644 --- a/gosa-plugins/scalix/personal/scalix/main.inc +++ b/gosa-plugins/scalix/personal/scalix/main.inc @@ -19,7 +19,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -if (!$remove_lock){ +if ( $remove_lock){ + if(session::is_set('scalixAccount') && session::is_set('edit')){ + del_lock ($ui->dn); + } + +}else{ + /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -61,7 +67,6 @@ if (!$remove_lock){ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); - session::set('dn',$ui->dn); session::set('edit',TRUE); } }