Location: PHPKode > scripts > SelectaPix Image Gallery > admin/forgot_passwd.php
<?php
/* +----------------------------------------------------------------------+
   |SelectaPix Open Source Gallery	                                      |
   +----------------------------------------------------------------------+
   | Copyright (c) 2004 OutOfTheTrees			                          |
   |                                                                      |
   | http://www.outofthetrees.co.uk/index.php                             |
   | 												                      |
   +----------------------------------------------------------------------+
   | This source file is subject to version 2.0 of the GPL license,       |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.outofthetrees.co.uk/license/2_0.txt.                      |
   | If you did not receive a copy of the SelectaPix license and are 	  |
   | unable to obtain it through the world-wide-web, please send a note   |
   | to hide@address.com so we can mail you a copy immediately.|
   +----------------------------------------------------------------------+ */
require_once("includes/inc_global_fns.php");
do_html_header("Resetting password");
echo '<p>&nbsp;</p>';
do_html_heading("<span>".SITE_NAME."</span> Admin");
$username = htmlspecialchars(trim($_POST['username']));
if($username == 'guest') {
	echo '<p class="badnews">You do not have sufficient administrative rights to perform this action<br />';
	echo 'If you believe that you should have access please contact the site administrator.</p>';
}
$password = $user->reset_password($username);
if ($password) {
	if(!strstr($password, '<p class="badnews">')) {
		if ($user->notify_password($username, $password)) {
			echo '<p class="goodnews">Your new password has been sent to your email address.</p>';
		}
		else {
		    echo '<p class="badnews">Your password could not be mailed to you&#8212;try clicking refresh.</p>';
		}
	}
	else {
		echo $password;
	}
}
else {
	echo '<p class="badnews">Password could not be reset&#8212;please try again later.</p>';
}
do_html_url("login.php", "Return to Login Page");
do_html_footer('5', 'nokwikenav');
?>
Return current item: SelectaPix Image Gallery