5 include_once($path_to_root . "/includes/session.inc");
7 page(_("Change password"));
9 include_once($path_to_root . "/includes/date_functions.inc");
10 include_once($path_to_root . "/includes/ui.inc");
12 include_once($path_to_root . "/admin/db/users_db.inc");
14 $selected_id = $_SESSION["wa_current_user"]->username;
17 function can_process()
20 if (strlen($_POST['password']) < 4)
22 display_error( _("The password entered must be at least 4 characters long."));
23 set_focus('password');
27 if (strstr($_POST['password'], $_POST['user_id']) != false)
29 display_error( _("The password cannot contain the user login."));
30 set_focus('password');
34 if ($_POST['password'] != $_POST['passwordConfirm'])
36 display_error( _("The passwords entered are not the same."));
37 set_focus('password');
44 if (isset($_POST['UPDATE_ITEM']))
49 update_user_password($_POST['user_id'], md5($_POST['password']));
50 display_notification(_("Your password has been updated."));
51 $Ajax->activate('_page_body');
57 start_table($table_style);
59 $myrow = get_user($selected_id);
61 $_POST['user_id'] = $myrow["user_id"];
62 hidden('selected_id', $selected_id);
63 hidden('user_id', $_POST['user_id']);
65 label_row(_("User login:"), $_POST['user_id']);
67 $_POST['password'] = "";
68 $_POST['passwordConfirm'] = "";
71 label_cell(_("Password:"));
72 label_cell("<input type='password' name='password' size=22 maxlength=20 value='" . $_POST['password'] . "'>");
76 label_cell(_("Repeat password:"));
77 label_cell("<input type='password' name='passwordConfirm' size=22 maxlength=20 value='" . $_POST['passwordConfirm'] . "'>");
80 table_section_title(_("Enter your new password in the fields."));
84 submit_center( 'UPDATE_ITEM', _('Change password'), true, '', true);