Location: PHPKode > projects > WaypointHR > waypointhr/reset.php
<?php
/*  ================================================================================================
	WaypointHR
	www.waypointhr.com
	Copyright 2009 HR-Fundamentals ltd.
----------------------------------------------------------------------------------------------------
	This file is part of WaypointHR.
	
	WaypointHR 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 3 of
	the License, or (at your option) any later version.
	
	WaypointHR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
	even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License along with WaypointHR.
	If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------------------------------
	ADMIN PASSWORD RESET
	$Revision: 497 $
	$LastChangedDate: 2009-07-14 03:44:57 +0100 (Tue, 14 Jul 2009) $
----------------------------------------------------------------------------------------------------
	Load and instantiate various common components
================================================================================================= */


// reset_admin_password('newPassword');		/*		<<<<---- REMOVE // FROM THE START OF THIS LINE */


/*  ================================================================================================
	INSTRUCTIONS
----------------------------------------------------------------------------------------------------
	1. Remove the comments from the start of the above line, i.e. remove the //
	2. Change the value of newPassword to something of your choice.
	3. Browse to this page (reset.php) - you should see a message informing you the password is reset
	4. Add the comments back in to the above line (and remove the new password from this page)
	
	You are strongly advised to remove your new password from the above line afterwards,
	otherwise anyone could browse to this file to reset your password. You should also consider
	changing your new password from within WaypointHR (options / preferences / change password). 
	
	Visit WaypointHR.com for more information and support.
	
	DO NOT EDIT ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
================================================================================================= */

echo 'To reset the admin user password, edit the reset.php file.';
die();

function reset_admin_password($new_password) {
	if($new_password==='newPassword') {
		echo 'You must change the value of newPassword to something of your choice.';
		die();	
	}
	
	global $global_db_engine;
	global $global_config;
	
	define('application_directory',dirname(__FILE__));
	
	@include_once(constant('application_directory').'/conf/installation_settings.php');
	$global_config=new config_sys();

	require_once(constant('application_directory').'/components/db_engine.php');
	$global_db_engine=new db_engine;

	require_once(constant('application_directory').'/components/authentication.php');
	$authentication_manager=new authentication();
	$authentication_manager->admin_password_reset($new_password);
	
	echo 'Your admin password has been reset. Please edit the reset.php file the return to WaypointHR login as normal.';
	die();
}
?>
Return current item: WaypointHR