Main Page | Directories | File List | File Members

lostlogin.php

Go to the documentation of this file.
00001 <?php
00002 // This file is part of the Savane project
00003 // <http://gna.org/projects/savane/>
00004 //
00005 // $Id: lostlogin.php 4567 2005-06-30 17:19:37Z toddy $
00006 //
00007 //
00008 // Copyright 1999-2000 (c) The SourceForge Crew
00009 //
00010 //
00011 //  Copyright (C) 2000-2003 Free Software Foundation
00012 // 
00013 // The Savane project is free software; you can redistribute it and/or
00014 // modify it under the terms of the GNU General Public License
00015 // as published by the Free Software Foundation; either version 2
00016 // of the License, or (at your option) any later version.
00017 //
00018 // The Savane project is distributed in the hope that it will be useful,
00019 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021 // GNU General Public License for more details.
00022 //
00023 // You should have received a copy of the GNU General Public License
00024 // along with the Savane project; if not, write to the Free Software
00025 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00026 //
00027 //
00028 //
00029 //
00030 
00031 require "../include/pre.php";    
00032 require  $GLOBALS['sys_www_topdir']."/include/account.php";
00033 
00034 // ###### function register_valid()
00035 // ###### checks for valid register from form post
00036 
00037 $res_lostuser = db_query("SELECT * FROM user WHERE confirm_hash='$confirm_hash'");
00038 if (db_numrows($res_lostuser) > 1) {
00039         exit_error(_("Error"),_("This confirm hash exists more than once."));
00040 }
00041 if (db_numrows($res_lostuser) < 1) {
00042         exit_error(_("Error"),_("Invalid confirmation hash."));
00043 }
00044 $row_lostuser = db_fetch_array($res_lostuser);
00045 
00046 if ($update && form_check($form_id) && $form_pw && !strcmp($form_pw,$form_pw2)) {
00047   db_query("UPDATE user SET "
00048            . "user_pw='" . md5($form_pw) . "',"
00049            . "confirm_hash='' WHERE "
00050            . "confirm_hash='$confirm_hash'");
00051   
00052   form_clean($form_id);
00053   session_redirect($GLOBALS['sys_home']);
00054 }
00055 
00056 $HTML->header(array('title'=>_("Lost Password Login")));
00057 
00058 print '<h3>'._("Lost Password Login").'</h3>';
00059 print '<p>'._("Welcome").', '.$row_lostuser['user_name'].'.';
00060 print ' '._("You may now change your password").'.</p>';
00061 
00062 print form_header($PHP_SELF);
00063 
00064 print '<div class="inputfield"><h5>'._("New Password:").'</h5>';
00065 print form_input("password", "form_pw").'</div>';
00066 
00067 print '<div class="inputfield"><h5>'._("New Password (repeat):").'</h5>';
00068 print form_input("password", "form_pw2").'</div>';
00069 
00070 print form_input("hidden", "confirm_hash", $confirm_hash);
00071 print form_footer();
00072 
00073 $HTML->footer(array());
00074 
00075 ?>

Generated on Sun Feb 26 13:23:04 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4