Source for file lostPassword.php
Documentation is available at lostPassword.php
// $Id: lostPassword.php 11873 2007-04-04 19:46:04Z pcool $
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com
==============================================================================
==============================================================================
* This script allows users to retrieve the password of their profile(s)
* on the basis of their e-mail address. The password is send via email
* Special case : If the password are encrypted in the database, we have
* @todo refactor, move relevant functions to code libraries
==============================================================================
// name of the language file that needs to be included
$language_file = "registration";
require ('../inc/global.inc.php');
require_once ('lost_password.lib.php');
require_once (api_get_path(LIBRARY_PATH). 'formvalidator/FormValidator.class.php');
// Forbidden to retrieve the lost password
if (isset ($_GET["reset"]) && isset ($_GET["id"]))
$msg .= '. <br/>'. get_lang('YourPasswordHasBeenEmailed');
$form->add_textfield('email', get_lang('Email'), false, 'size="40"');
$form->applyFilter('email','strtolower');
$form->addElement('submit', 'submit', get_lang('Ok'));
$values = $form->exportValues();
$email = $values['email'];
$result = api_sql_query("SELECT user_id AS uid, lastname AS lastName, firstname AS firstName,
username AS loginName, password, email, status AS status,
official_code, phone, picture_uri, creator_id
AND email != '' ", __FILE__ , __LINE__ );
if ($userPasswordCrypted)
echo get_lang('_enter_email_and_well_send_you_password');
//////////////////////////////////////////////////////////////////////////////
|