OSDN Git Service

masterジャンプの扱い
authoryamat0jp <terukohietori@gmail.com>
Fri, 10 Jan 2020 02:23:38 +0000 (11:23 +0900)
committeryamat0jp <terukohietori@gmail.com>
Fri, 10 Jan 2020 02:23:38 +0000 (11:23 +0900)
WebModuleUnit1.pas

index 9e28389..0e87f4c 100644 (file)
@@ -840,7 +840,7 @@ procedure TWebModule1.WebModule1loginAction(Sender: TObject;
   Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);
 var
   v: Variant;
-  i: integer;
+  i: Integer;
   s: string;
 begin
   if Request.MethodType = mtGet then
@@ -850,28 +850,26 @@ begin
     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;