Creating Custom Login Screen In Oracle Forms 10g

发布时间:2017-1-24 1:00:52 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"Creating Custom Login Screen In Oracle Forms 10g ",主要涉及到Creating Custom Login Screen In Oracle Forms 10g 方面的内容,对于Creating Custom Login Screen In Oracle Forms 10g 感兴趣的同学可以参考一下。

Creating Custom Login Screen In Oracle Forms 10g

Below is the example plsql unit to validate login credentials and after successful validation open a new form by passing some parameters to it, in Oracle forms 10g.
Create a form for custom login. Create text items for username and password etc. and a login button. When user click on that login button call this plsql routine.

declare
    vPassword fox_user.password%type; -- get a password field type from your user master table
    plid paramlist;
begin
-- check if username is null
if :appstart.usn is null then
    error_message('User name must be entered.');
    go_item('appstart.usn');
    raise Form_Trigger_Failure;
end if;
-- check if password is null
if :appstart.psw is null then
    error_message('Password must be entered.');
    go_item('appstart.psw');
    raise Form_Trigger_Failure;
end if;
select password into vpassword 
      from fox_user 
      where rtrim(userid) = rtrim(:appstart.usn);
-- decrypt password using your own encrypt / decrypt method.
-- below mentioned decrypt is a program unit i used
if :appstart.psw != decrypt(vpassword) then
     error_message('Invalid Password for the user. Logon Denied!');
     go_item('appstart.psw');
     raise form_trigger_Failure;
end if;
  -- if valid username and password then create parameter list to pass the calling form
    plid := get_parameter_list('formdata');
    if Not id_null(plid) then
         Destroy_parameter_list(plid);
    end if;
    plid := Create_Parameter_list('formdata');
    Add_parameter(plid, 'userid', text_parameter, :appstart.usn);
new_form('main', full_rollback, no_query_only, plid); 
exception
     when no_data_found then
        error_message('Invalid Userid. Please enter valid userid and password. Logon Denied!');
        go_item('appstart.usn');
     when too_many_rows then
        error_message('Internal error...');
     when others then
       null;
end;



 

上一篇:使用PHP的GD2裁剪 + 缩放图片
下一篇:RMAN的实战篇--备份脚本

相关文章

相关评论