2013-10-29 16:51:16 +01:00
|
|
|
unit CallbackControllerU;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
MVCFramework,
|
|
|
|
MVCFramework.Logger;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
[MVCPath('/')]
|
|
|
|
TCallbackController = class(TMVCController)
|
|
|
|
public
|
|
|
|
[MVCPath('/login/($username)')]
|
|
|
|
// this is only for test!!!!
|
|
|
|
procedure Login(CTX: TWebContext);
|
|
|
|
|
|
|
|
[MVCPath('/logout')]
|
|
|
|
// this is only for test!!!!
|
|
|
|
procedure Logout(CTX: TWebContext);
|
|
|
|
|
|
|
|
[MVCPath('/')]
|
|
|
|
procedure Index(CTX: TWebContext);
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
uses
|
|
|
|
system.ioutils,
|
|
|
|
system.Classes,
|
|
|
|
system.SysUtils,
|
|
|
|
system.Types;
|
|
|
|
|
|
|
|
{ TCallbackController }
|
|
|
|
|
|
|
|
procedure TCallbackController.Index(CTX: TWebContext);
|
|
|
|
begin
|
|
|
|
Redirect('/callbackdemo.html');
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TCallbackController.Login(CTX: TWebContext);
|
|
|
|
begin
|
2016-05-03 19:04:24 +02:00
|
|
|
CTX.Session['username'] := CTX.Request.Params['username'];
|
2013-10-29 16:51:16 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TCallbackController.Logout(CTX: TWebContext);
|
|
|
|
begin
|
2016-05-03 19:04:24 +02:00
|
|
|
CTX.SessionStop(false);
|
2013-10-29 16:51:16 +01:00
|
|
|
end;
|
|
|
|
|
|
|
|
end.
|