mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
In TempaltePro Templates there is a variable "LoggedUserName" which is always aligned to Context.LoggedUser.UserName
Some checks failed
TOC Generator / TOC Generator (push) Has been cancelled
Some checks failed
TOC Generator / TOC Generator (push) Has been cancelled
This commit is contained in:
parent
c199449ad5
commit
dfd80def94
@ -180,6 +180,7 @@ begin
|
||||
begin
|
||||
lCompiledTemplate.SetData(lPair.Key, ViewModel[lPair.Key]);
|
||||
end;
|
||||
lCompiledTemplate.SetData('LoggedUserName', WebContext.LoggedUser.UserName);
|
||||
end;
|
||||
lCompiledTemplate.AddFilter('json', DumpAsJSONString);
|
||||
lCompiledTemplate.AddFilter('count', GetDataSetOrObjectListCount);
|
||||
|
@ -513,11 +513,11 @@ type
|
||||
FCustomData: TMVCCustomData;
|
||||
procedure SetLoggedSince(const AValue: TDateTime);
|
||||
procedure SetCustomData(const Value: TMVCCustomData);
|
||||
function GetIsValid: Boolean;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
|
||||
function IsValid: Boolean;
|
||||
procedure Clear;
|
||||
|
||||
procedure SaveToSession(const AWebSession: TMVCWebSession);
|
||||
@ -528,6 +528,7 @@ type
|
||||
property LoggedSince: TDateTime read FLoggedSince write SetLoggedSince;
|
||||
property Realm: string read FRealm write FRealm;
|
||||
property CustomData: TMVCCustomData read FCustomData write SetCustomData;
|
||||
property IsValid: Boolean read GetIsValid;
|
||||
end;
|
||||
|
||||
TWebContext = class
|
||||
@ -2131,7 +2132,7 @@ begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TUser.IsValid: Boolean;
|
||||
function TUser.GetIsValid: Boolean;
|
||||
begin
|
||||
Result := (not UserName.IsEmpty) and (LoggedSince > 0);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user