Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
var
v: Variant;
- i: integer;
+ i: Integer;
s: string;
begin
if Request.MethodType = mtGet then
Exit;
end;
s := Request.ContentFields.Values['record'];
- if s = 'master' then
- Response.SendRedirect('master')
- else
+ v := DataModule1.FDTable1.Lookup('database', s, 'dbnum');
+ if VarIsNull(v) = false then
begin
- v := DataModule1.FDTable1.Lookup('database', s, 'dbnum');
- if VarIsNull(v) = false then
- begin
- with Response.Cookies.Add do
- begin
- Name := 'user';
- Value := hash(Request.ContentFields.Values['password']);
- Expires := Now + 14;
- // Secure := true;
- end;
- i:=v;
- Response.SendRedirect('/admin?db=' + i.ToString);
- end
- else
+ with Response.Cookies.Add do
begin
- Response.ContentType := 'text/html;charset=utf-8';
- Response.Content := login.Content;
+ Name := 'user';
+ Value := hash(Request.ContentFields.Values['password']);
+ Expires := Now + 14;
+ // Secure := true;
end;
+ i := v;
+ if s = 'master' then
+ Response.SendRedirect('/master')
+ else
+ Response.SendRedirect('/admin?db=' + i.ToString);
+ end
+ else
+ begin
+ Response.ContentType := 'text/html;charset=utf-8';
+ Response.Content := login.Content;
end;
end;