Changeset 78
- Timestamp:
- Jun 18, 2012, 10:44:21 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/UMainModule.lfm
r77 r78 2 2 OldCreateOrder = False 3 3 Height = 278 4 HorizontalOffset = 4185 VerticalOffset = 2 054 HorizontalOffset = 554 5 VerticalOffset = 266 6 6 Width = 431 7 object HTTPSessionStorageMySQL1: THTTPSessionStorageMySQL8 Database = Database9 Timeout = 1080010 SessionIdCookieName = 'SessionId'11 left = 30412 top = 3213 end14 object Database: TSqlDatabase15 Connected = False16 Port = 330617 Encoding = 'utf8'18 left = 8119 top = 8620 end21 7 object WebApp1: TWebApp 22 8 OnPageProduce = WebApp1PageProduce 23 ServerType = st TCP9 ServerType = stCGI 24 10 left = 160 25 11 top = 88 -
trunk/Modules/UMainModule.lrs
r77 r78 3 3 LazarusResources.Add('TMainModule','FORMDATA',[ 4 4 'TPF0'#11'TMainModule'#10'MainModule'#14'OldCreateOrder'#8#6'Height'#3#22#1#16 5 +'HorizontalOffset'#3#162#1#14'VerticalOffset'#3#205#0#5'Width'#3#175#1#0#24 6 +'THTTPSessionStorageMySQL'#24'HTTPSessionStorageMySQL1'#8'Database'#7#8'Data' 7 +'base'#7'Timeout'#3'0*'#19'SessionIdCookieName'#6#9'SessionId'#4'left'#3'0'#1 8 +#3'top'#2' '#0#0#12'TSqlDatabase'#8'Database'#9'Connected'#8#4'Port'#3#234#12 9 +#8'Encoding'#6#4'utf8'#4'left'#2'Q'#3'top'#2'V'#0#0#7'TWebApp'#7'WebApp1'#13 10 +'OnPageProduce'#7#18'WebApp1PageProduce'#10'ServerType'#7#5'stTCP'#4'left'#3 11 +#160#0#3'top'#2'X'#0#0#0 5 +'HorizontalOffset'#3'*'#2#14'VerticalOffset'#3#10#1#5'Width'#3#175#1#0#7'TWe' 6 +'bApp'#7'WebApp1'#13'OnPageProduce'#7#18'WebApp1PageProduce'#10'ServerType'#7 7 +#5'stCGI'#4'left'#3#160#0#3'top'#2'X'#0#0#0 12 8 ]); -
trunk/Modules/UMainModule.pas
r77 r78 15 15 16 16 type 17 TSession = class 18 17 TMainModule = class; 18 19 { TWebSession } 20 21 TWebSession = class(THTTPHandlerData) 22 private 23 procedure TopMenu; 24 procedure Footer; 25 public 26 MainModule: TMainModule; 27 Database: TSqlDatabase; 28 SessionStorage: THTTPSessionStorageMySQL; 29 User: TWebUser; 30 UserOnline: TWebOnlineUser; 31 HtmlDocument: THtmlDocument; 32 GlobalTitle: string; 33 TimeStart: TDateTime; 34 procedure LoadUserInfo; 35 procedure InitDatabase; 36 procedure GeneratePage(Page: TWebPage); 37 constructor Create; override; 38 destructor Destroy; override; 19 39 end; 20 40 … … 22 42 23 43 TMainModule = class(TDataModule) 24 HTTPSessionStorageMySQL1: THTTPSessionStorageMySQL;25 Database: TSqlDatabase;26 44 WebApp1: TWebApp; 27 45 procedure WebApp1PageProduce(HandlerData: THTTPHandlerData); 28 46 private 29 procedure Footer;30 procedure InitDatabase;31 47 procedure Show(Content: string); 32 procedure TopMenu;33 48 public 34 TimeStart: TDateTime;35 49 Load: string; 36 50 Unload: string; 37 GlobalTitle: string;38 51 ShowRuntimeInfo: Boolean; 39 52 Charset: string; 40 53 Admin: string; 41 54 AdminEmail: string; 55 Keywords: string; 42 56 Style: string; 43 Keywords: string;44 HtmlDocument: THtmlDocument;45 57 BaseURL: string; 46 User: TWebUser;47 UserOnline: TWebOnlineUser;48 58 FormatHTML: Boolean; 49 59 NetworkAddress: string; … … 51 61 MaxConnections: Integer; 52 62 Pages: TPageList; 53 procedure LoadUserInfo(HandlerData: THTTPHandlerData); 63 DatabaseHostname: string; 64 DatabaseUserName: string; 65 DatabasePassword: string; 66 DatabaseSchema: string; 54 67 procedure LoadFromRegistry; 55 68 procedure SaveToRegistry; 56 procedure GeneratePage(HandlerData: THTTPHandlerData; Page: TWebPage);57 69 procedure Run; 58 70 constructor Create(AOwner: TComponent); override; … … 71 83 UNetworkPage, UAboutPage, UContactPage; 72 84 73 { TMainModule } 74 75 procedure TMainModule.GeneratePage(HandlerData: THTTPHandlerData; Page: TWebPage); 85 { TWebSession } 86 87 constructor TWebSession.Create; 88 begin 89 inherited; 90 Database := TSqlDatabase.Create(nil); 91 SessionStorage := THTTPSessionStorageMySQL.Create(nil); 92 SessionStorage.Database := Database; 93 HtmlDocument := THtmlDocument.Create; 94 User := TWebUser.Create; 95 User.Database := Database; 96 UserOnline := TWebOnlineUser.Create; 97 UserOnline.Database := Database; 98 end; 99 100 destructor TWebSession.Destroy; 101 begin 102 HtmlDocument.Free; 103 User.Free; 104 UserOnline.Free; 105 SessionStorage.Free; 106 Database.Free; 107 inherited Destroy; 108 end; 109 110 procedure TWebSession.InitDatabase; 111 var 112 DbRows: TDbRows; 113 begin 114 with Database do begin 115 Connect; 116 end; 117 try 118 DbRows := TDbRows.Create; 119 Database.Query(DbRows, 'SET NAMES utf8'); 120 finally 121 DbRows.Free; 122 end; 123 end; 124 125 procedure TWebSession.LoadUserInfo; 126 begin 127 User.HandlerData := Self; 128 UserOnline.HandlerData := Self; 129 UserOnline.Update; 130 User.Id := UserOnline.User; 131 User.Load; 132 end; 133 134 procedure TWebSession.GeneratePage(Page: TWebPage); 76 135 var 77 136 I: Integer; 78 137 TitleTag: THtmlString; 79 138 begin 80 with HandlerData do begin81 139 HtmlDocument.ContentLanguage := 'cs'; 82 140 GlobalTitle := 'ZděchovNET'; 83 HtmlDocument.Styles.Add(NavigationLink('/Style/' + Style + '/Style.css'));84 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + Style + '/Global.js'));85 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + Style + '/jquery.js'));141 HtmlDocument.Styles.Add(NavigationLink('/Style/' + MainModule.Style + '/Style.css')); 142 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + MainModule.Style + '/Global.js')); 143 HtmlDocument.Scripts.Add(NavigationLink('/Style/' + MainModule.Style + '/jquery.js')); 86 144 87 145 TitleTag := THtmlString.Create; … … 95 153 with HtmlDocument.AsXmlDocument do 96 154 try 97 Formated := FormatHTML;155 Formated := MainModule.FormatHTML; 98 156 Response.Content.WriteString(AsString); 99 157 finally 100 158 Free; 101 159 end; 102 end; 103 end; 104 105 procedure TMainModule.InitDatabase; 106 var 107 DbRows: TDbRows; 108 begin 109 with Database do begin 110 Connect; 111 end; 112 try 113 DbRows := TDbRows.Create; 114 Database.Query(DbRows, 'SET NAMES utf8'); 115 finally 116 DbRows.Free; 117 end; 118 end; 160 end; 161 162 163 { TMainModule } 119 164 120 165 constructor TMainModule.Create(AOwner: TComponent); … … 122 167 inherited; 123 168 Pages := TPageList.Create; 124 HtmlDocument := THtmlDocument.Create;125 User := TWebUser.Create;126 User.Database := Database;127 UserOnline := TWebOnlineUser.Create;128 UserOnline.Database := Database;129 169 LoadFromRegistry; 130 170 with Pages do begin … … 156 196 begin 157 197 //SaveToRegistry; 158 HtmlDocument.Free;159 User.Free;160 UserOnline.Free;161 198 Pages.Free; 162 199 inherited Destroy; 163 200 end; 164 201 165 procedure T MainModule.Footer;202 procedure TWebSession.Footer; 166 203 var 167 204 Tag: TXMLTag; … … 178 215 Name := 'li'; 179 216 with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin 180 Text := Admin;217 Text := MainModule.Admin; 181 218 end; 182 219 end; … … 184 221 Name := 'li'; 185 222 with TXmlString(SubElements.AddNew(TXmlString.Create)) do begin 186 Text := AdminEmail;187 end; 188 end; 189 if ShowRuntimeInfo then begin223 Text := MainModule.AdminEmail; 224 end; 225 end; 226 if MainModule.ShowRuntimeInfo then begin 190 227 with TXmlTag(SubElements.AddNew(TXmlTag.Create)) do begin 191 228 Name := 'li'; … … 232 269 end; 233 270 234 procedure T MainModule.TopMenu;271 procedure TWebSession.TopMenu; 235 272 begin 236 273 with THtmlString(HtmlDocument.Body.SubItems.InsertNew(1, THtmlString.Create)) do begin … … 269 306 end; 270 307 271 procedure TMainModule.LoadUserInfo(HandlerData: THTTPHandlerData);272 begin273 User.HandlerData := HandlerData;274 UserOnline.HandlerData := HandlerData;275 UserOnline.Update;276 User.Id := UserOnline.User;277 User.Load;278 end;279 280 308 procedure TMainModule.WebApp1PageProduce(HandlerData: THTTPHandlerData); 281 309 var 282 310 FileName: string; 311 PageName: string; 312 Page: TRegistredPage; 313 NewSession: TWebSession; 314 BaseUrlParts: TListString; 283 315 begin 284 316 with HandlerData do begin 285 if not Pages.ProducePage(HandlerData) then begin 317 try 318 BaseUrlParts := TListString.Create; 319 BaseUrlParts.Explode(BaseURL, '/', StrToStr); 320 while (BaseUrlParts.Count > 0) and (Request.Path.Count > 0) and 321 (BaseUrlParts[0] = Request.Path[0]) do begin 322 BaseUrlParts.Delete(0); 323 Request.Path.Delete(0); 324 end; 325 finally 326 BaseUrlParts.Free; 327 end; 328 if Request.Path.Count > 0 then PageName := Request.Path[0] 329 else PageName := ''; 330 Page := Pages.FindByName(PageName); 331 if Assigned(Page) then begin 332 NewSession := TWebSession.Create; 333 NewSession.MainModule := Self; 334 NewSession.Assign(HandlerData); 335 NewSession.TimeStart := Now; 336 NewSession.Database.HostName := DatabaseHostName; 337 NewSession.Database.Password := DatabasePassword; 338 NewSession.Database.Database := DatabaseSchema; 339 NewSession.Database.UserName := DatabaseUserName; 340 NewSession.InitDatabase; 341 Page.Page.OnProduce(NewSession); 342 HandlerData.Assign(NewSession); 343 end else begin 286 344 WebApp1.HTTPServer.FileResponse(HandlerData) 287 345 end; … … 301 359 Style := ReadString(SectionGeneral, 'Style', 'Basic'); 302 360 BaseURL := ReadString(SectionGeneral, 'BaseURL', 'http://localhost'); 303 Database .Hostname := ReadString(SectionDatabase, 'DatabaseHostName', 'localhost');304 Database .Database:= ReadString(SectionDatabase, 'DatabaseDatabase', 'web');305 Database .UserName := ReadString(SectionDatabase, 'DatabaseUserName', 'user');306 Database .Password := ReadString(SectionDatabase, 'DatabasePassword', 'password');361 DatabaseHostname := ReadString(SectionDatabase, 'DatabaseHostName', 'localhost'); 362 DatabaseSchema := ReadString(SectionDatabase, 'DatabaseDatabase', 'web'); 363 DatabaseUserName := ReadString(SectionDatabase, 'DatabaseUserName', 'user'); 364 DatabasePassword := ReadString(SectionDatabase, 'DatabasePassword', 'password'); 307 365 FormatHTML := ReadBool(SectionGeneral, 'FormatHTML', False); 308 366 //MainModule.WebApp1.LogException := not ReadBool(SectionGeneral, 'ShowException', False); … … 327 385 WriteString(SectionGeneral, 'Style', Style); 328 386 WriteString(SectionGeneral, 'BaseURL', BaseURL); 329 WriteString(SectionDatabase, 'DatabaseHostName', Database .Hostname);330 WriteString(SectionDatabase, 'DatabaseDatabase', Database .Database);331 WriteString(SectionDatabase, 'DatabaseUserName', Database .UserName);332 WriteString(SectionDatabase, 'DatabasePassword', Database .Password);387 WriteString(SectionDatabase, 'DatabaseHostName', DatabaseHostname); 388 WriteString(SectionDatabase, 'DatabaseDatabase', DatabaseSchema); 389 WriteString(SectionDatabase, 'DatabaseUserName', DatabaseUserName); 390 WriteString(SectionDatabase, 'DatabasePassword', DatabasePassword); 333 391 WriteBool(SectionGeneral, 'FormatHTML', FormatHTML); 334 392 //WriteBool(SectionGeneral, 'ShowException', not MainModule.WebApp1.LogException); … … 343 401 procedure TMainModule.Run; 344 402 begin 345 InitDatabase; 346 //Database.Query('SELECT * FROM ssss'); 347 403 WebApp1.HTTPServer.DocumentRoot := ExtractFileDir(ParamStrUTF8(0)); 348 404 WebApp1.Run; 349 405 end; -
trunk/Pages/UAboutPage.pas
r77 r78 36 36 TextBlock: THtmlString; 37 37 begin 38 with MainModuledo begin39 LoadUserInfo (HandlerData);38 with TWebSession(HandlerData) do begin 39 LoadUserInfo; 40 40 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 41 41 Text := '<img align="left" src="' + NavigationLink('/images/umisteni.gif') + '" alt="Umístění obce"/>' + … … 80 80 '<i>Aktualizováno: 21.1.2011</i>'; 81 81 end; 82 GeneratePage(Self); 82 83 end; 83 MainModule.GeneratePage(HandlerData, Self);84 84 end; 85 85 -
trunk/Pages/UContactPage.pas
r77 r78 32 32 procedure TContactPage.DataModuleProduce(HandlerData: THTTPHandlerData); 33 33 begin 34 with MainModule, HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin35 LoadUserInfo (HandlerData);34 with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 35 LoadUserInfo; 36 36 Text := '<strong>Kontaktní informace</strong><br/>' + 37 'Provozovatel: Ing. Jiří Hajda<br/>' +38 'Adresa: Zděchov 208, 75607<br/>' +39 'Telefon: 737785792<br/>' +37 'Provozovatel: <strong>Ing. Jiří Hajda</strong><br/>' + 38 'Adresa: <strong>Zděchov 208, 75607</strong><br/>' + 39 'Telefon: <strong>737785792</strong><br/>' + 40 40 'E-mail: <a href="mailto: robie@centrum.cz">robie@centrum.cz</a><br/>' + 41 'Jabber: chronos@jabbim.cz<br/>' +41 'Jabber: <strong>chronos@jabbim.cz</strong><br/>' + 42 42 'ICQ: <a href="http://www.icq.com/people/277158770">277158770</a><br/>' + 43 'IČ: 75904535<br/>' + 44 'DIČ: CZ8303255884<br/>' + 45 'Bankovní spojení pro platby v CZK v ČR: 2600134781 / 2010' + 46 'Bankovní spojení pro platby v EUR v SR: 2600134781 / 8330' + 47 'Starý bankovní účet: 218098370 / 0300<br/>'; 43 'IČ: <strong>75904535</strong><br/>' + 44 'DIČ: <strong>CZ8303255884</strong><br/>' + 45 'Bankovní spojení pro platby v CZK v ČR: <strong>2600134781 / 2010</strong><br/>' + 46 'Bankovní spojení pro platby v EUR v SR: <strong>2600134781 / 8330</strong><br/>' + 47 'Starý bankovní účet: <strong>218098370 / 0300</strong><br/>'; 48 GeneratePage(Self); 48 49 end; 49 MainModule.GeneratePage(HandlerData, Self);50 50 end; 51 51 -
trunk/Pages/UDocumentsPage.pas
r77 r78 34 34 procedure TDocumentsPage.DataModuleProduce(HandlerData: THTTPHandlerData); 35 35 begin 36 with MainModuledo begin37 LoadUserInfo (HandlerData);36 with TWebSession(HandlerData) do begin 37 LoadUserInfo; 38 38 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 39 39 Text := '<strong>O obci:</strong><br/>' + … … 52 52 IconedLink(NavigationLink('/docs/vyzva_do_infokanalu_15.8.2004.pdf'), 'Výzva do infokanálu (15.8.2004)') + '<br/>'; 53 53 end; 54 GeneratePage(Self); 54 55 end; 55 MainModule.GeneratePage(HandlerData, Self);56 56 end; 57 57 -
trunk/Pages/UHistoryPage.pas
r77 r78 37 37 I: Integer; 38 38 begin 39 with MainModuledo begin40 LoadUserInfo (HandlerData);39 with TWebSession(HandlerData) do begin 40 LoadUserInfo; 41 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 42 42 Text := '<table>'; … … 54 54 Text := Text + '</table>'; 55 55 end; 56 GeneratePage(Self); 56 57 end; 57 MainModule.GeneratePage(HandlerData, Self);58 58 end; 59 59 -
trunk/Pages/UHostingPage.pas
r77 r78 38 38 DbRows: TDbRows; 39 39 begin 40 with MainModuledo begin41 LoadUserInfo (HandlerData);40 with TWebSession(HandlerData) do begin 41 LoadUserInfo; 42 42 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 43 43 Text := 'V nabídce je provoz virtualizovaných Linuxových serverů dle dohodnutých parameterů.<br/><br/>' + … … 93 93 end; 94 94 end; 95 GeneratePage(Self); 95 96 end; 96 MainModule.GeneratePage(HandlerData, Self);97 97 end; 98 98 -
trunk/Pages/UInternetPage.pas
r77 r78 34 34 procedure TInternetPage.DataModuleProduce(HandlerData: THTTPHandlerData); 35 35 begin 36 with MainModuledo begin37 LoadUserInfo (HandlerData);36 with TWebSession(HandlerData) do begin 37 LoadUserInfo; 38 38 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 39 39 Text := Text + 'Hlavní náplní činnosti sítě je poskytovat výhodné připojení k internetu pro občany.<br/><br/>' + … … 54 54 '<i>Aktualizováno: 1.8.2011</i>'; 55 55 end; 56 GeneratePage(Self); 56 57 end; 57 MainModule.GeneratePage(HandlerData, Self);58 58 end; 59 59 -
trunk/Pages/ULinksPage.pas
r77 r78 34 34 procedure TLinksPage.DataModuleProduce(HandlerData: THTTPHandlerData); 35 35 begin 36 with MainModule, HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin37 LoadUserInfo (HandlerData);36 with TWebSession(HandlerData), HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 37 LoadUserInfo; 38 38 Text := '<strong>Odkazy související s obcí:</strong><br/>' + 39 39 … … 63 63 '<a href="http://www.ustinet.cz/">Ústí.Net</a> - síť v Ústí u Vsetína<br/>' + 64 64 '<br/>'; 65 GeneratePage(Self); 65 66 end; 66 MainModule.GeneratePage(HandlerData, Self);67 67 end; 68 68 -
trunk/Pages/UNetworkPage.pas
r77 r78 36 36 TextBlock: THtmlString; 37 37 begin 38 with MainModuledo begin39 LoadUserInfo (HandlerData);38 with TWebSession(HandlerData) do begin 39 LoadUserInfo; 40 40 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 41 41 Text := MakeLink('Historie', NavigationLink('/historie/')) + '<br/>' + … … 43 43 MakeLink('Plánované projekty', NavigationLink('/plany/')) + '<br/>'; 44 44 end; 45 GeneratePage(Self); 45 46 end; 46 MainModule.GeneratePage(HandlerData, Self);47 47 end; 48 48 -
trunk/Pages/UPlansPage.pas
r77 r78 37 37 I: Integer; 38 38 begin 39 with MainModuledo begin40 LoadUserInfo (HandlerData);39 with TWebSession(HandlerData) do begin 40 LoadUserInfo; 41 41 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 42 42 Text := '<table>'; … … 65 65 Text := Text + '</table>'; 66 66 end; 67 GeneratePage(Self); 67 68 end; 68 MainModule.GeneratePage(HandlerData, Self);69 69 end; 70 70 -
trunk/Pages/UServerInfoPage.pas
r77 r78 34 34 procedure TServerInfoPage.DataModuleProduce(HandlerData: THTTPHandlerData); 35 35 begin 36 with MainModuledo begin37 LoadUserInfo (HandlerData);38 HandlerData.Session.Values['Test'] := 'Tst';39 WebApp1.HTTPServer.ServerInfo(HandlerData);40 GeneratePage( HandlerData,Self);36 with TWebSession(HandlerData) do begin 37 LoadUserInfo; 38 Session.Values['Test'] := 'Tst'; 39 MainModule.WebApp1.HTTPServer.ServerInfo(HandlerData); 40 GeneratePage(Self); 41 41 end; 42 42 end; -
trunk/Pages/UUserControlPage.pas
r77 r78 43 43 NewItem: TQueryFormItem; 44 44 begin 45 if HandlerData.Request.QueryParts.Count > 1 then PageName := HandlerData.Request.QueryParts[1] 46 else PageName := ''; 47 with MainModule, HtmlDocument.Body do begin 48 LoadUserInfo(HandlerData); 49 if PageName = '' then PageName := 'prihlaseni'; 50 if PageName = 'prihlaseni' then HandleLogin(HandlerData) 51 else if PageName = 'registrace' then HandleRegistration(HandlerData) 52 else if PageName = 'odhlaseni' then HandleLogout(HandlerData) 53 else if PageName = 'profil' then HandleProfile(HandlerData); 54 end; 55 MainModule.GeneratePage(HandlerData, Self); 45 with TWebSession(HandlerData) do begin 46 if Request.Path.Count > 1 then PageName := Request.Path[1] 47 else PageName := ''; 48 with HtmlDocument.Body do begin 49 LoadUserInfo; 50 if PageName = '' then PageName := 'prihlaseni'; 51 if PageName = 'prihlaseni' then HandleLogin(HandlerData) 52 else if PageName = 'registrace' then HandleRegistration(HandlerData) 53 else if PageName = 'odhlaseni' then HandleLogout(HandlerData) 54 else if PageName = 'profil' then HandleProfile(HandlerData); 55 end; 56 GeneratePage(Self); 57 end; 56 58 end; 57 59 … … 61 63 UserId: Integer; 62 64 begin 63 with MainModule, HtmlDocument.Body do begin65 with TWebSession(MainModule), HtmlDocument.Body do begin 64 66 Form := TQueryForm.Create; 65 67 with Form do begin … … 92 94 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 93 95 Text := 'Přihlášení user: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 94 UserId := MainModule.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,96 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 95 97 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 96 98 UserOnline.Login(UserId); … … 106 108 UserId: Integer; 107 109 begin 108 with MainModule, HtmlDocument.Body do begin110 with TWebSession(MainModule), HtmlDocument.Body do begin 109 111 Form := TQueryForm.Create; 110 112 with Form do begin … … 150 152 with THtmlString(SubItems.AddNew(THtmlString.Create)) do 151 153 Text := 'Registrace uživatele: ' + TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value; 152 MainModule.User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,154 User.Add(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 153 155 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value, 154 156 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Email').Value.Value); 155 UserId := MainModule.User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value,157 UserId := User.GetIdByNamePassword(TQueryFormGroup(Form.Groups[0]).Rows.FindByName('UserName').Value.Value, 156 158 TQueryFormGroup(Form.Groups[0]).Rows.FindByName('Password').Value.Value); 157 MainModule.UserOnline.Login(UserId);159 UserOnline.Login(UserId); 158 160 Form.Free; 159 161 end else SubItems.AddNew(Form); … … 163 165 procedure TUserControlPage.HandleLogout(HandlerData: THTTPHandlerData); 164 166 begin 165 with MainModule, HtmlDocument.Body do begin167 with TWebSession(MainModule), HtmlDocument.Body do begin 166 168 UserOnline.Logout; 167 169 with THtmlString(SubItems.AddNew(THtmlString.Create)) do … … 174 176 Form: TQueryForm; 175 177 begin 176 with MainModule, HtmlDocument.Body do begin178 with TWebSession(HandlerData), HtmlDocument.Body do begin 177 179 Form := TQueryForm.Create; 178 180 with Form do begin -
trunk/Pages/UVoIPPage.pas
r77 r78 34 34 procedure TVoIPPage.DataModuleProduce(HandlerData: THTTPHandlerData); 35 35 begin 36 with MainModuledo begin37 LoadUserInfo (HandlerData);36 with TWebSession(HandlerData) do begin 37 LoadUserInfo; 38 38 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 39 39 Text := 'Volejte levněji do pevných a mobilních sítí s sekundovou tarifikací a bez měsíčního paušálu.' + … … 65 65 '</ol>'; 66 66 end; 67 GeneratePage(Self); 67 68 end; 68 MainModule.GeneratePage(HandlerData, Self);69 69 end; 70 70 -
trunk/Pages/UWebCamPage.pas
r77 r78 43 43 ImageWidth, ImageHeight: string; 44 44 begin 45 with MainModuledo begin46 LoadUserInfo (HandlerData);45 with TWebSession(HandlerData) do begin 46 LoadUserInfo; 47 47 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create)) do begin 48 48 Text := ''; … … 154 154 Text := Text + '</td></tr></table>'; 155 155 end; 156 GeneratePage(Self); 156 157 end; 157 MainModule.GeneratePage(HandlerData, Self);158 158 end; 159 159
Note:
See TracChangeset
for help on using the changeset viewer.