<? 
Serval::call('tpl')->error = false;
if( isset($_POST['auth']) ){
	if( Serval::call('Auth')->Login() ){
		header("location: /?login");
		die();
	}else{
		Serval::call('tpl')->error = Serval::call('Auth')->error;
	}
}
if(isset($_POST['lostpass'])){
	if( Serval::call('Auth')->renewpassword_link() ){
		header("location: /?renew=ok");
		die();
	}else{
		Serval::call('tpl')->error = Serval::call('Auth')->error;
	}
}
if(isset($_GET['renew_key'])){
	if( Serval::call('Auth')->new_password($_GET['renew_key']) ){
		header("location: /?renew=password");
		die();
	}
}

Serval::call('tpl')->header = false;
Serval::call('tpl')->footer = false;
Serval::call('tpl')->display("auth");
?>