From 7c6eb3564bdea477578296d4f95cd49581c9dfdb Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 4 Aug 2015 10:12:01 +0200 Subject: [PATCH] Fix user edit --- main/admin/user_edit.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main/admin/user_edit.php b/main/admin/user_edit.php index 1567d43fbf..0f2138f5df 100755 --- a/main/admin/user_edit.php +++ b/main/admin/user_edit.php @@ -97,7 +97,7 @@ unset($user_data['password']); $form = new FormValidator( 'user_edit', 'post', - '', + api_get_self().'?user_id='.$user_id, '' ); $form->addElement('header', '', $tool_name); @@ -202,7 +202,7 @@ $group[] = $form->createElement( array('onkeydown' => 'javascript: password_switch_radio_button();') ); $form->addGroup($group, 'password', null, '', false); -$form->addGroupRule('password', 'password', 'required', null, 2); +//$form->addGroupRule('password', 'password', 'required', null, 1); // Status $status = array(); @@ -299,6 +299,13 @@ $error_drh = false; // Validate form if ($form->validate()) { $user = $form->getSubmitValues(1); + $reset_password = intval($user['reset_password']); + if ($reset_password == 2 && empty($user['password'])) { + Display::addFlash(Display::return_message(get_lang('PasswordIsTooShort'))); + header('Location: '.api_get_self().'?user_id='.$user_id); + exit(); + } + $is_user_subscribed_in_course = CourseManager::is_user_subscribed_in_course($user['user_id']); if ($user['status'] == DRH && $is_user_subscribed_in_course) {