summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd8482f)
raw | patch | inline | side by side (parent: fd8482f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Sep 2007 12:27:03 +0000 (12:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Sep 2007 12:27:03 +0000 (12:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7328 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_msg_dialog.inc | patch | blob | history | |
plugins/admin/users/class_userManagement.inc | patch | blob | history |
index 8561304962b674f39e64f6c6ded33c63bce4aaf9..2006c58e8d91646691a267e3d68d7aaca4e3012c 100644 (file)
public function __construct($s_title,$s_message,$i_type)
{
+ if(!in_array($i_type,array(INFO_DIALOG,WARNING_DIALOG,ERROR_DIALOG,CONFIRM_DIALOG))){
+ trigger_error("Invalid msg_dialog type.");
+ $i_type = INFO_DIALOG;
+ }
+
$this->i_ID = preg_replace("/[^0-9]*/","",microtime());
$this->s_Title = $s_title;
$this->s_Message = $s_message;
$box = new msg_dialog($s_title,$s_message,$i_type);
}
- public function is_confirmed()
- {
- if($this->i_Type == CONFIRM_DIALOG && isset($_POST['MSG_OK'])){
- return(TRUE);
- }
- }
-
public function get_ID()
{
return($this->i_ID);
$smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT']));
return($smarty->fetch(get_template_path('msg_dialog.tpl')));
}
+
+
+ public function is_confirmed()
+ {
+ if(isset($_POST['MSG_OK'.$this->i_ID])){
+ return(TRUE);
+ }else{
+ return(FALSE);
+ }
+ }
public static function get_dialogs()
diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc
index 8623b53fc68acf2036ae053f7f96db632f43b379..dd471f8ea63865558854bb31ff5e3f21732dd00a 100644 (file)
var $start_pasting_copied_objects = FALSE;
+ var $msg_dialog= NULL;
+
function userManagement(&$config, $ui)
{
/* Save configuration for internal use */
return(gen_locked_message ($user, $this->dn));
}
+
/* Lock the current entry, so nobody will edit it during deletion */
- add_lock ($this->dn, $this->ui->dn);
- $smarty->assign("info", sprintf(_("You're about to delete the user %s."), @LDAP::fix($this->dn)));
- $smarty->assign("multiple", false);
- return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+# add_lock ($this->dn, $this->ui->dn);
+# $smarty->assign("info", sprintf(_("You're about to delete the user %s."), @LDAP::fix($this->dn)));
+# $smarty->assign("multiple", false);
+# return($smarty->fetch(get_template_path('remove.tpl', TRUE)));
+ $this->msg_dialog = new msg_dialog(_("Delete user"),sprintf(_("You're about to delete the user %s."), @LDAP::fix($this->dn)),CONFIRM_DIALOG);
}
********************/
/* Confirmation for deletion has been passed. User should be deleted. */
- if (isset($_POST['delete_user_confirm'])){
+ if (is_object($this->msg_dialog) && $this->msg_dialog->is_confirmed()){
/* Some nice guy may send this as POST, so we've to check
for the permissions again. */