<?php
/**
 * @package linea21.core
 * @subpackage admin
 * @author linea21 <info@linea21.com>
 * @version $id SVN
 * @access public
 * @license http://opensource.org/licenses/gpl-3.0.html
 */

function SQL_Get_UserInfo4Auth($login, $pass) {
	$requete = "SELECT U.user_id, R.* FROM " . T_USER . " AS U LEFT OUTER JOIN " . T_RIGHT . " AS R ON U.user_rights =R.rights_id WHERE lower(user_login) = '".strtolower($login)."' AND user_password='".$pass."' AND user_validity='Y';";
	return $requete;
}
function SQL_Get_UserInfo4Authid($id) {
	$requete = "SELECT user_id ,  jwu_workshop_id FROM " . T_USER . " As U LEFT OUTER JOIN " . J_WORK_USERS . " As W ON U.user_id=W.jwu_user_id WHERE user_id='".$id."' AND user_validity='Y' AND jwu_user_right='O';";
	return $requete;
}


function SQL_Get_UserWorkshopOwner($workshop_id) {  
     $requete = "SELECT jwu_user_id FROM " . J_WORK_USERS . " WHERE jwu_workshop_id='".$workshop_id."';"; 

     return $requete; 
}
?>
