Alexandre Trevizoli Posted July 23, 2019 Share Posted July 23, 2019 Hi. I need to open an form with IMAGE when I call a specific URL.... example: http://localhost:8077/qrcode?code=20982109480129 In this case I don't need to open Login form (that have on application), I need only to open an form called fmQrCode (TunimForm). and when user close this form, close session. Thanks Quote Link to comment Share on other sites More sharing options...
neo4a Posted July 24, 2019 Share Posted July 24, 2019 Maybe you can adapt my approach to your needs (simplified procedure): procedure TUniMainModule.UniGUIMainModuleBeforeLogin(Sender: TObject; var Handled: Boolean); var aApp : TUniGUIApplication; aBLIEwin : string; begin Handled := false; try aApp := (Sender as TUniGUISession).UniApplication; aBLIEwin := aApp.Parameters.Values['BLIEWIN']; if not aBLIEwin.IsEmpty then begin if not Assigned(FdmUser) then FdmUser := TdmUser.Create(self); Handled := FdmUser.CheckLogin(aBLIEwin, FAutoStartAction); end; finally FIsLogin := Handled; end; end; This link http://localhost:8077/m?BLIEWI=param will bypass login form and in App.MainForm: procedure TMainForm.UniFormShow(Sender: TObject); var aAction : TAction; begin aAction := UniMainModule.AutoStartAction; if Assigned(aAction) then begin UniMainModule.AutoStartAction := nil; ModuleExecute(aAction); end; end; HTH. 2 Quote Link to comment Share on other sites More sharing options...
Alexandre Trevizoli Posted July 25, 2019 Author Share Posted July 25, 2019 Hi Neo4. Thanks for your answer. on UniGUIMainModuleBeforeLogin, I could use fmQRCODE.showmodal? How can I get URL information inside this event? I can get this information on UniGUIServerModuleHTTPCommand through ARequestInfo object. Could I force ServerModule to open new session and instead of open Login form, open an desired form? I guess it's should be possible. Thanks Quote Link to comment Share on other sites More sharing options...
neo4a Posted July 29, 2019 Share Posted July 29, 2019 Quote on UniGUIMainModuleBeforeLogin, I could use fmQRCODE.showmodal? Following my sample you would do it in TMainForm.UniFormShow(Sender: TObject) by AutoStartAction Quote How can I get URL information inside this event? I can get this information on UniGUIServerModuleHTTPCommand through ARequestInfo object. aApp := (Sender as TUniGUISession).UniApplication; aBLIEwin := aApp.Parameters.Values['BLIEWIN']; In my sample BLIEWIN is parameter name, so by URL of http://localhost:8077/m?BLIEWIN=param variable aBLIEWIN contains "param". At this point you can decide, wether to show a login form or not by setting procedure var Handled HTH. Quote Link to comment Share on other sites More sharing options...
stf Posted September 3, 2021 Share Posted September 3, 2021 Thank you very much! (y) 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.