<?php 


class pass{

	public function index(){
		User::aut(false);
		
		require_once  MODEL.'pass.class.php';
		$obj = new pass_model();
		$obj -> pass();
		
		Template::head('Восстановление пароля');
		Template::run(__CLASS__, 'index');
		Template::foot();
	}

	public function new_pass(){
		if(isset($_GET['get']) && Core::count("SELECT COUNT(*) FROM `users` WHERE `hash_pass_new` = ?", array($_GET['get'])) == 1){
		User::aut(false);
		
		require_once  MODEL.'pass.class.php';
		$obj = new pass_model();
		$obj -> new_pass();
		
		Template::head('Восстановление пароля');
		Template::run(__CLASS__, 'new_pass');
		Template::foot();
}else{
			Core::redirect('/', 'Доступ запрещен');
}
	}

}
?>