Commit 5fe7deaaedb04c20497ad938b873750d588f6a8a
1 parent
564b83e4
Use the global database handle instead of creating our own.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3017 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
3 additions
and
10 deletions
lib/System.inc
| @@ -25,8 +25,6 @@ | @@ -25,8 +25,6 @@ | ||
| 25 | * @package lib | 25 | * @package lib |
| 26 | */ | 26 | */ |
| 27 | class System { | 27 | class System { |
| 28 | - | ||
| 29 | - var $db; | ||
| 30 | var $aSettings = array("ldapServer", "ldapRootDn", "ldapServerType", | 28 | var $aSettings = array("ldapServer", "ldapRootDn", "ldapServerType", |
| 31 | "ldapDomain", "ldapSearchUser", "ldapSearchPassword", | 29 | "ldapDomain", "ldapSearchUser", "ldapSearchPassword", |
| 32 | "emailServer", "emailFrom", "emailFromName", "emailAdmin", "emailAdminName", | 30 | "emailServer", "emailFrom", "emailFromName", "emailAdmin", "emailAdminName", |
| @@ -40,20 +38,15 @@ class System { | @@ -40,20 +38,15 @@ class System { | ||
| 40 | "Root URL", "Graphics URL", "User Interface URL", | 38 | "Root URL", "Graphics URL", "User Interface URL", |
| 41 | "Session Timeout", "Content Pane Scrolling Enabled", "Hide Unreadable Folders?"); | 39 | "Session Timeout", "Content Pane Scrolling Enabled", "Hide Unreadable Folders?"); |
| 42 | 40 | ||
| 43 | - function System() { | ||
| 44 | - global $default; | ||
| 45 | - $this->db = new Database(); | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | /** | 41 | /** |
| 49 | * Returns true if there are entries in the system_settings table | 42 | * Returns true if there are entries in the system_settings table |
| 50 | */ | 43 | */ |
| 51 | function initialised() { | 44 | function initialised() { |
| 52 | global $default; | 45 | global $default; |
| 53 | 46 | ||
| 54 | - if ($this->db->query("SELECT count(*) AS count FROM system_settings WHERE name<>'lastIndexUpdate' AND name<>'filesystemRoot' AND name<>'knowledgeTreeVersion' AND value<>''")) { | ||
| 55 | - $this->db->next_record(); | ||
| 56 | - return ($this->db->f("count") > 0) ? true : false; | 47 | + if ($default->db->query("SELECT count(*) AS count FROM system_settings WHERE name<>'lastIndexUpdate' AND name<>'filesystemRoot' AND name<>'knowledgeTreeVersion' AND value<>''")) { |
| 48 | + $default->db->next_record(); | ||
| 49 | + return ($default->db->f("count") > 0) ? true : false; | ||
| 57 | } | 50 | } |
| 58 | } | 51 | } |
| 59 | 52 |