<?php


$file='../config.php';
include('../config.php');


if($__testMode==true)
{
	return true;
}

if(isset($_GET["currentPassword"]) && $_GET["currentPassword"] !="" )
{
	if(  $_GET["currentPassword"] != $__password )
	{
		echo "Provided Password is not correct";
	}
	else
	{
		if(isset($_GET["newPassword"]) && $_GET["newPassword"] !=""  )
		{
			$content=file_get_contents($file);
			$content = preg_replace('/\$__password=\"(.*?)\";/', '$__password="'. $_GET["newPassword"] .'";', $content);
			file_put_contents($file,$content);	
			echo "success";
		}		
		else
		{
			echo "New Password Not Provided";			
		}
	}
}
else
{
	echo "Current Password Not Provided";
}

?>