source: trunk/Modules/ZdechovNET/RobotsPage.pas

Last change on this file was 151, checked in by chronos, 9 months ago
File size: 987 bytes
Line 
1unit RobotsPage;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, WebPage, HTTPServer, HtmlClasses, ModuleUser;
7
8type
9
10 { TRobotsPage }
11
12 TRobotsPage = class(TWebPage)
13 procedure DataModuleProduce(HandlerData: THTTPHandlerData);
14 end;
15
16var
17 RobotsPage: TRobotsPage;
18
19
20implementation
21
22{$R *.lfm}
23
24uses
25 Core, Utils, WebSession, SqlDatabase;
26
27{ TRobotsPage }
28
29procedure TRobotsPage.DataModuleProduce(HandlerData: THTTPHandlerData);
30var
31 TextBlock: THtmlString;
32 DbRows: TDbRows;
33 I: Integer;
34 ModuleUser: TModuleUser;
35begin
36 with TWebSession(HandlerData) do begin
37 ModuleUser := TModuleUser(ModuleManager.FindModuleByName('User'));
38 if Request.Path.Count > 1 then begin
39 PageNotFound;
40 Exit;
41 end;
42
43 ModuleUser.LoadUserInfo;
44 with HtmlDocument.Body, SubItems.AddString do begin
45 Text := 'User-agent: *' + LineEnding +
46 'Disallow: /*?';
47 //'Sitemap: ' + AbsoluteLink('/sitemap.xml');
48 end;
49 GeneratePage(Self);
50 end;
51end;
52
53end.
54
Note: See TracBrowser for help on using the repository browser.