diff --git a/gosa-plugins/goto/personal/environment/main.inc b/gosa-plugins/goto/personal/environment/main.inc
index d21438fbde74ed2282ead5bb80ecec6b5d981d1c..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 = "";
-if (!$remove_lock){
+
+/* 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');
+
+}else{
+
/* Reset requested? */
/* Reset requested? */
- if (isset($_POST['edit_cancel']) ||
- (isset($_GET['reset']) && $_GET['reset'] == 1)){
-# 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');
}
}
/* Enter edit mode? */
}
/* Enter edit mode? */
- if (isset($_POST['edit'])){
+ if (isset($_POST['edit']) || isset($_POST['delete_lock'])){
/* Check locking */
if (($username= get_lock($ui->dn)) != ""){
/* Check locking */
if (($username= get_lock($ui->dn)) != ""){
/* Lock the current entry */
add_lock ($ui->dn, $ui->dn);
/* Lock the current entry */
add_lock ($ui->dn, $ui->dn);
- session::set('dn',$ui->dn);
session::set('edit',TRUE);
}
}
session::set('edit',TRUE);
}
}
session::un_set ('environment');
} else {
/* Errors found, show message */
session::un_set ('environment');
} else {
/* Errors found, show message */
- msgDialog::displayChecks($message);
+ msg_dialog::displayChecks($message);
}
}
}
}
$info= "";
/* Show page footer depending on the mode */
$info= "";
/* Show page footer depending on the mode */
- if (!$environment->in_dialog && $environment->is_account && empty($lock_msg)){
+ if (!$environment->in_dialog && !$environment->dialog && $environment->is_account && empty($lock_msg)){
$display.= "<p class=\"plugbottom\">";
/* Are we in edit mode? */
$display.= "<p class=\"plugbottom\">";
/* Are we in edit mode? */
- if ((session::is_set('edit'))&&($environment->dialog===NULL)){
- $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\""._("Ok")."\">\n";
+ if (session::is_set('edit')){
+ $display.= "<input type=submit name=\"edit_finish\" style=\"width:80px\" value=\"".msgPool::okButton()."\">\n";
$display.= " ";
$display.= " ";
- $display.= "<input type=submit name=\"edit_cancel\" value=\""._("Cancel")."\">\n";
- $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png').
+ $display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
+ $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png').
"\"> ".$ui->dn." ";
} else {
"\"> ".$ui->dn." ";
} else {
- $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/openlock.png').
+ $info= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/unlocked.png').
"\"> ".$ui->dn." ";
"\"> ".$ui->dn." ";
- if(preg_match("/w/",$ui->get_permissions($ui->dn,"users/environment"))){
- $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lamp.png').
- "\"> "._("Click the 'Edit' button below to change informations in this dialog");
- $display.= "<input type=submit name=\"edit\" value=\""._("Edit")."\">\n";
+ if(preg_match("/r/",$ui->get_permissions($ui->dn,"users/environment"))){
+ $info.= "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/on.png').
+ "\"> ".msgPool::clickEditToChange();
+ $display.= "<input type=submit name=\"edit\" value=\"".msgPool::editButton()."\">\n";
}
$display.= "<input type=\"hidden\" name=\"ignore\">\n";
}
}
$display.= "<input type=\"hidden\" name=\"ignore\">\n";
}
}
/* Page header*/
}
/* Page header*/
- $display= print_header(get_template_path('images/email.png'), _("User environment settings"), $info).$display;
+ $display= print_header(get_template_path('plugins/goto/images/plugin.png'), _("User environment settings"), $info).$display;
}
}