Location: PHPKode > projects > ProjectPress > projectpress/profile/changepassword.php
<?php 
/**
 * ProjectPress change password form
 *
 * @package ProjectPress
 * @since 2.0
 */

// Starts the session.
session_start();

define('access',true);

include(dirname(dirname(__FILE__)) . '/config.inc.php');
include(PM_DIR . 'pm-includes/global.inc.php');
require(PM_DIR . 'pm-includes/functions.php');
include(PM_DIR . 'pm-includes/header.php');

if($current_user->hasPermission('access_site') != true) { pm_redirect(PM_URI . '/index.php'); }

// Enable for error checking and troubleshooting.
# display_errors();

if($_POST) {
	$password = pmdb::connect()->escape(md5($_POST['password']));
	pmdb::connect()->query("UPDATE ". DB ."members SET password = '$password' WHERE username = '" . $_SESSION['username'] . "' LIMIT 1");
}

	/**
	 * Creates a new template for the add member page.
	 */
	$pass = new Template(PM_DIR . "pm-includes/tpl/changepassword.tpl");
	$pass->set("pmurl", get_pm_option('siteurl'));
	
	/**
	 * Outputs the page with add member form.
	 */
	echo $pass->output();

include(PM_DIR . 'pm-includes/footer.php');
Return current item: ProjectPress