<?php
class Usuario extends UtilObjeto {

	public function __construct($params=""){
		parent::__construct(strtolower(get_class()), $params);
	}

	public static function antiInjection($valor){
		$txt = $valor;
		$txt = str_replace("'","",$txt);
		$txt = str_replace(";","",$txt);
		$txt = str_replace("#","",$txt);
		$txt = str_replace("*","",$txt);
		$txt = str_replace("%","",$txt);
		$txt = str_replace("/","",$txt);
		return trim($valor);
	}
	
	public static function trataSenha($senha){
		$novaSenha = Usuario::antiInjection(trim($senha));
		return md5($novaSenha);
	}
	
	public static function verificaLogin(){
		if(!isset($_SESSION['rz2']['admin']['usuario'])){
			header('Location: '.URLADMIN.'login.php');
			exit;
		}
	}

}
?>