function authenticate(p_username in varchar2 ,p_password in varchar2)
return boolean is v_on_off number ; begin select on_off into v_on_off from utilisateur where upper(username) = upper(p_username) and password = p_password; if v_on_off = 1 then return true; else apex_util.set_session_state('LOGIN_MESSAGE','Votre compte est bloqu�!'); return false; end if; exception when no_data_found then apex_util.set_session_state('LOGIN_MESSAGE', 'Nom d''utilisateur ou mot de passe incorrects'); return false; end authenticate;
function isadmin(p_username in varchar2 )
return boolean is v_isadmin number := 0; begin select role_id into v_isadmin from utilisateur where upper(username) = upper(p_username) ; if v_isadmin = 1 then return true; else return false; end if; end isadmin;
end; ------------------------------------------------ create or replace package PKG_AUTH as
function authenticate(p_username in varchar2 , p_password in varchar2)