Changeset 139
- Timestamp:
- Sep 9, 2022, 9:41:42 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UWebSession.pas
r138 r139 9 9 10 10 type 11 11 12 { TWebSession } 12 13 … … 25 26 BaseURL: string; 26 27 ModuleManager: TModuleManager; 28 procedure PageNotFound; 27 29 procedure InitDatabase; 28 30 constructor Create; override; … … 38 40 UCore, UModuleSystem, UModuleZdechovNET, UModuleUser, UPageAdmin, UModuleTV, 39 41 UModuleFinance, UModuleNetwork, UModulePortal, UModuleIS, UModuleBase, 40 UModuleNews ;42 UModuleNews, UPageNotFound; 41 43 42 44 resourcestring … … 187 189 end; 188 190 191 procedure TWebSession.PageNotFound; 192 var 193 Page: TPageNotFound; 194 begin 195 Page := TPageNotFound.Create(nil); 196 try 197 if Assigned(Page.OnProduce) then 198 Page.OnProduce(Self); 199 finally 200 Page.Free; 201 end; 202 end; 203 189 204 190 205 end. -
trunk/Modules/Base/UModuleBase.pas
r138 r139 21 21 HandlerData: THTTPHandlerData; 22 22 constructor Create(Owner: TComponent); override; 23 destructor Destroy; override;24 23 procedure Start; override; 25 24 procedure Stop; override; 26 procedure Install; override;27 procedure Uninstall; override;28 procedure Upgrade; override;29 25 property OnGeneratePage: TGeneratePageEvent read FOnGeneratePage write FOnGeneratePage; 30 26 end; … … 47 43 Author := 'Chronosoft'; 48 44 Dependencies.Add('System'); 49 end;50 51 destructor TModuleBase.Destroy;52 begin53 inherited;54 45 end; 55 46 … … 76 67 end; 77 68 78 procedure TModuleBase.Install;79 begin80 inherited Install;81 end;82 83 procedure TModuleBase.Uninstall;84 begin85 inherited Uninstall;86 end;87 88 procedure TModuleBase.Upgrade;89 begin90 inherited Upgrade;91 end;92 93 69 end. 94 70 -
trunk/Modules/Finance/UModuleFinance.pas
r137 r139 4 4 5 5 uses 6 Classes, SysUtils, UModularSystem, UModuleBase, 7 UWebPage; 6 Classes, SysUtils, UModularSystem, UModuleBase, UWebPage; 8 7 9 8 type … … 17 16 ModuleBase: TModuleBase; 18 17 constructor Create(Owner: TComponent); override; 19 destructor Destroy; override;20 18 procedure Start; override; 21 19 procedure Stop; override; 22 20 procedure Install; override; 23 21 procedure Uninstall; override; 24 procedure Upgrade; override;25 22 end; 26 23 … … 42 39 Author := 'Chronosoft'; 43 40 Dependencies.Add('Base'); 44 end;45 46 destructor TModuleFinance.Destroy;47 begin48 inherited;49 41 end; 50 42 … … 163 155 end; 164 156 165 procedure TModuleFinance.Upgrade;166 begin167 inherited;168 end;169 170 157 end. 171 158 -
trunk/Modules/Finance/UPageFinance.pas
r137 r139 12 12 TWebPageFinance = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 public17 { public declarations }18 14 end; 19 15 -
trunk/Modules/Network/UPageNetwork.pas
r137 r139 8 8 type 9 9 TWebPageNetwork = class(TWebPage) 10 private11 { private declarations }12 public13 { public declarations }14 10 end; 15 11 -
trunk/Modules/ZdechovNET/UAboutPage.pas
r138 r139 36 36 begin 37 37 with TWebSession(HandlerData) do begin 38 if Request.Path.Count > 1 then begin 39 PageNotFound; 40 Exit; 41 end; 42 38 43 ModuleUser.LoadUserInfo; 39 44 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UContactPage.pas
r138 r139 12 12 TContactPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; … … 32 30 begin 33 31 with TWebSession(HandlerData), HtmlDocument.Body, SubItems.AddString do begin 32 if Request.Path.Count > 1 then begin 33 PageNotFound; 34 Exit; 35 end; 36 34 37 ModuleUser.LoadUserInfo; 35 38 Text := '<strong>Kontaktní informace</strong><br/>' + -
trunk/Modules/ZdechovNET/UDocumentsPage.pas
r138 r139 12 12 TDocumentsPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; -
trunk/Modules/ZdechovNET/UHistoryPage.pas
r138 r139 13 13 THistoryPage = class(TWebPage) 14 14 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 15 private16 { private declarations }17 15 public 18 16 ModuleUser: TModuleUser; … … 38 36 begin 39 37 with TWebSession(HandlerData) do begin 38 if Request.Path.Count > 1 then begin 39 PageNotFound; 40 Exit; 41 end; 42 40 43 ModuleUser.LoadUserInfo; 41 44 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UHostingPage.pas
r138 r139 13 13 THostingPage = class(TWebPage) 14 14 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 15 private16 { private declarations }17 15 public 18 16 ModuleUser: TModuleUser; … … 38 36 begin 39 37 with TWebSession(HandlerData) do begin 38 if Request.Path.Count > 1 then begin 39 PageNotFound; 40 Exit; 41 end; 42 40 43 ModuleUser.LoadUserInfo; 41 44 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UIPTVPage.pas
r138 r139 88 88 begin 89 89 with TWebSession(HandlerData) do begin 90 if Request.Path.Count > 1 then begin 91 PageNotFound; 92 Exit; 93 end; 94 90 95 ModuleUser.LoadUserInfo; 91 96 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UInternetPage.pas
r138 r139 12 12 TInternetPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; … … 34 32 begin 35 33 with TWebSession(HandlerData) do begin 34 if Request.Path.Count > 1 then begin 35 PageNotFound; 36 Exit; 37 end; 38 36 39 ModuleUser.LoadUserInfo; 37 40 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/ULinksPage.pas
r138 r139 12 12 TLinksPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; … … 34 32 begin 35 33 with TWebSession(HandlerData), HtmlDocument.Body, SubItems.AddString do begin 34 if Request.Path.Count > 1 then begin 35 PageNotFound; 36 Exit; 37 end; 38 36 39 ModuleUser.LoadUserInfo; 37 40 Text := '<strong>Odkazy související s obcí:</strong><br/>' + -
trunk/Modules/ZdechovNET/UNetworkPage.pas
r138 r139 12 12 TNetworkPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; … … 36 34 begin 37 35 with TWebSession(HandlerData) do begin 36 if Request.Path.Count > 1 then begin 37 PageNotFound; 38 Exit; 39 end; 40 38 41 ModuleUser.LoadUserInfo; 39 42 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UPlansPage.pas
r138 r139 13 13 TPlansPage = class(TWebPage) 14 14 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 15 private16 { private declarations }17 15 public 18 16 ModuleUser: TModuleUser; … … 38 36 begin 39 37 with TWebSession(HandlerData) do begin 38 if Request.Path.Count > 1 then begin 39 PageNotFound; 40 Exit; 41 end; 42 40 43 ModuleUser.LoadUserInfo; 41 44 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UProjectsPage.pas
r138 r139 13 13 TProjectsPage = class(TWebPage) 14 14 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 15 private16 { private declarations }17 15 public 18 16 ModuleUser: TModuleUser; … … 38 36 begin 39 37 with TWebSession(HandlerData) do begin 38 if Request.Path.Count > 1 then begin 39 PageNotFound; 40 Exit; 41 end; 42 40 43 ModuleUser.LoadUserInfo; 41 44 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/URobotsPage.pas
r138 r139 36 36 begin 37 37 with TWebSession(HandlerData) do begin 38 if Request.Path.Count > 1 then begin 39 PageNotFound; 40 Exit; 41 end; 42 38 43 ModuleUser.LoadUserInfo; 39 44 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UVoIPPage.pas
r138 r139 12 12 TVoIPPage = class(TWebPage) 13 13 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 14 private15 { private declarations }16 14 public 17 15 ModuleUser: TModuleUser; … … 34 32 begin 35 33 with TWebSession(HandlerData) do begin 34 if Request.Path.Count > 1 then begin 35 PageNotFound; 36 Exit; 37 end; 38 36 39 ModuleUser.LoadUserInfo; 37 40 with HtmlDocument.Body, SubItems.AddString do begin -
trunk/Modules/ZdechovNET/UWebCamPage.pas
r138 r139 53 53 CameraId := -1; 54 54 NotFound := False; 55 if Request.Path.Count >= 2 then begin55 if Request.Path.Count = 2 then begin 56 56 SubPageName := Request.Path[1]; 57 57 if TryStrToInt(SubPageName, Value) then 58 58 CameraId := Value else 59 59 NotFound := True; 60 end ;61 if not NotFound then begin62 //for I := 0 to HandlerData.Request.Query.Count - 1 do63 //Text := Text + HandlerData.Request.Query[I] + ' ';64 65 //HandlerData.Request.Query.Values['W'] := 'dsd';66 //HandlerData.Request.Query.Values['H'] := 'dsd'; 60 end else 61 if Request.Path.Count > 2 then NotFound := True; 62 if NotFound then begin 63 PageNotFound; 64 Exit; 65 end; 66 67 67 if HandlerData.Request.Query.TryGetValue('W', WidthValue) then 68 68 ImageWidth := StrToInt(WidthValue) … … 91 91 92 92 Text := Text + '<br/><strong>Kamery v okolí:</strong><br />' + 93 '<a href="http ://www.mestovsetin.cz/vismo/dokumenty2.asp?id_org=18676&id=480245">Vsetínské kamery</a><br />' +93 '<a href="https://www.mestovsetin.cz/webove%2Dkamery/d-480245">Vsetínské kamery</a><br />' + 94 94 '<a href="https://www.huslenky.cz/webkamery%2Dhuslenky/ds-1119/archiv=0&p1=1020">Kamery v Huslenkách</a><br/>' + 95 '<a href="http ://kamery.hovnet.cz/">Kamery v Hovnetu</a><br/>' +95 '<a href="https://kamery.hovnet.cz/">Kamery v Hovnetu</a><br/>' + 96 96 '</td><td style="width: 80%" valign="top">'; 97 97 … … 101 101 Text := Text + GetSingle(HandlerData, CameraId); 102 102 end; 103 104 103 Text := Text + '</td></tr></table>'; 105 end else Text := 'Stránka nenalezena.';106 104 end; 107 105 GeneratePage(Self); -
trunk/Packages/Common/UFormAbout.pas
r137 r139 20 20 PanelButtons: TPanel; 21 21 procedure ButtonHomePageClick(Sender: TObject); 22 procedure FormCreate(Sender: TObject);23 22 procedure FormShow(Sender: TObject); 24 private25 { private declarations }26 23 public 27 24 AboutDialog: TObject; //TAboutDialog … … 77 74 end; 78 75 79 procedure TFormAbout.FormCreate(Sender: TObject);80 begin81 end;82 83 76 end. 84 77 -
trunk/Packages/Common/UGenerics.pas
r138 r139 43 43 for I := 0 to Count - 1 do begin 44 44 Result := Result + Items[I]; 45 if I > 0then Result := Result + Separator;45 if I < Count - 1 then Result := Result + Separator; 46 46 end; 47 47 end; -
trunk/Packages/CoolWeb/WebServer/UHTTPServer.pas
r138 r139 43 43 44 44 THTTPResponse = class 45 StatusCode: string; 45 46 ContentType: string; 46 47 Content: TMemoryStreamEx; … … 123 124 SPageNotFound = 'Page %s not found.'; 124 125 126 const 127 StatusCodeNotFound = '404 Not Found'; 128 125 129 126 130 implementation … … 134 138 begin 135 139 with HandlerData, Response.Content do begin 136 //Response.Cookies.Values['Test'] := 'Halo';137 //Response.Cookies.Values['Test2'] := 'Halo2';138 139 //HTTPServer.SessionHandler.Variables.Values['Session1'] := 'Value1';140 //HTTPServer.SessionHandler.Variables.Values['Session2'] := 'Value2';141 142 140 WriteString('<a href="?ServerInfo">Refresh</a>'); 143 141 … … 192 190 begin 193 191 with HandlerData, Response.Content do begin 192 Response.StatusCode := StatusCodeNotFound; 194 193 WriteString('<html><body>' + Format(SPageNotFound, [Implode('/', Request.Path)]) + '</body></html>'); 195 194 end; … … 224 223 end else 225 224 with Response.Content do begin 226 //WriteLn(Format(SFileNotFound, [Request.Path.Implode('/', StrToStr)]));225 Response.StatusCode := StatusCodeNotFound; 227 226 WriteString('<html><body>' + Format(SFileNotFound, [Implode('/', Request.Path)]) + '</body></html>'); 228 227 end; … … 248 247 procedure THTTPResponse.Assign(Source: THTTPResponse); 249 248 begin 249 StatusCode := Source.StatusCode; 250 250 Content.Assign(Source.Content); 251 251 ContentType := Source.ContentType; … … 263 263 constructor THTTPResponse.Create; 264 264 begin 265 StatusCode := '200 OK'; 265 266 Content := TMemoryStreamEx.Create; 266 267 Cookies := TCookieList.Create; … … 291 292 begin 292 293 I := 0; 293 while (I < Count) and (TRequestHandler(Items[I]).Name <> AName) do Inc(I); 294 if I < Count then Result := TRequestHandler(Items[I]) else Result := nil; 294 while (I < Count) and (Items[I].Name <> AName) do Inc(I); 295 if I < Count then Result := Items[I] 296 else Result := nil; 295 297 end; 296 298 -
trunk/Packages/CoolWeb/WebServer/UHTTPServerTCP.pas
r138 r139 117 117 118 118 with Response do begin 119 SendString('HTTP/1.0 200 OK'#13#10);119 SendString('HTTP/1.0 ' + StatusCode + #13#10); 120 120 Headers.Add('Content-Length', IntToStr(Content.Size)); 121 121 Headers.Add('Connection', 'close'); -
trunk/Packages/CoolWeb/WebServer/UTurboPowerForm.pas
r137 r139 24 24 procedure AShowSourceExecute(Sender: TObject); 25 25 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 26 private27 { private declarations }28 26 public 29 27 HtmlSource: string; -
trunk/Packages/PersistentData/Demo/UFormMain.pas
r137 r139 20 20 procedure ComboBox1Change(Sender: TObject); 21 21 procedure FormShow(Sender: TObject); 22 private23 { private declarations }24 22 public 25 23 Client: TPDClient; -
trunk/Pages/UPageAdmin.pas
r138 r139 17 17 procedure HandleInstall(HandlerData: THTTPHandlerData); 18 18 procedure HandleUninstall(HandlerData: THTTPHandlerData); 19 public20 { public declarations }21 19 end; 22 20 -
trunk/UCore.pas
r137 r139 14 14 15 15 type 16 16 17 { TCore } 17 18 -
trunk/ZdechovNET.lpi
r138 r139 118 118 </Item6> 119 119 </RequiredPackages> 120 <Units Count="4 0">120 <Units Count="41"> 121 121 <Unit0> 122 122 <Filename Value="ZdechovNET.lpr"/> … … 135 135 <IsPartOfProject Value="True"/> 136 136 <ComponentName Value="ServerInfoPage"/> 137 <HasResources Value="True"/> 137 138 <ResourceBaseClass Value="DataModule"/> 138 139 </Unit3> … … 339 340 <ResourceBaseClass Value="DataModule"/> 340 341 </Unit39> 342 <Unit40> 343 <Filename Value="Pages/UPageNotFound.pas"/> 344 <IsPartOfProject Value="True"/> 345 <ComponentName Value="PageNotFound"/> 346 <ResourceBaseClass Value="DataModule"/> 347 </Unit40> 341 348 </Units> 342 349 </ProjectOptions>
Note:
See TracChangeset
for help on using the changeset viewer.