More readable code

skala
Julio Montoya 14 years ago
parent 95d09e8ad2
commit c96c5d18f0
  1. 10
      main/auth/lostPassword.php

@ -29,6 +29,7 @@ require_once api_get_path(LIBRARY_PATH).'custompages.lib.php';
// Had to move the form handling in here, because otherwise there would
// already be some display output.
global $_configuration;
if (api_get_setting('use_custom_pages') == 'true') {
//Reset Password when user goes to the link
@ -93,15 +94,14 @@ if (api_get_setting('allow_lostpassword') == 'false') {
api_not_allowed();
}
if (isset ($_GET['reset']) && isset ($_GET['id'])) {
$msg1= '<a href="'.api_get_path(WEB_CODE_PATH).'auth/lostPassword.php" class="btn" >'.get_lang('Back').'</a>';
echo '<br /><br /><div class="actions" >'.$msg1.'</div>';
if (isset($_GET['reset']) && isset($_GET['id'])) {
$message = '<a href="'.api_get_path(WEB_CODE_PATH).'auth/lostPassword.php" class="btn" >'.get_lang('Back').'</a>';
echo '<br /><br /><div class="actions" >'.$message.'</div>';
} else {
$form = new FormValidator('lost_password');
$form->addElement('header', $tool_name);
$form->addElement('text', 'user', array(get_lang('LoginOrEmailAddress'), get_lang('EnterEmailUserAndWellSendYouPassword')), array('size'=>'40'));
//$form->applyFilter('email','strtolower');
$form->addElement('style_submit_button', 'submit', get_lang('Send'),'class="btn"');
// setting the rules
@ -138,7 +138,7 @@ if (isset ($_GET['reset']) && isset ($_GET['id'])) {
if ($result && $num_rows > 0) {
$by_username = true;
$users = Database::store_result($result);
foreach( $users as $user ) {
foreach ($users as $user ) {
if ($_configuration['password_encryption'] != 'none') {
Login::handle_encrypted_password($user, $by_username);
} else {

Loading…
Cancel
Save