zoukankan      html  css  js  c++  java
  • 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;



     

  • 相关阅读:
    [NSURL initFileURLWithPath:]: nil string parameter 错误的解决方案
    Parser Error Message: Could not load type 错误原因
    C# DropDownList做友情链接打开新窗口
    前两天去A公司面试,面试管问的题目一下子闷了。很郁闷。重新答题。在这里分享一下
    获取枚举描述信息(Description)
    生成实体层的界面(webForm1.aspx)代码
    java中Filter 技术
    hdu_1332&poj_1102_LCDisplay
    hdu_1997_汉诺塔VII
    hdu_1134_Game of Connections_卡特兰数列
  • 原文地址:https://www.cnblogs.com/quanweiru/p/6220629.html
Copyright © 2011-2022 走看看