<?php
/*******************************************************************************
 *                    _ _ _ _
 *                   / _ _  /
 *            _ _   / /__/ /_ _   ____ _ _   _ _ _    __
 *           / _ ` /   _ _// _ ` / __// _ ` / _ \\ \ / /
 *          / _ _// /\ \  / _ _/ \_ \/ _ _// / \/ \ ` /
 *          \_ , /_/  \_\ \_ ,  /__ /\_ , /_/      \_/
 *
 *******************************************************************************
 *    Application:  eReserv
 *    Version:      6
 *    Author:       David Di Certo
 *    Website:      http://www.cogites.com
 *    Email:        contact@cogites.com
 *    Copyright:    2013 - David Di Certo
 *******************************************************************************
 *    == FR ==      La revente et la redistribution de l'application sont
 *                  strictement interdites.
 *
 *                  Vous êtes tenu d'avoir pris connaissance des
 *                  Conditions Générales de Vente disponibles sur Cogites.com
 *                  (y compris pour la version Free).
 *
 *    == EN ==      Resale and redistribution of the application are
 *                  Strictly prohibited.
 *
 *                  You are required to have read the Terms and Conditions
 *                  available on Cogites.com (including the Free version).
 *
 *******************************************************************************
*/

require_once('dao/UserDao.php');

class UserMgr {

	function userLogin ($usr, $pwd) {
		return UserDao::userLogin ($usr, $pwd);
	}
	function getUsers ($str = null){
		return UserDao::getUsers ($str);
	}
	function searchUser ($str = null){
		return UserDao::searchUser ($str);
	}
	function getUserById ($userid){
		return UserDao::getUserById ($userid);
	}
	function getUserByEmail($email){
		return UserDao::getUserByEmail ($email);
	}
	function getUserByResetId($resetid){
		return UserDao::getUserByResetId ($resetid);
	}
	function addUser ($usr, $pwd, $email) {
		$res = UserDao::addUser ($usr, $pwd, $email);
		if ($res > 0){
			// send Confirmation mail process
			return $res;
		}else{
			return -1;
		}
	}
	function insert ($user) {
		return UserDao::insert ($user);
	}
	function update ($user) {
		return UserDao::update ($user);
	}
	function delete ($id) {
		return UserDao::delete ($id);
	}
	function enable ($usr) {
		return UserDao::enable ($usr);
	}
	function changePassword($userid, $pwd){
		return UserDao::changePassword ($userid, $pwd);
	}
	function setResetId($userid, $resetid){
		return UserDao::setResetId ($userid, $resetid);
	}
	function clearResetId($userid){
		return UserDao::clearResetId ($userid);
	}
	
}
