Module login.wo
1Use cWebBusinessProcess.pkg
2Use DataDict.pkg
3Use Users.DD
4
5Object oLoginUsers is a cWebBusinessProcess
6 Set pbAllowClear to False
7 Set pbAllowDelete to False
8 Set pbAllowFind to False
9 Set pbAllowSaveEdit to False
10 Set pbAllowSaveNew to False
11 Set psDescription to "Login System for Order entry"
12
13 Object oUsers_DD is a Users_DataDictionary
14 Send DefineAllExtendedFields
15 End_Object // oUsers_DD
16
17 Set Main_DD to oUsers_DD
18
19 // This is the main login function.
20 // pass userid and password. If login is ok, return a non zero value
21 // with the current login record in the Login DD file.
22 // This will be called by the ASP file using DfFunc.
23 { Published = True }
24 { Description = "" }
25 Function Login_User String sUserId String sPass Returns Integer
26 Integer bOk
27
28 // clear Login DD, Move values to file buffer and
29 // attempt a find EQ
30 Get ddClear "Users" To bOk
31 Send setDDValue "Users.loginName" (Uppercase(sUserid))
32 Send setDDValue "Users.password" (Uppercase(sPass))
33 Get ddFind "Users" 2 Eq To bOk
34
35 Function_Return bOK
36 End_Function
37
38End_Object // oLoginUsers
39