Creating Custom Login Screen In Oracle Forms 10g

发布时间:2017-3-28 10:38:13 编辑: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的实战篇--备份脚本

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

好贷网好贷款