Volk65 Posted February 22, 2018 Share Posted February 22, 2018 Hi all! How it works now:1. You are prompted with a login form2. User cookies are read3. The login password fields are filled in4. The user clicks on "OK"5. There is a check in the database6. If all is well, then Modalresult=mrOKIs this possible(?):1. Cookies are read before the login window is displayed2. If url parameters were passed at startup (UniApplication.Parameters), it checks the user in DB with his / her cookies.3. If the check does not pass (for example, cookies are not saved), the login window is displayed.4. But, if the check user in DB = OK, the LOGIN WINDOW is NEVER DISPLAYED and opened from the MainformI was able to check the user and close the window. I used the "onaftershow" event. BUT, login window displays 0.5 seconds, after which the main window opens. But I want the login window never to be displayed. If the parameters have been passed and the user verification has passed. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2018 Share Posted February 22, 2018 Hi, You can use MainModule -> OnBeforeLogin event for this Look at this demo example: \FMSoft\Framework\uniGUI\Demos\Desktop\LoginForm Cookies Best regards, Quote Link to comment Share on other sites More sharing options...
Volk65 Posted February 22, 2018 Author Share Posted February 22, 2018 Hi One small problem in MainModule - no property access Cookies: PS: implementation {$R *.dfm} uses uniGUIApplication, UniGUIVars, ServerModule, UType, Variants, uni_Data_Module, UProc, XCrypt2, UniGUIForm; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 22, 2018 Share Posted February 22, 2018 Have you seen the demo ? procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); var S1, S2 : string; begin S1 := (Sender as TUniGUISession).UniApplication.Cookies.Values['_loginname']; S2 := (Sender as TUniGUISession).UniApplication.Cookies.Values['_pwd']; Handled := SameText(S1, 'demo') and SameText(S2, 'demo'); if Handled then LoggedUser := S1; end; Quote Link to comment Share on other sites More sharing options...
Volk65 Posted February 22, 2018 Author Share Posted February 22, 2018 A thousand apologies. It work. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.