Telegram_2018-05-18T06

<< Click to Display Table of Contents >>

Navigation:  Telegram > 2018 > 05 > 18 >

Telegram_2018-05-18T06

Telegram link

 

2018-05-18T06:12:54

 

What is the best way to redirect to a web URL and quit an IW application when a user clicks a Logout button?

 


 

Telegram link

 

2018-05-18T06:21:56

 

procedure TIWForm1.IWButton_LogoutClick(Sender: TObject);

 

begin

 

Release;

 

WebApplication.TerminateAndRedirect( ' type: link https://jnp.com.br ' );

 

end;

 


 

Telegram link

 

2018-05-18T06:23:45

 

OK, I'll try that. Thanks.

 


 

Telegram link

 

2018-05-18T06:27:22

 

Yes, That worked perfect! Thanks!

 


 

Telegram link

 

2018-05-18T06:28:38

 

About your question:

 

\Also, is there a way to eliminate the /$ type: bot_command /start at the end of the URL to get the initial web page to appear.\

 


 

Telegram link

 

2018-05-18T06:28:53

 

Yes, there are.

 


 

Telegram link

 

2018-05-18T06:29:12

 

You have a type: bold Login page?

 


 

Telegram link

 

2018-05-18T06:41:06

 

Yes I do

 


 

Telegram link

 

2018-05-18T06:43:17

 

at the end of this form you set ?;

 

type: bold initialization

 

TIWForm_Login.SetAsMainForm;

 


 

Telegram link

 

2018-05-18T06:44:33

 

It already there. It looks like this:

 


 

Telegram link

 

2018-05-18T06:44:35

 

initialization

 

TfrmMain.SetAsMainForm;

 


 

Telegram link

 

2018-05-18T06:44:41

 

great

 


 

Telegram link

 

2018-05-18T06:45:05

 

So if I call the URL without /$ it will already work?

 


 

Telegram link

 

2018-05-18T06:45:13

 

Now, in servercontroller:

 


 

Telegram link

 

2018-05-18T06:45:22

 

type: bold initialization

 

TIWServerController.SetServerControllerClass;

 

with THandlers.Add('', 'login.html', TContentForm.Create( TfrmMain )) do begin

 

CanStartSession := True;

 

RequiresSessionStart := False;

 

end;

 


 

Telegram link

 

2018-05-18T06:45:49

 

add type: bold with tHandlers at the end

 


 

Telegram link

 

2018-05-18T06:46:23

 

after that you can type: bot_command /login type: bold .html to start a session

 


 

Telegram link

 

2018-05-18T06:50:12

 

So what you are saying is on the IWserverController OnCreate event. add the code above.

 


 

Telegram link

 

2018-05-18T06:50:17

 

procedure TIWServerController.IWServerControllerBaseCreate(Sender: TObject);

 

begin

 

with THandlers.Add('', 'login.html', TContentForm.Create( TfrmMain )) do begin

 

CanStartSession := True;

 

RequiresSessionStart := False;

 

end;

 

end;

 


 

Telegram link

 

2018-05-18T06:50:26

 

Like that?

 


 

Telegram link

 

2018-05-18T06:51:32

 

No, put at the end of servercontroller, like frmmain

 


 

Telegram link

 

2018-05-18T06:52:14

 

after type: bold initialization

 


 

Telegram link

 

2018-05-18T06:52:17

 

OK, this was already in there

 


 

Telegram link

 

2018-05-18T06:52:18

 

initialization

 

TIWServerController.SetServerControllerClass;

 


 

Telegram link

 

2018-05-18T06:52:44

 

ok, now ADD after that;

 

with THandlers.Add('', 'login.html', TContentForm.Create( TfrmMain )) do begin

 

CanStartSession := True;

 

RequiresSessionStart := False;

 

end;

 


 

Telegram link

 

2018-05-18T06:53:28

 

OK, so now I have this:

 


 

Telegram link

 

2018-05-18T06:53:29

 

initialization

 

TIWServerController.SetServerControllerClass;

 

with THandlers.Add('', 'login.html', TContentForm.Create( TfrmMain )) do begin

 

CanStartSession := True;

 

RequiresSessionStart := False;

 

end;

 


 

Telegram link

 

2018-05-18T06:53:32

 

Yes

 


 

Telegram link

 

2018-05-18T06:54:25

 

So I have an undeclared identifier THandlers for my 1st compile error. Do I need some more in the Uses section?

 


 

Telegram link

 

2018-05-18T06:54:55

 

miss a uses, 1 min

 


 

Telegram link

 

2018-05-18T06:55:46

 

USES

 

IW.Content.Handlers, IW.Content.Form

 


 

Telegram link

 

2018-05-18T06:56:37

 

OK, so I will have to also add the TfrmMain, correct?

 


 

Telegram link

 

2018-05-18T06:56:51

 

Yes

 


 

Telegram link

 

2018-05-18T06:58:07

 

OK, it compiles. You also mentioned \add with tHandlers at the end\