Location: PHPKode > projects > Prsaar Social Networking Platform > PrsaarColour-0.7.alpha.6.3/pr-admin/option-account-password-update.php
<?php
	require_once('./admin.php');
	
	//change the password
	if($Action === 'update_password')
	{
		$OldPassword = md5($_POST['old_password']);
		$NewPassword1 = $_POST['new_password1'];
		$NewPassword2 = $_POST['new_password2'];
		
		//check the password
		$OldOldPassword = $DC->Select('config', 'config_name', 'admin_password');
		$OldOldPassword = $OldOldPassword[0]['config_value'];
		if($OldPassword !== $OldOldPassword)
			$Error['old_password'] = 'You have entered wrong password';
		//atleast 5 chars
		if(strlen($NewPassword1) < 5)
			$Error['new_password1'] = 'Your password should have atleast 5 characters';
		$NewPassword1 = md5($NewPassword1);
		$NewPassword2 = md5($NewPassword2);
		//if both passwords are same?
		if($NewPassword2 !== $NewPassword1)
			$Error['new_password2'] = 'Your passwords do not match';
		if(isset($Error))
		{
			require('./option-account-password.php');
			exit();
		}
		else
		{
			$DC->Result('REPLACE INTO '.PR_DATABASE_PREFIX."config SET config_name = 'admin_password', config_value = '{$NewPassword1}'");
			header('Location: ./option.php?highlight=password_changed');
			exit();
		}
	}
?>
Return current item: Prsaar Social Networking Platform