Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fc_user_auth(p_username in char,
- p_password in char) Return Boolean
- As
- v_Password char(250);
- v_Email char(250);
- v_id_user h_user.id_user%type;
- Begin
- If p_username Is Null Or p_password Is Null Then
- -- Write to Session, Notification must enter a username and password
- Apex_Util.Set_Session_State('LOGIN_MESSAGE','Please enter Username and password.');
- Return False;
- End If;
- ----
- Begin
- Select u.password
- ,u.email,
- id_user
- Into v_Password
- ,v_Email,
- v_id_user
- From h_user u
- Where upper(u.login) = upper(p_username);
- Apex_Util.Set_Session_State('LOGIN_MESSAGE', 'Tutaj');
- Exception
- When No_Data_Found Then
- -- Write to Session, User not found.
- Apex_Util.Set_Session_State('LOGIN_MESSAGE',p_username);
- Return False;
- End;
- If v_Password <> p_password Then
- -- Write to Session, Password incorrect.
- Apex_Util.Set_Session_State('LOGIN_MESSAGE','Password incorrect');
- Return False;
- End If;
- ---
- -- Write user information to Session.
- --
- Apex_Util.Set_Session_State('SESSION_USER_ID',v_id_user);
- ---
- ---
- Return True;
- End;
Advertisement
Add Comment
Please, Sign In to add comment