Commit 18dd666f91c19e5e853e4582722e4a770c6e260a
1 parent
880ee16c
Added new members and function to Owl_DB class for use with visual patterns
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@66 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
169 additions
and
70 deletions
lib/owl.lib.php
| ... | ... | @@ -24,30 +24,30 @@ |
| 24 | 24 | |
| 25 | 25 | class Owl_DB extends DB_Sql { |
| 26 | 26 | |
| 27 | - //declare member variables | |
| 28 | - var $classname = "Owl_DB"; | |
| 27 | + /** Class name */ | |
| 28 | + var $classname = "Owl_DB"; | |
| 29 | 29 | |
| 30 | - // BEGIN wes changes -- moved these settings to config/owl.php | |
| 31 | - // Server where the database resides | |
| 32 | - var $Host = ""; | |
| 33 | - | |
| 34 | - // Database name | |
| 35 | - var $Database = ""; | |
| 36 | - | |
| 37 | - // User to access database | |
| 38 | - var $User = ""; | |
| 39 | - | |
| 40 | - // Password for database | |
| 41 | - var $Password = ""; | |
| 42 | -//------------------------------------------------------------ | |
| 43 | -/** | |
| 44 | - * Function Owl_DB | |
| 45 | - * | |
| 46 | - * Default Constructor | |
| 47 | - * | |
| 48 | -*/ | |
| 49 | -//------------------------------------------------------------ | |
| 50 | -// Usable | |
| 30 | + // BEGIN wes changes -- moved these settings to config/owl.php | |
| 31 | + // Server where the database resides | |
| 32 | + | |
| 33 | + /** Host name. Retrieved from config/owl.php */ | |
| 34 | + var $Host = ""; | |
| 35 | + /** Database name */ | |
| 36 | + var $Database = ""; | |
| 37 | + /** Database user */ | |
| 38 | + var $User = ""; | |
| 39 | + /** Database user password */ | |
| 40 | + var $Password = ""; | |
| 41 | + /** Query to execute */ | |
| 42 | + var $sQuery; | |
| 43 | + /** Name of table last query was executed on*/ | |
| 44 | + var $sLastTableName; | |
| 45 | + /** Where clause last used in query execution */ | |
| 46 | + var $sLastWhereClause; | |
| 47 | + /** Order by clause last used in query execution */ | |
| 48 | + var $sLastOrderByClause; | |
| 49 | + | |
| 50 | + /** Default Constructor */ | |
| 51 | 51 | function Owl_DB() { |
| 52 | 52 | global $default; |
| 53 | 53 | $this->Host = $default->owl_db_host; |
| ... | ... | @@ -56,22 +56,121 @@ class Owl_DB extends DB_Sql { |
| 56 | 56 | $this->Password = $default->owl_db_pass; |
| 57 | 57 | } |
| 58 | 58 | // END wes changes |
| 59 | - | |
| 60 | -//------------------------------------------------------------ | |
| 61 | -/** | |
| 62 | - * Function haltmsg | |
| 63 | - * | |
| 64 | - * Error Handling | |
| 65 | - * | |
| 66 | -*/ | |
| 67 | -//------------------------------------------------------------ | |
| 68 | -//usable | |
| 69 | - function haltmsg($msg) | |
| 70 | - { | |
| 71 | - printf("</td></table><b>Database error:</b> %s<br>\n", $msg); | |
| 72 | - printf("<b>SQL Error</b>: %s (%s)<br>\n", | |
| 73 | - $this->Errno, $this->Error); | |
| 74 | - } | |
| 59 | + | |
| 60 | + /** | |
| 61 | + * Create a query from the provided paramaters. The ID column | |
| 62 | + * is seleted by default | |
| 63 | + * | |
| 64 | + * @param $sTableName Table to query | |
| 65 | + * @param $aColumns Columns in table | |
| 66 | + * @param $sWhereClause Where clause (optional) | |
| 67 | + * @param $sOrderByClause Order by clause (optional) | |
| 68 | + */ | |
| 69 | + function createSQLQuery($sTableName, $aColumns, $sWhereClause = null, $sOrderByClause = null) { | |
| 70 | + $this->sLastTableName = $sTableName; | |
| 71 | + $this->sLastWhereCluase = $sWhereClause; | |
| 72 | + $this->sLastOrderByClause = $sOrderByClause; | |
| 73 | + | |
| 74 | + $this->sQuery = "SELECT ID, "; | |
| 75 | + | |
| 76 | + for( $i = 0; $i < count($aColumns) - 1; $i++ ) { | |
| 77 | + $this->sQuery = $this->sQuery . $aColumns[$i] . ","; | |
| 78 | + } | |
| 79 | + | |
| 80 | + $this->sQuery .= $aColumns[count($aColumns) - 1] . " "; | |
| 81 | + $this->sQuery .= "FROM " . $sTableName . " "; | |
| 82 | + | |
| 83 | + if (isset($sWhereClause)) { | |
| 84 | + $this->sQuery .= "WHERE " . $sWhereClause . " "; | |
| 85 | + } | |
| 86 | + | |
| 87 | + if (isset($sOrderByClause)) { | |
| 88 | + $this->sQuery .= "ORDER BY " . $sOrderByClause . " "; | |
| 89 | + } | |
| 90 | + | |
| 91 | + } | |
| 92 | + | |
| 93 | + /** | |
| 94 | + Create a query from the provided paramaters, specifying a limit and an offset. | |
| 95 | + The ID column is selected by default | |
| 96 | + | |
| 97 | + @param $sTableName Table to query | |
| 98 | + @param $aColumns Columns in table | |
| 99 | + @param $iOffset Offset | |
| 100 | + @param $iLimit Limit | |
| 101 | + @param $sWhereClause Where clause (optional) | |
| 102 | + @param $sOrderByClause Order by clause (optional) | |
| 103 | + */ | |
| 104 | + | |
| 105 | + function createSQLQueryWithOffset($sTableName, $aColumns, $iOffset, $iLimit, $sWhereClause = null, $sOrderByClause = null) { | |
| 106 | + $this->sLastTableName = $sTableName; | |
| 107 | + $this->sLastWhereCluase = $sWhereClause; | |
| 108 | + $this->sLastOrderByClause = $sOrderByClause; | |
| 109 | + | |
| 110 | + $this->sQuery = "SELECT ID, "; | |
| 111 | + | |
| 112 | + for( $i = 0; $i < count($aColumns) - 1; $i++ ) { | |
| 113 | + $this->sQuery = $this->sQuery . $aColumns[$i] . ","; | |
| 114 | + } | |
| 115 | + | |
| 116 | + $this->sQuery .= $aColumns[count($aColumns) - 1] . " "; | |
| 117 | + $this->sQuery .= "FROM " . $sTableName . " "; | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + if (isset($sWhereClause)) { | |
| 122 | + $this->sQuery .= "WHERE " . $sWhereClause . " "; | |
| 123 | + } | |
| 124 | + | |
| 125 | + if (isset($sOrderByClause)) { | |
| 126 | + $this->sQuery .= "ORDER BY " . $sOrderByClause . " "; | |
| 127 | + } | |
| 128 | + | |
| 129 | + $this->sQuery .= "LIMIT " . $iOffset . ", " . $iLimit; | |
| 130 | + } | |
| 131 | + | |
| 132 | + /** | |
| 133 | + * Get the result count for the previously executed query. Meant | |
| 134 | + * to be used in conjuction with createSSQLQueryWithOffset so that | |
| 135 | + * the total number of results can be calculated | |
| 136 | + * | |
| 137 | + * @return int row count | |
| 138 | + */ | |
| 139 | + function & getLastQueryResultCount() { | |
| 140 | + if (isset($this->sLastTableName) { | |
| 141 | + $sCountResultQuery = "SELECT COUNT(*) AS ResultCount FROM " . $this->sLastTableName; | |
| 142 | + | |
| 143 | + if (isset($this->sLastWhereClause)) { | |
| 144 | + sCountResultQuery . " WHERE " . $this->sLastWhereClause; | |
| 145 | + } | |
| 146 | + $sql = & $this->query($sCountResultQuery); | |
| 147 | + $sql->next_record(); | |
| 148 | + return $sql->f("ResultCount"); | |
| 149 | + } else { | |
| 150 | + return 0; | |
| 151 | + } | |
| 152 | + } | |
| 153 | + | |
| 154 | + /** | |
| 155 | + * Execute the query and return the results | |
| 156 | + * | |
| 157 | + * @returns Results of query | |
| 158 | + */ | |
| 159 | + function & getQueryResults() { | |
| 160 | + $result = null; | |
| 161 | + if (isset($this->sQuery)) { | |
| 162 | + $result = $this->query($this->sQuery); | |
| 163 | + } | |
| 164 | + return $result; | |
| 165 | + } | |
| 166 | + | |
| 167 | + /** | |
| 168 | + * Display any database errors encountered | |
| 169 | + */ | |
| 170 | + function haltmsg($msg) { | |
| 171 | + printf("</td></table><b>Database error:</b> %s<br>\n", $msg); | |
| 172 | + printf("<b>SQL Error</b>: %s (%s)<br>\n",$this->Errno, $this->Error); | |
| 173 | + } | |
| 75 | 174 | } |
| 76 | 175 | |
| 77 | 176 | /** |
| ... | ... | @@ -115,7 +214,7 @@ class Owl_Session { |
| 115 | 214 | $current = time(); |
| 116 | 215 | $random = $this->sessuid . $current; |
| 117 | 216 | $this->sessid = md5($random); |
| 118 | - $sql = new Owl_DB; | |
| 217 | + $sql = ; | |
| 119 | 218 | |
| 120 | 219 | if(getenv("HTTP_CLIENT_IP")) |
| 121 | 220 | { |
| ... | ... | @@ -140,7 +239,7 @@ class Owl_Session { |
| 140 | 239 | } |
| 141 | 240 | |
| 142 | 241 | // else we have a session id, try to validate it... |
| 143 | - $sql = new Owl_DB; | |
| 242 | + $sql = ; | |
| 144 | 243 | $sql->query("select * from $default->owl_sessions_table where sessid = '$this->sessid'"); |
| 145 | 244 | |
| 146 | 245 | // any matching session ids? |
| ... | ... | @@ -182,7 +281,7 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) |
| 182 | 281 | global $default; |
| 183 | 282 | global $lang_notif_subject_new, $lang_notif_subject_upd, $lang_notif_msg; |
| 184 | 283 | global $lang_title, $lang_description; |
| 185 | - $sql = new Owl_DB; | |
| 284 | + $sql = ; | |
| 186 | 285 | // BEGIN BUG 548994 |
| 187 | 286 | // get the fileid |
| 188 | 287 | $path = find_path($parent); |
| ... | ... | @@ -247,7 +346,7 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) |
| 247 | 346 | unlink("$default->owl_FileDir/$filename"); |
| 248 | 347 | } |
| 249 | 348 | $file = fopen("$default->owl_FileDir$filename", 'wb'); |
| 250 | - $getfile = new Owl_DB; | |
| 349 | + $getfile = ; | |
| 251 | 350 | $getfile->query("select data,compressed from $default->owl_files_data_table where id='$fileid'"); |
| 252 | 351 | while ($getfile->next_record()) |
| 253 | 352 | { |
| ... | ... | @@ -329,7 +428,7 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) |
| 329 | 428 | } |
| 330 | 429 | |
| 331 | 430 | $file = fopen("$default->owl_FileDir$filename", 'wb'); |
| 332 | - $getfile = new Owl_DB; | |
| 431 | + $getfile = ; | |
| 333 | 432 | $getfile->query("select data,compressed from $default->owl_files_data_table where id='$fileid'"); |
| 334 | 433 | |
| 335 | 434 | // get file check if compressed, if so uncompress |
| ... | ... | @@ -412,7 +511,7 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) |
| 412 | 511 | function verify_login($username, $password) |
| 413 | 512 | { |
| 414 | 513 | global $default; |
| 415 | - $sql = new Owl_DB; | |
| 514 | + $sql = ; | |
| 416 | 515 | $query = "select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'"; |
| 417 | 516 | $sql->query("select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'"); |
| 418 | 517 | $numrows = $sql->num_rows($sql); |
| ... | ... | @@ -457,11 +556,11 @@ function verify_login($username, $password) |
| 457 | 556 | // that is signing on. |
| 458 | 557 | // |
| 459 | 558 | $time = time() - $default->owl_timeout; |
| 460 | - $sql = new Owl_DB; $sql->query("delete from $default->owl_sessions_table where uid = '".$verified["uid"]."' and lastused <= $time "); | |
| 559 | + $sql = ; $sql->query("delete from $default->owl_sessions_table where uid = '".$verified["uid"]."' and lastused <= $time "); | |
| 461 | 560 | // Check if Maxsessions has been reached |
| 462 | 561 | // |
| 463 | 562 | |
| 464 | - $sql = new Owl_DB; | |
| 563 | + $sql = ; | |
| 465 | 564 | $sql->query("select * from $default->owl_sessions_table where uid = '".$verified["uid"]."'"); |
| 466 | 565 | |
| 467 | 566 | if ($sql->num_rows($sql) >= $maxsessions && $verified["bit"] != 0) { |
| ... | ... | @@ -493,7 +592,7 @@ function verify_session($sess) { |
| 493 | 592 | $sess = ltrim($sess); |
| 494 | 593 | $verified["bit"] = 0; |
| 495 | 594 | |
| 496 | - $sql = new Owl_DB; | |
| 595 | + $sql = ; | |
| 497 | 596 | $sql->query("select * from $default->owl_sessions_table where sessid = '$sess'"); |
| 498 | 597 | $numrows = $sql->num_rows($sql); |
| 499 | 598 | $time = time(); |
| ... | ... | @@ -574,7 +673,7 @@ function verify_session($sess) { |
| 574 | 673 | function fid_to_name($parent) |
| 575 | 674 | { |
| 576 | 675 | global $default; |
| 577 | - $sql = new Owl_DB; $sql->query("select name from $default->owl_folders_table where id = $parent"); | |
| 676 | + $sql = ; $sql->query("select name from $default->owl_folders_table where id = $parent"); | |
| 578 | 677 | while($sql->next_record()) |
| 579 | 678 | { |
| 580 | 679 | return $sql->f("name"); |
| ... | ... | @@ -597,7 +696,7 @@ function fid_to_name($parent) |
| 597 | 696 | function flid_to_name($id) |
| 598 | 697 | { |
| 599 | 698 | global $default; |
| 600 | - $sql = new Owl_DB; $sql->query("select name from $default->owl_files_table where id = $id"); | |
| 699 | + $sql = ; $sql->query("select name from $default->owl_files_table where id = $id"); | |
| 601 | 700 | while($sql->next_record()) |
| 602 | 701 | { |
| 603 | 702 | return $sql->f("name"); |
| ... | ... | @@ -619,7 +718,7 @@ function flid_to_name($id) |
| 619 | 718 | // Usable |
| 620 | 719 | function flid_to_filename($id) { |
| 621 | 720 | global $default; |
| 622 | - $sql = new Owl_DB; $sql->query("select filename from $default->owl_files_table where id = $id"); | |
| 721 | + $sql = ; $sql->query("select filename from $default->owl_files_table where id = $id"); | |
| 623 | 722 | while($sql->next_record()) |
| 624 | 723 | { |
| 625 | 724 | return $sql->f("filename"); |
| ... | ... | @@ -641,7 +740,7 @@ function flid_to_filename($id) { |
| 641 | 740 | function owlusergroup($userid) |
| 642 | 741 | { |
| 643 | 742 | global $default; |
| 644 | - $sql = new Owl_DB; $sql->query("select groupid from $default->owl_users_table where id = '$userid'"); | |
| 743 | + $sql = ; $sql->query("select groupid from $default->owl_users_table where id = '$userid'"); | |
| 645 | 744 | while($sql->next_record()) |
| 646 | 745 | { |
| 647 | 746 | $groupid = $sql->f("groupid"); |
| ... | ... | @@ -663,7 +762,7 @@ function owlusergroup($userid) |
| 663 | 762 | // Usable |
| 664 | 763 | function owlfilecreator($fileid) { |
| 665 | 764 | global $default; |
| 666 | - $sql = new Owl_DB; $sql->query("select creatorid from ".$default->owl_files_table." where id = '$fileid'"); | |
| 765 | + $sql = ; $sql->query("select creatorid from ".$default->owl_files_table." where id = '$fileid'"); | |
| 667 | 766 | while($sql->next_record()) |
| 668 | 767 | { |
| 669 | 768 | $filecreator = $sql->f("creatorid"); |
| ... | ... | @@ -686,7 +785,7 @@ function owlfilecreator($fileid) { |
| 686 | 785 | function owlfoldercreator($folderid) |
| 687 | 786 | { |
| 688 | 787 | global $default; |
| 689 | - $sql = new Owl_DB; $sql->query("select creatorid from ".$default->owl_folders_table." where id = '$folderid'"); | |
| 788 | + $sql = ; $sql->query("select creatorid from ".$default->owl_folders_table." where id = '$folderid'"); | |
| 690 | 789 | while($sql->next_record()) |
| 691 | 790 | { |
| 692 | 791 | $foldercreator = $sql->f("creatorid"); |
| ... | ... | @@ -709,7 +808,7 @@ function owlfoldercreator($folderid) |
| 709 | 808 | function owlfilegroup($fileid) |
| 710 | 809 | { |
| 711 | 810 | global $default; |
| 712 | - $sql = new Owl_DB; $sql->query("select groupid from $default->owl_files_table where id = '$fileid'"); | |
| 811 | + $sql = ; $sql->query("select groupid from $default->owl_files_table where id = '$fileid'"); | |
| 713 | 812 | while($sql->next_record()) |
| 714 | 813 | { |
| 715 | 814 | $filegroup = $sql->f("groupid"); |
| ... | ... | @@ -732,7 +831,7 @@ function owlfilegroup($fileid) |
| 732 | 831 | // Usable |
| 733 | 832 | function owlfoldergroup($folderid) { |
| 734 | 833 | global $default; |
| 735 | - $sql = new Owl_DB; $sql->query("select groupid from $default->owl_folders_table where id = '$folderid'"); | |
| 834 | + $sql = ; $sql->query("select groupid from $default->owl_folders_table where id = '$folderid'"); | |
| 736 | 835 | while($sql->next_record()) |
| 737 | 836 | { |
| 738 | 837 | $foldergroup = $sql->f("groupid"); |
| ... | ... | @@ -756,7 +855,7 @@ function owlfoldergroup($folderid) { |
| 756 | 855 | function owlfolderparent($folderid) |
| 757 | 856 | { |
| 758 | 857 | global $default; |
| 759 | - $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$folderid'"); | |
| 858 | + $sql = ; $sql->query("select parent from $default->owl_folders_table where id = '$folderid'"); | |
| 760 | 859 | while($sql->next_record()) |
| 761 | 860 | { |
| 762 | 861 | $folderparent = $sql->f("parent"); |
| ... | ... | @@ -780,7 +879,7 @@ function owlfolderparent($folderid) |
| 780 | 879 | function owlfileparent($fileid) |
| 781 | 880 | { |
| 782 | 881 | global $default; |
| 783 | - $sql = new Owl_DB; $sql->query("select parent from $default->owl_files_table where id = '$fileid'"); | |
| 882 | + $sql = ; $sql->query("select parent from $default->owl_files_table where id = '$fileid'"); | |
| 784 | 883 | while($sql->next_record()) |
| 785 | 884 | { |
| 786 | 885 | $fileparent = $sql->f("parent"); |
| ... | ... | @@ -804,9 +903,9 @@ function owlfileparent($fileid) |
| 804 | 903 | function fid_to_creator($id) { |
| 805 | 904 | |
| 806 | 905 | global $default; |
| 807 | - $sql = new Owl_DB; | |
| 906 | + $sql = ; | |
| 808 | 907 | $sql->query("select creatorid from ".$default->owl_files_table." where id = '$id'"); |
| 809 | - $sql2 = new Owl_DB; | |
| 908 | + $sql2 = ; | |
| 810 | 909 | while($sql->next_record()) |
| 811 | 910 | { |
| 812 | 911 | $creatorid = $sql->f("creatorid"); |
| ... | ... | @@ -832,7 +931,7 @@ function fid_to_creator($id) { |
| 832 | 931 | function group_to_name($id) |
| 833 | 932 | { |
| 834 | 933 | global $default; |
| 835 | - $sql = new Owl_DB; | |
| 934 | + $sql = ; | |
| 836 | 935 | $sql->query("select name from $default->owl_groups_table where id = '$id'"); |
| 837 | 936 | while($sql->next_record()) |
| 838 | 937 | { |
| ... | ... | @@ -855,7 +954,7 @@ function group_to_name($id) |
| 855 | 954 | function uid_to_name($id) |
| 856 | 955 | { |
| 857 | 956 | global $default; |
| 858 | - $sql = new Owl_DB; | |
| 957 | + $sql = ; | |
| 859 | 958 | $sql->query("select name from $default->owl_users_table where id = '$id'"); |
| 860 | 959 | while($sql->next_record()) |
| 861 | 960 | { |
| ... | ... | @@ -884,7 +983,7 @@ function uid_to_name($id) |
| 884 | 983 | function prefaccess($id) { |
| 885 | 984 | global $default; |
| 886 | 985 | $prefaccess = 1; |
| 887 | - $sql = new Owl_DB; $sql->query("select noprefaccess from $default->owl_users_table where id = '$id'"); | |
| 986 | + $sql = ; $sql->query("select noprefaccess from $default->owl_users_table where id = '$id'"); | |
| 888 | 987 | while($sql->next_record()) |
| 889 | 988 | { |
| 890 | 989 | $prefaccess = !($sql->f("noprefaccess")); |
| ... | ... | @@ -913,7 +1012,7 @@ function gen_navbar($parent) |
| 913 | 1012 | $new = $parent; |
| 914 | 1013 | while ($new != "1") |
| 915 | 1014 | { |
| 916 | - $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$new'"); | |
| 1015 | + $sql = ; $sql->query("select parent from $default->owl_folders_table where id = '$new'"); | |
| 917 | 1016 | while($sql->next_record()) $newparentid = $sql->f("parent"); |
| 918 | 1017 | $name = fid_to_name($newparentid); |
| 919 | 1018 | $navbar = "<A HREF='browse.php?sess=$sess&parent=$newparentid&expand=$expand&order=$order&$sortorder=$sort'>$name</A>/" . $navbar; |
| ... | ... | @@ -942,7 +1041,7 @@ function get_dirpath($parent) { |
| 942 | 1041 | $navbar = "$name"; |
| 943 | 1042 | $new = $parent; |
| 944 | 1043 | while ($new != "1") { |
| 945 | - $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$new'"); | |
| 1044 | + $sql = ; $sql->query("select parent from $default->owl_folders_table where id = '$new'"); | |
| 946 | 1045 | while($sql->next_record()) $newparentid = $sql->f("parent"); |
| 947 | 1046 | $name = fid_to_name($newparentid); |
| 948 | 1047 | $navbar = "$name/" . $navbar; |
| ... | ... | @@ -1133,7 +1232,7 @@ function printError($message, $submessage) { |
| 1133 | 1232 | include("./lib/header.inc"); |
| 1134 | 1233 | |
| 1135 | 1234 | if(check_auth($parent, "folder_view", $userid) != "1") { |
| 1136 | - $sql = new Owl_DB; | |
| 1235 | + $sql = ; | |
| 1137 | 1236 | $sql->query("select * from $default->owl_folders_table where id = '$parent'"); |
| 1138 | 1237 | $sql->next_record(); |
| 1139 | 1238 | $parent = $sql->f("parent"); |
| ... | ... | @@ -1168,7 +1267,7 @@ function getprefs ( ) |
| 1168 | 1267 | { |
| 1169 | 1268 | global $default; |
| 1170 | 1269 | |
| 1171 | - $sql = new Owl_DB; | |
| 1270 | + $sql = ; | |
| 1172 | 1271 | //$sql->query("select * from $default->owl_prefs_table"); |
| 1173 | 1272 | $sql->query("select * from prefs"); |
| 1174 | 1273 | $sql->next_record(); |
| ... | ... | @@ -1212,7 +1311,7 @@ function gethtmlprefs ( ) |
| 1212 | 1311 | { |
| 1213 | 1312 | global $default; |
| 1214 | 1313 | |
| 1215 | - $sql = new Owl_DB; | |
| 1314 | + $sql = ; | |
| 1216 | 1315 | $sql->query("select * from $default->owl_html_table"); |
| 1217 | 1316 | $sql->next_record(); |
| 1218 | 1317 | |
| ... | ... | @@ -1550,7 +1649,7 @@ if(isset($default->owl_lang)) { |
| 1550 | 1649 | die("$lang_err_lang_1 $langdir $lang_err_lang_2"); |
| 1551 | 1650 | } else { |
| 1552 | 1651 | |
| 1553 | - $sql = new Owl_DB; | |
| 1652 | + $sql = ; | |
| 1554 | 1653 | $sql->query("select * from $default->owl_sessions_table where sessid = '$sess'"); |
| 1555 | 1654 | $sql->next_record(); |
| 1556 | 1655 | $numrows = $sql->num_rows($sql); |
| ... | ... | @@ -1598,7 +1697,7 @@ if ($sess) { |
| 1598 | 1697 | exit; |
| 1599 | 1698 | } else { |
| 1600 | 1699 | $lastused = time(); |
| 1601 | - $sql = new Owl_DB; | |
| 1700 | + $sql = ; | |
| 1602 | 1701 | $sql->query("update $default->owl_sessions_table set lastused = '$lastused' where uid = '$userid'"); |
| 1603 | 1702 | } |
| 1604 | 1703 | } | ... | ... |