Changeset 530 for trunk/wifidog-auth/wifidog/lost_password.php
- Timestamp:
- 04/01/05 16:38:25 (8 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog-auth/wifidog/lost_password.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/wifidog/lost_password.php
r517 r530 22 22 /**@file 23 23 * Login page 24 * @author Copyright (C) 2004 Benoit Gr �goire et Philippe April24 * @author Copyright (C) 2004 Benoit Grégoire et Philippe April 25 25 */ 26 26 define('BASEPATH','./'); … … 35 35 $username = $db->EscapeString($_REQUEST['username']); 36 36 $email = $db->EscapeString($_REQUEST['email']); 37 // If the source is present and that it's in our AUTH_SOURCE_ARRAY, save it to a var for later use 38 $_REQUEST['auth_source'] && in_array($_REQUEST['auth_source'], array_keys($AUTH_SOURCE_ARRAY)) && $account_origin = $_REQUEST['auth_source']; 37 39 38 40 try { 41 if(empty($account_origin)) 42 throw new Exception(_("Sorry, this network does not exist !")); 43 39 44 // Get a list of users associated with either a username of an e-mail 40 $username && $user s_list = User::getUsersByUsername($username);41 $email && $user s_list = User::getUsersByEmail($email);45 $username && $user = User::getUserByUsernameAndOrigin($username, $account_origin); 46 $email && $user = User::getUserByEmailAndOrigin($email, $account_origin); 42 47 43 48 // In the case that both previous function calls failed to return a users list 44 49 // Throw an exception 45 if(!empty($users_list)) 46 foreach($users_list as $user) 47 $user->sendLostPasswordEmail(); 50 if($user != null) 51 $user->sendLostPasswordEmail(); 48 52 else 49 throw new Exception(_(" user_id '{$object_id_str}' could not be found in thedatabase"));53 throw new Exception(_("This username or email could not be found in our database")); 50 54 51 55 $smarty->assign('message', _('A new password has been emailed to you.')); … … 58 62 } 59 63 64 // Add the auth servers list to smarty variables 65 $sources = array (); 66 // Preserve keys 67 foreach (array_keys($AUTH_SOURCE_ARRAY) as $auth_source_key) 68 if ($AUTH_SOURCE_ARRAY[$auth_source_key]['authenticator']->isRegistrationPermitted()) 69 $sources[$auth_source_key] = $AUTH_SOURCE_ARRAY[$auth_source_key]; 70 71 isset ($sources) && $smarty->assign('auth_sources', $sources); 72 // Pass the account_origin along, if it's set 73 isset ($_REQUEST["auth_source"]) && $smarty->assign('selected_auth_source', $_REQUEST["auth_source"]); 74 60 75 $smarty->display("templates/lost_password.html"); 61 76 ?>
