Example: Client/server login dialog |
This example describes a case where a Client/Server startup login dialog is required to authenticate the USoft application user. In this example, the user is a funneling account that only exists in USoft; there is no database account for that user. The USoft application uses a single RDBMS funnel account to serve all its funneling users.
This login dialog is the result of specifying a WindowsCreate action in the Windows Designer, when defining this application, for example: WindowCreate(My Login Dialog)
The default username is retrieved using: RulesEngine.GetProperty('OSUSERNAME')
The assignment takes place on the Username field, in the behavior tab Post-create property specified as: Variables.Username(RulesEngine.GetProperty('OSUSERNAME'))
The action on the OK button executes the Rules Engine SetUser method but avoids readable password echoes by making sure that error messages are not generated: ActionDecision( StartCatchingErrors ) ActionDecision( SetUser, Variables.Username(), Variables.Password() ) ActionDecision( StopCatchingErrors ) ActionDecision( GetLastCaughtErrors )
If the user name does not exist or is not associated with the application, a message is shown about the credentials being invalid.
ActionDoNothing()
SELECT RulesEngine.SetUser(':1', ':2', '')
ActionDoNothing()
ActionDoNothing()
SELECT RulesEngine.GetLastCaughtErrors()
MessageInformation( :1 )
ActionDoNothing()
If the user group changes, the application property "After Usergroup Changed" fires. This allows user group-specific actions like opening a window or catalog. If the user group changes, the First Menu Page specified for the new user group become active. The After SetUser behavior property fires. This allows user-specific actions to be programmed.
See Also |