Changeset 37
- Timestamp:
- Oct 30, 2010, 7:36:25 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/UUser.pas
r36 r37 131 131 DbRows := Database.Query('SELECT `Id` FROM `User` WHERE `Name`="' + Name + '"'); 132 132 try 133 if DbRows.Count = 1 then Result := StrToInt(DbRows[0]. ValuesAtIndex[0])133 if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items[0].Value) 134 134 else raise ENotFound.Create('User "' + Name + '" not found'); 135 135 finally … … 145 145 '`Password` = SHA1(CONCAT("' + Password + '", Salt))'); 146 146 try 147 if DbRows.Count = 1 then Result := StrToInt(DbRows[0]. ValuesAtIndex[0])147 if DbRows.Count = 1 then Result := StrToInt(DbRows[0].Items[0].Value) 148 148 else raise ENotFound.Create('User "' + Name + '" not found'); 149 149 finally -
trunk/CGI.lpi
r36 r37 36 36 </local> 37 37 </RunParams> 38 <RequiredPackages Count=" 1">38 <RequiredPackages Count="2"> 39 39 <Item1> 40 <PackageName Value="TemplateGenerics"/> 41 </Item1> 42 <Item2> 40 43 <PackageName Value="synapse"/> 41 44 <MinVersion Valid="True"/> 42 </Item 1>45 </Item2> 43 46 </RequiredPackages> 44 <Units Count=" 68">47 <Units Count="71"> 45 48 <Unit0> 46 49 <Filename Value="CGI.lpr"/> … … 60 63 <IsPartOfProject Value="True"/> 61 64 <UnitName Value="UMainPage"/> 62 <EditorIndex Value="2 4"/>63 <WindowIndex Value="0"/> 64 <TopLine Value=" 313"/>65 <EditorIndex Value="25"/> 66 <WindowIndex Value="0"/> 67 <TopLine Value="271"/> 65 68 <CursorPos X="20" Y="316"/> 66 <UsageCount Value=" 199"/>69 <UsageCount Value="200"/> 67 70 <Loaded Value="True"/> 68 71 <DefaultSyntaxHighlighter Value="Delphi"/> … … 88 91 <EditorIndex Value="34"/> 89 92 <WindowIndex Value="0"/> 90 <TopLine Value=" 37"/>93 <TopLine Value="1"/> 91 94 <CursorPos X="69" Y="51"/> 92 95 <UsageCount Value="203"/> … … 167 170 <Unit13> 168 171 <Filename Value="/usr/share/fpcsrc/rtl/objpas/dateutil.inc"/> 169 <EditorIndex Value="27"/>170 172 <WindowIndex Value="0"/> 171 173 <TopLine Value="283"/> 172 174 <CursorPos X="10" Y="302"/> 173 175 <UsageCount Value="31"/> 174 <Loaded Value="True"/>175 176 <DefaultSyntaxHighlighter Value="Delphi"/> 176 177 </Unit13> … … 183 184 <TopLine Value="1"/> 184 185 <CursorPos X="92" Y="11"/> 185 <UsageCount Value="17 8"/>186 <UsageCount Value="179"/> 186 187 <Loaded Value="True"/> 187 188 <DefaultSyntaxHighlighter Value="Delphi"/> … … 192 193 <TopLine Value="108"/> 193 194 <CursorPos X="1" Y="134"/> 194 <UsageCount Value="17 8"/>195 <UsageCount Value="179"/> 195 196 <DefaultSyntaxHighlighter Value="None"/> 196 197 </Unit15> … … 200 201 <TopLine Value="1"/> 201 202 <CursorPos X="1" Y="1"/> 202 <UsageCount Value="17 8"/>203 <UsageCount Value="179"/> 203 204 <DefaultSyntaxHighlighter Value="JScript"/> 204 205 </Unit16> … … 244 245 <TopLine Value="1"/> 245 246 <CursorPos X="19" Y="4"/> 246 <UsageCount Value=" 0"/>247 <UsageCount Value="10"/> 247 248 <DefaultSyntaxHighlighter Value="Delphi"/> 248 249 </Unit21> … … 368 369 <EditorIndex Value="7"/> 369 370 <WindowIndex Value="0"/> 370 <TopLine Value="5 43"/>371 <TopLine Value="539"/> 371 372 <CursorPos X="14" Y="556"/> 372 373 <UsageCount Value="39"/> … … 422 423 <WindowIndex Value="0"/> 423 424 <TopLine Value="1"/> 424 <CursorPos X=" 46" Y="11"/>425 <UsageCount Value="7 8"/>425 <CursorPos X="15" Y="46"/> 426 <UsageCount Value="79"/> 426 427 <Loaded Value="True"/> 427 428 <DefaultSyntaxHighlighter Value="Delphi"/> … … 439 440 <Filename Value="Common/UDatabase.pas"/> 440 441 <IsPartOfProject Value="True"/> 441 <UsageCount Value="78"/> 442 <UnitName Value="UDatabase"/> 443 <EditorIndex Value="23"/> 444 <WindowIndex Value="0"/> 445 <TopLine Value="61"/> 446 <CursorPos X="26" Y="22"/> 447 <UsageCount Value="79"/> 448 <Loaded Value="True"/> 442 449 <DefaultSyntaxHighlighter Value="Delphi"/> 443 450 </Unit42> … … 448 455 <EditorIndex Value="30"/> 449 456 <WindowIndex Value="0"/> 450 <TopLine Value=" 132"/>451 <CursorPos X="5 " Y="149"/>452 <UsageCount Value="7 8"/>457 <TopLine Value="279"/> 458 <CursorPos X="56" Y="299"/> 459 <UsageCount Value="79"/> 453 460 <Loaded Value="True"/> 454 461 <DefaultSyntaxHighlighter Value="Delphi"/> … … 458 465 <IsPartOfProject Value="True"/> 459 466 <UnitName Value="USqlDatabase"/> 460 <EditorIndex Value="2 6"/>461 <WindowIndex Value="0"/> 462 <TopLine Value=" 215"/>463 <CursorPos X=" 49" Y="233"/>464 <UsageCount Value="7 8"/>467 <EditorIndex Value="27"/> 468 <WindowIndex Value="0"/> 469 <TopLine Value="1"/> 470 <CursorPos X="36" Y="11"/> 471 <UsageCount Value="79"/> 465 472 <Loaded Value="True"/> 466 473 <DefaultSyntaxHighlighter Value="Delphi"/> … … 472 479 <EditorIndex Value="11"/> 473 480 <WindowIndex Value="0"/> 474 <TopLine Value=" 13"/>475 <CursorPos X=" 5" Y="32"/>476 <UsageCount Value="7 8"/>481 <TopLine Value="44"/> 482 <CursorPos X="29" Y="61"/> 483 <UsageCount Value="79"/> 477 484 <Loaded Value="True"/> 478 485 <DefaultSyntaxHighlighter Value="Delphi"/> … … 507 514 <Unit49> 508 515 <Filename Value="/usr/share/fpcsrc/rtl/inc/systemh.inc"/> 509 <EditorIndex Value="28"/>510 516 <WindowIndex Value="0"/> 511 517 <TopLine Value="476"/> 512 518 <CursorPos X="3" Y="489"/> 513 519 <UsageCount Value="34"/> 514 <Loaded Value="True"/>515 520 <DefaultSyntaxHighlighter Value="Delphi"/> 516 521 </Unit49> … … 533 538 <TopLine Value="1"/> 534 539 <CursorPos X="53" Y="18"/> 535 <UsageCount Value="6 1"/>540 <UsageCount Value="62"/> 536 541 <Loaded Value="True"/> 537 542 <DefaultSyntaxHighlighter Value="Delphi"/> … … 543 548 <EditorIndex Value="29"/> 544 549 <WindowIndex Value="0"/> 545 <TopLine Value=" 42"/>546 <CursorPos X=" 56" Y="66"/>547 <UsageCount Value="4 0"/>550 <TopLine Value="121"/> 551 <CursorPos X="64" Y="128"/> 552 <UsageCount Value="41"/> 548 553 <Loaded Value="True"/> 549 554 <DefaultSyntaxHighlighter Value="Delphi"/> … … 555 560 <EditorIndex Value="12"/> 556 561 <WindowIndex Value="0"/> 557 <TopLine Value=" 76"/>558 <CursorPos X=" 29" Y="94"/>559 <UsageCount Value=" 39"/>562 <TopLine Value="1"/> 563 <CursorPos X="64" Y="17"/> 564 <UsageCount Value="40"/> 560 565 <Loaded Value="True"/> 561 566 <DefaultSyntaxHighlighter Value="Delphi"/> … … 565 570 <IsPartOfProject Value="True"/> 566 571 <UnitName Value="UHTTPSessionFile"/> 567 <EditorIndex Value="2 3"/>568 <WindowIndex Value="0"/> 569 <TopLine Value=" 28"/>572 <EditorIndex Value="24"/> 573 <WindowIndex Value="0"/> 574 <TopLine Value="1"/> 570 575 <CursorPos X="18" Y="45"/> 571 <UsageCount Value=" 39"/>576 <UsageCount Value="40"/> 572 577 <Loaded Value="True"/> 573 578 <DefaultSyntaxHighlighter Value="Delphi"/> … … 579 584 <EditorIndex Value="22"/> 580 585 <WindowIndex Value="0"/> 581 <TopLine Value="14 8"/>586 <TopLine Value="142"/> 582 587 <CursorPos X="52" Y="165"/> 583 <UsageCount Value=" 39"/>588 <UsageCount Value="40"/> 584 589 <Loaded Value="True"/> 585 590 <DefaultSyntaxHighlighter Value="Delphi"/> … … 589 594 <IsPartOfProject Value="True"/> 590 595 <UnitName Value="UHTTPServer"/> 596 <IsVisibleTab Value="True"/> 591 597 <EditorIndex Value="13"/> 592 598 <WindowIndex Value="0"/> 593 <TopLine Value=" 34"/>594 <CursorPos X="3 " Y="53"/>595 <UsageCount Value=" 39"/>599 <TopLine Value="1"/> 600 <CursorPos X="38" Y="9"/> 601 <UsageCount Value="40"/> 596 602 <Loaded Value="True"/> 597 603 <DefaultSyntaxHighlighter Value="Delphi"/> … … 603 609 <EditorIndex Value="19"/> 604 610 <WindowIndex Value="0"/> 605 <TopLine Value=" 82"/>611 <TopLine Value="1"/> 606 612 <CursorPos X="65" Y="100"/> 607 <UsageCount Value=" 39"/>613 <UsageCount Value="40"/> 608 614 <Loaded Value="True"/> 609 615 <DefaultSyntaxHighlighter Value="Delphi"/> … … 615 621 <EditorIndex Value="21"/> 616 622 <WindowIndex Value="0"/> 617 <TopLine Value=" 27"/>623 <TopLine Value="1"/> 618 624 <CursorPos X="3" Y="29"/> 619 <UsageCount Value=" 39"/>625 <UsageCount Value="40"/> 620 626 <Loaded Value="True"/> 621 627 <DefaultSyntaxHighlighter Value="Delphi"/> … … 629 635 <TopLine Value="1"/> 630 636 <CursorPos X="6" Y="15"/> 631 <UsageCount Value="3 8"/>637 <UsageCount Value="39"/> 632 638 <Loaded Value="True"/> 633 639 <DefaultSyntaxHighlighter Value="Delphi"/> … … 640 646 <WindowIndex Value="0"/> 641 647 <TopLine Value="1"/> 642 <CursorPos X="4 6" Y="19"/>643 <UsageCount Value="3 8"/>648 <CursorPos X="42" Y="8"/> 649 <UsageCount Value="39"/> 644 650 <Loaded Value="True"/> 645 651 <DefaultSyntaxHighlighter Value="Delphi"/> … … 651 657 <EditorIndex Value="17"/> 652 658 <WindowIndex Value="0"/> 653 <TopLine Value=" 74"/>659 <TopLine Value="1"/> 654 660 <CursorPos X="52" Y="92"/> 655 <UsageCount Value="3 8"/>661 <UsageCount Value="39"/> 656 662 <Loaded Value="True"/> 657 663 <DefaultSyntaxHighlighter Value="Delphi"/> … … 663 669 <EditorIndex Value="14"/> 664 670 <WindowIndex Value="0"/> 665 <TopLine Value=" 12"/>666 <CursorPos X=" 15" Y="25"/>667 <UsageCount Value="3 8"/>671 <TopLine Value="83"/> 672 <CursorPos X="47" Y="106"/> 673 <UsageCount Value="39"/> 668 674 <Loaded Value="True"/> 669 675 <DefaultSyntaxHighlighter Value="Delphi"/> … … 675 681 <EditorIndex Value="15"/> 676 682 <WindowIndex Value="0"/> 677 <TopLine Value=" 660"/>683 <TopLine Value="1"/> 678 684 <CursorPos X="3" Y="687"/> 679 <UsageCount Value="3 8"/>685 <UsageCount Value="39"/> 680 686 <Loaded Value="True"/> 681 687 <DefaultSyntaxHighlighter Value="Delphi"/> … … 697 703 <EditorIndex Value="2"/> 698 704 <WindowIndex Value="0"/> 699 <TopLine Value=" 89"/>700 <CursorPos X=" 1" Y="114"/>701 <UsageCount Value="3 8"/>705 <TopLine Value="1"/> 706 <CursorPos X="48" Y="9"/> 707 <UsageCount Value="39"/> 702 708 <Loaded Value="True"/> 703 709 <DefaultSyntaxHighlighter Value="Delphi"/> … … 717 723 <IsPartOfProject Value="True"/> 718 724 <UnitName Value="UPageList"/> 719 <IsVisibleTab Value="True"/> 720 <EditorIndex Value="25"/> 721 <WindowIndex Value="0"/> 722 <TopLine Value="67"/> 723 <CursorPos X="9" Y="96"/> 724 <UsageCount Value="35"/> 725 <EditorIndex Value="26"/> 726 <WindowIndex Value="0"/> 727 <TopLine Value="1"/> 728 <CursorPos X="43" Y="79"/> 729 <UsageCount Value="36"/> 725 730 <Loaded Value="True"/> 726 731 <DefaultSyntaxHighlighter Value="Delphi"/> 727 732 </Unit67> 733 <Unit68> 734 <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Specialized/DictionaryStringString.pas"/> 735 <UnitName Value="DictionaryStringString"/> 736 <EditorIndex Value="28"/> 737 <WindowIndex Value="0"/> 738 <TopLine Value="1"/> 739 <CursorPos X="20" Y="17"/> 740 <UsageCount Value="10"/> 741 <Loaded Value="True"/> 742 </Unit68> 743 <Unit69> 744 <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/DictionaryImplementation.tpl"/> 745 <WindowIndex Value="0"/> 746 <TopLine Value="22"/> 747 <CursorPos X="3" Y="40"/> 748 <UsageCount Value="10"/> 749 <DefaultSyntaxHighlighter Value="None"/> 750 </Unit69> 751 <Unit70> 752 <Filename Value="../../PascalClassLibrary/Generics/TemplateGenerics/Generic/DictionaryInterface.tpl"/> 753 <WindowIndex Value="0"/> 754 <TopLine Value="1"/> 755 <CursorPos X="50" Y="12"/> 756 <UsageCount Value="10"/> 757 <DefaultSyntaxHighlighter Value="None"/> 758 </Unit70> 728 759 </Units> 729 <JumpHistory Count=" 30" HistoryIndex="29">760 <JumpHistory Count="29" HistoryIndex="28"> 730 761 <Position1> 731 <Filename Value=" Application/UUser.pas"/>732 <Caret Line=" 56" Column="1" TopLine="45"/>762 <Filename Value="Common/USqlDatabase.pas"/> 763 <Caret Line="426" Column="27" TopLine="424"/> 733 764 </Position1> 734 765 <Position2> 735 <Filename Value=" Application/UUser.pas"/>736 <Caret Line="58 " Column="1" TopLine="45"/>766 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/classesh.inc"/> 767 <Caret Line="581" Column="56" TopLine="564"/> 737 768 </Position2> 738 769 <Position3> 739 <Filename Value=" Application/UUser.pas"/>740 <Caret Line=" 59" Column="1" TopLine="45"/>770 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/stringl.inc"/> 771 <Caret Line="196" Column="11" TopLine="186"/> 741 772 </Position3> 742 773 <Position4> 743 <Filename Value=" Application/UUser.pas"/>744 <Caret Line=" 60" Column="1" TopLine="45"/>774 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/stringl.inc"/> 775 <Caret Line="194" Column="8" TopLine="186"/> 745 776 </Position4> 746 777 <Position5> 747 <Filename Value=" Application/UCustomApplication.pas"/>748 <Caret Line=" 243" Column="40" TopLine="229"/>778 <Filename Value="Common/USqlDatabase.pas"/> 779 <Caret Line="11" Column="15" TopLine="1"/> 749 780 </Position5> 750 781 <Position6> 751 <Filename Value=" Application/UCustomApplication.pas"/>752 <Caret Line="2 44" Column="1" TopLine="229"/>782 <Filename Value="Common/USqlDatabase.pas"/> 783 <Caret Line="25" Column="59" TopLine="8"/> 753 784 </Position6> 754 785 <Position7> 755 <Filename Value=" Application/UUser.pas"/>756 <Caret Line=" 60" Column="17" TopLine="25"/>786 <Filename Value="Common/USqlDatabase.pas"/> 787 <Caret Line="433" Column="44" TopLine="412"/> 757 788 </Position7> 758 789 <Position8> 759 <Filename Value=" Application/UUser.pas"/>760 <Caret Line=" 53" Column="1" TopLine="25"/>790 <Filename Value="Common/USqlDatabase.pas"/> 791 <Caret Line="22" Column="30" TopLine="1"/> 761 792 </Position8> 762 793 <Position9> 763 <Filename Value=" Application/UUser.pas"/>764 <Caret Line=" 54" Column="1" TopLine="25"/>794 <Filename Value="Common/USqlDatabase.pas"/> 795 <Caret Line="60" Column="68" TopLine="40"/> 765 796 </Position9> 766 797 <Position10> 767 <Filename Value=" Application/UUser.pas"/>768 <Caret Line=" 55" Column="1" TopLine="25"/>798 <Filename Value="Common/USqlDatabase.pas"/> 799 <Caret Line="175" Column="76" TopLine="158"/> 769 800 </Position10> 770 801 <Position11> 771 <Filename Value=" Application/UUser.pas"/>772 <Caret Line=" 56" Column="1" TopLine="25"/>802 <Filename Value="Common/USqlDatabase.pas"/> 803 <Caret Line="187" Column="33" TopLine="170"/> 773 804 </Position11> 774 805 <Position12> 775 <Filename Value=" Application/UUser.pas"/>776 <Caret Line=" 58" Column="1" TopLine="38"/>806 <Filename Value="Common/USqlDatabase.pas"/> 807 <Caret Line="191" Column="42" TopLine="174"/> 777 808 </Position12> 778 809 <Position13> 779 <Filename Value=" Application/UUser.pas"/>780 <Caret Line=" 59" Column="1" TopLine="38"/>810 <Filename Value="Common/USqlDatabase.pas"/> 811 <Caret Line="222" Column="43" TopLine="205"/> 781 812 </Position13> 782 813 <Position14> 783 <Filename Value=" Application/UUser.pas"/>784 <Caret Line=" 60" Column="1" TopLine="38"/>814 <Filename Value="Common/USqlDatabase.pas"/> 815 <Caret Line="226" Column="13" TopLine="209"/> 785 816 </Position14> 786 817 <Position15> 787 <Filename Value=" Application/UCustomApplication.pas"/>788 <Caret Line="2 44" Column="21" TopLine="229"/>818 <Filename Value="Common/USqlDatabase.pas"/> 819 <Caret Line="234" Column="77" TopLine="217"/> 789 820 </Position15> 790 821 <Position16> 791 <Filename Value=" Application/UUser.pas"/>792 <Caret Line=" 68" Column="17" TopLine="40"/>822 <Filename Value="Common/USqlDatabase.pas"/> 823 <Caret Line="246" Column="33" TopLine="229"/> 793 824 </Position16> 794 825 <Position17> 795 <Filename Value=" Pages/UMainPage.pas"/>796 <Caret Line=" 329" Column="4" TopLine="306"/>826 <Filename Value="Common/USqlDatabase.pas"/> 827 <Caret Line="250" Column="42" TopLine="233"/> 797 828 </Position17> 798 829 <Position18> 799 <Filename Value=" Pages/UMainPage.pas"/>800 <Caret Line=" 327" Column="33" TopLine="306"/>830 <Filename Value="Common/USqlDatabase.pas"/> 831 <Caret Line="267" Column="76" TopLine="250"/> 801 832 </Position18> 802 833 <Position19> 803 <Filename Value=" Pages/UMainPage.pas"/>804 <Caret Line=" 339" Column="35" TopLine="306"/>834 <Filename Value="Common/USqlDatabase.pas"/> 835 <Caret Line="277" Column="33" TopLine="260"/> 805 836 </Position19> 806 837 <Position20> 807 <Filename Value=" Pages/UMainPage.pas"/>808 <Caret Line=" 333" Column="76" TopLine="313"/>838 <Filename Value="Common/USqlDatabase.pas"/> 839 <Caret Line="280" Column="48" TopLine="263"/> 809 840 </Position20> 810 841 <Position21> 811 <Filename Value=" Application/UPageList.pas"/>812 <Caret Line=" 19" Column="24" TopLine="1"/>842 <Filename Value="Common/USqlDatabase.pas"/> 843 <Caret Line="383" Column="1" TopLine="370"/> 813 844 </Position21> 814 845 <Position22> 815 <Filename Value=" Application/UPageList.pas"/>816 <Caret Line=" 64" Column="30" TopLine="45"/>846 <Filename Value="Common/USqlDatabase.pas"/> 847 <Caret Line="391" Column="66" TopLine="370"/> 817 848 </Position22> 818 849 <Position23> 819 <Filename Value="Application/U PageList.pas"/>820 <Caret Line=" 42" Column="21" TopLine="25"/>850 <Filename Value="Application/UUser.pas"/> 851 <Caret Line="66" Column="56" TopLine="1"/> 821 852 </Position23> 822 853 <Position24> 823 <Filename Value="Application/U PageList.pas"/>824 <Caret Line=" 43" Column="62" TopLine="26"/>854 <Filename Value="Application/UUser.pas"/> 855 <Caret Line="133" Column="73" TopLine="116"/> 825 856 </Position24> 826 857 <Position25> 827 <Filename Value="Application/U PageList.pas"/>828 <Caret Line=" 50" Column="20" TopLine="33"/>858 <Filename Value="Application/UUser.pas"/> 859 <Caret Line="147" Column="74" TopLine="122"/> 829 860 </Position25> 830 861 <Position26> 831 <Filename Value=" Application/UPageList.pas"/>832 <Caret Line=" 95" Column="4" TopLine="65"/>862 <Filename Value="Common/UMemoryStreamEx.pas"/> 863 <Caret Line="25" Column="15" TopLine="1"/> 833 864 </Position26> 834 865 <Position27> 835 <Filename Value=" Application/UPageList.pas"/>836 <Caret Line=" 20" Column="21" TopLine="1"/>866 <Filename Value="Common/UMemoryStreamEx.pas"/> 867 <Caret Line="68" Column="26" TopLine="51"/> 837 868 </Position27> 838 869 <Position28> 839 <Filename Value=" Application/UPageList.pas"/>840 <Caret Line=" 14" Column="24" TopLine="1"/>870 <Filename Value="WebServer/UHTTPServer.pas"/> 871 <Caret Line="30" Column="29" TopLine="10"/> 841 872 </Position28> 842 873 <Position29> 843 <Filename Value=" Application/UPageList.pas"/>844 <Caret Line=" 54" Column="21" TopLine="37"/>874 <Filename Value="WebServer/UHTTPServer.pas"/> 875 <Caret Line="72" Column="42" TopLine="56"/> 845 876 </Position29> 846 <Position30>847 <Filename Value="Application/UPageList.pas"/>848 <Caret Line="70" Column="30" TopLine="58"/>849 </Position30>850 877 </JumpHistory> 851 878 </ProjectOptions> … … 884 911 <WriteFPCLogo Value="False"/> 885 912 <CompilerMessages> 913 <IgnoredMessages idx5023="True" idx5024="True" idx5025="True" idx5028="True"/> 886 914 <UseMsgFile Value="True"/> 887 915 </CompilerMessages> -
trunk/Common/UDatabase.pas
r23 r37 6 6 7 7 uses 8 SysUtils, Variants, Classes, TypInfo, USqlDatabase, RTLConsts, Contnrs,Dialogs;8 SysUtils, Variants, Classes, TypInfo, USqlDatabase, RTLConsts, Dialogs; 9 9 10 10 type -
trunk/Common/UHtmlClasses.pas
r36 r37 6 6 7 7 uses 8 UXmlClasses, Classes, SysUtils, Contnrs, UStringListEx;8 UXmlClasses, Classes, SysUtils, UStringListEx, ListObject; 9 9 10 10 type … … 95 95 public 96 96 BlockType: TBlockType; 97 SubItems: T ObjectList; // of THtmlElement;97 SubItems: TListObject; // TListObject<THtmlElement>; 98 98 constructor Create; 99 99 destructor Destroy; override; … … 294 294 constructor THtmlBlock.Create; 295 295 begin 296 SubItems := T ObjectList.Create;296 SubItems := TListObject.Create; 297 297 end; 298 298 -
trunk/Common/UPool.pas
r32 r37 6 6 7 7 uses 8 Classes, SysUtils, Contnrs, syncobjs;8 Classes, SysUtils, syncobjs, ListObject; 9 9 10 10 type … … 21 21 { TThreadedPool } 22 22 23 TThreadedPool = class(T ObjectList)23 TThreadedPool = class(TListObject) 24 24 private 25 25 Lock: TCriticalSection; -
trunk/Common/USqlDatabase.pas
r34 r37 8 8 9 9 uses 10 SysUtils, Classes, Dialogs, mysql50, TypInfo, Contnrs, UStringListEx; 10 SysUtils, Classes, Dialogs, mysql50, TypInfo, UStringListEx, 11 ListObject, DictionaryStringString; 11 12 12 13 type … … 20 21 TSetClientCapabilities = set of TClientCapabilities; 21 22 22 T AssociativeArray = class(TStringList)23 TDbRows = class(TListObject) 23 24 private 24 function GetValues(Index: string): string; 25 function GetValuesAtIndex(Index: Integer): string; 26 procedure SetValues(Index: string; const Value: string); 25 function GetData(Index: Integer): TDictionaryStringString; 26 procedure SetData(Index: Integer; const Value: TDictionaryStringString); 27 27 public 28 constructor Create; 29 destructor Destroy; override; 30 function GetAllValues: string; 31 procedure AddKeyValue(Key, Value: string); 32 property ValuesAtIndex[Index: Integer]: string read GetValuesAtIndex; 33 property Values[Index: string]: string read GetValues write SetValues; default; 34 end; 35 36 TDbRows = class(TObjectList) 37 private 38 function GetData(Index: Integer): TAssociativeArray; 39 procedure SetData(Index: Integer; const Value: TAssociativeArray); 40 public 41 property Data[Index: Integer]: TAssociativeArray read GetData write SetData; default; 28 property Data[Index: Integer]: TDictionaryStringString read GetData write SetData; default; 42 29 destructor Destroy; override; 43 30 end; … … 68 55 function Select(ATable: string; Filter: string = '*'; Condition: string = '1'): TDbRows; 69 56 procedure Delete(ATable: string; Condition: string = '1'); 70 procedure Insert(ATable: string; Data: T AssociativeArray);71 procedure Update(ATable: string; Data: T AssociativeArray; Condition: string = '1');72 procedure Replace(ATable: string; Data: T AssociativeArray);57 procedure Insert(ATable: string; Data: TDictionaryStringString); 58 procedure Update(ATable: string; Data: TDictionaryStringString; Condition: string = '1'); 59 procedure Replace(ATable: string; Data: TDictionaryStringString); 73 60 procedure Connect; 74 61 procedure Disconnect; … … 186 173 end; 187 174 188 procedure TSqlDatabase.Insert(ATable: string; Data: T AssociativeArray);175 procedure TSqlDatabase.Insert(ATable: string; Data: TDictionaryStringString); 189 176 var 190 177 DbNames: string; … … 198 185 DbValues := ''; 199 186 for I := 0 to Data.Count - 1 do begin 200 Value := Data. ValuesAtIndex[I];187 Value := Data.Items[I].Value; 201 188 StringReplace(Value, '"', '\"', [rfReplaceAll]); 202 189 if Value = 'NOW()' then DbValues := DbValues + ',' + Value 203 190 else DbValues := DbValues + ',"' + Value + '"'; 204 DbNames := DbNames + ',`' + Data. Names[I] + '`';191 DbNames := DbNames + ',`' + Data.Keys[I] + '`'; 205 192 end; 206 193 System.Delete(DbNames, 1, 1); … … 233 220 for I := 0 to Result.Count - 1 do begin 234 221 DbRow := mysql_fetch_row(DbResult); 235 Result[I] := T AssociativeArray.Create;222 Result[I] := TDictionaryStringString.Create; 236 223 with Result[I] do begin 237 224 for II := 0 to mysql_num_fields(DbResult) - 1 do begin 238 Add(mysql_fetch_field_direct(DbResult, II)^.Name +239 NameValueSeparator +PChar((DbRow + II)^));225 Add(mysql_fetch_field_direct(DbResult, II)^.Name, 226 PChar((DbRow + II)^)); 240 227 end; 241 228 end; … … 245 232 end; 246 233 247 procedure TSqlDatabase.Replace(ATable: string; Data: T AssociativeArray);234 procedure TSqlDatabase.Replace(ATable: string; Data: TDictionaryStringString); 248 235 var 249 236 DbNames: string; … … 257 244 DbValues := ''; 258 245 for I := 0 to Data.Count - 1 do begin 259 Value := Data. ValuesAtIndex[I];246 Value := Data.Items[I].Value; 260 247 StringReplace(Value, '"', '\"', [rfReplaceAll]); 261 248 if Value = 'NOW()' then DbValues := DbValues + ',' + Value 262 249 else DbValues := DbValues + ',"' + Value + '"'; 263 DbNames := DbNames + ',`' + Data. Names[I] + '`';250 DbNames := DbNames + ',`' + Data.Keys[I] + '`'; 264 251 end; 265 252 System.Delete(DbNames, 1, 1); … … 278 265 end; 279 266 280 procedure TSqlDatabase.Update(ATable: string; Data: T AssociativeArray; Condition: string = '1');267 procedure TSqlDatabase.Update(ATable: string; Data: TDictionaryStringString; Condition: string = '1'); 281 268 var 282 269 DbValues: string; … … 288 275 DbValues := ''; 289 276 for I := 0 to Data.Count - 1 do begin 290 Value := Data. ValuesAtIndex[I];277 Value := Data.Items[I].Value; 291 278 StringReplace(Value, '"', '\"', [rfReplaceAll]); 292 279 if Value = 'NOW()' then DbValues := DbValues + ',' + Value 293 else DbValues := DbValues + ',' + Data. Names[I] + '=' + '"' + Value + '"';280 else DbValues := DbValues + ',' + Data.Keys[I] + '=' + '"' + Value + '"'; 294 281 end; 295 282 System.Delete(DbValues, 1, 1); … … 395 382 end; 396 383 397 { TAssociativeArray } 398 399 procedure TAssociativeArray.AddKeyValue(Key, Value: string); 400 begin 401 Add(Key + NameValueSeparator + Value); 402 end; 403 404 constructor TAssociativeArray.Create; 405 begin 406 NameValueSeparator := '|'; 407 end; 408 409 destructor TAssociativeArray.Destroy; 384 { TDbRows } 385 386 destructor TDbRows.Destroy; 410 387 begin 411 388 inherited; 412 389 end; 413 390 414 function TAssociativeArray.GetAllValues: string; 415 var 416 I: Integer; 417 begin 418 Result := ''; 419 for I := 0 to Count - 1 do begin 420 Result := Result + Names[I] + '=' + ValuesAtIndex[I] + ','; 421 end; 422 end; 423 424 function TAssociativeArray.GetValues(Index: string): string; 425 begin 426 Result := inherited Values[Index]; 427 end; 428 429 function TAssociativeArray.GetValuesAtIndex(Index: Integer): string; 430 begin 431 Result := inherited Values[Names[Index]]; 432 end; 433 434 procedure TAssociativeArray.SetValues(Index: string; const Value: string); 435 begin 436 inherited Values[Index] := Value; 437 end; 438 439 { TDbRows } 440 441 destructor TDbRows.Destroy; 442 begin 443 inherited; 444 end; 445 446 function TDbRows.GetData(Index: Integer): TAssociativeArray; 447 begin 448 Result := TAssociativeArray(Items[Index]); 449 end; 450 451 procedure TDbRows.SetData(Index: Integer; const Value: TAssociativeArray); 391 function TDbRows.GetData(Index: Integer): TDictionaryStringString; 392 begin 393 Result := TDictionaryStringString(Items[Index]); 394 end; 395 396 procedure TDbRows.SetData(Index: Integer; const Value: TDictionaryStringString); 452 397 begin 453 398 Items[Index] := Value; -
trunk/Common/UXmlClasses.pas
r24 r37 5 5 interface 6 6 7 uses Classes, SysUtils, Contnrs, StrUtils, UStringListEx;7 uses Classes, SysUtils, StrUtils, UStringListEx, ListObject; 8 8 9 9 type … … 30 30 Name: string; 31 31 Attributes: TStringListEx; 32 SubElements: T ObjectList; // of TXmlElement;32 SubElements: TListObject; // TListObject<TXmlElement>; 33 33 constructor Create; 34 34 destructor Destroy; override; … … 59 59 Attributes := TStringListEx.Create; 60 60 Attributes.NameValueSeparator := '='; 61 SubElements := T ObjectList.Create;61 SubElements := TListObject.Create; 62 62 EndTagSymbol := '/'; 63 63 end; -
trunk/WebServer/UHTTPServer.pas
r34 r37 7 7 uses 8 8 Classes, SysUtils, UTCPServer, UCommon, UMemoryStreamEx, UMIMEType, 9 Synautil, UStringListEx ;9 Synautil, UStringListEx, ListObject; 10 10 11 11 type … … 70 70 { TRequestHandlerList } 71 71 72 TRequestHandlerList = class(TList )72 TRequestHandlerList = class(TListObject) 73 73 procedure Add(AName: string; AHandler: TRequestEvent); 74 74 function IndexOfName(AName: string): TRequestHandler;
Note:
See TracChangeset
for help on using the changeset viewer.