diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-21 14:02:18 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-21 14:02:18 +0000 |
| commit | 00ea8cd431aa8e54993e49b827cdb234306d06cf (patch) | |
| tree | 1ce035068c43683c3abedb82dc2c0c7996f8250f /frontends/php/include | |
| parent | 985ef1d5031e25ccd9c0c076f17c5bbb3eb734d1 (diff) | |
- [DEV-137] added support of old-style configfile (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5642 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/db.inc.php | 15 | ||||
| -rw-r--r-- | frontends/php/include/page_header.php | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index defaad6a..b52e74ac 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -19,13 +19,20 @@ **/ ?> <?php - global $DB; - function DBconnect(&$error){ $result = true; - global $DB; - + global $DB, $DB_TYPE, $DB_SERVER, $DB_PORT, $DB_DATABASE, $DB_USER, $DB_PASSWORD; + + if(!isset($DB)){ + if(isset($DB_TYPE)) $DB['TYPE'] = $DB_TYPE; + if(isset($DB_SERVER)) $DB['SERVER'] = $DB_SERVER; + if(isset($DB_PORT)) $DB['PORT'] = $DB_PORT; + if(isset($DB_DATABASE)) $DB['DATABASE'] = $DB_DATABASE; + if(isset($DB_USER)) $DB['USER'] = $DB_USER; + if(isset($DB_PASSWORD)) $DB['PASSWORD'] = $DB_PASSWORD; + } + $DB['DB'] = null; $DB['TRANSACTIONS'] = 0; diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php index 2746bb9e..ac23a8c6 100644 --- a/frontends/php/include/page_header.php +++ b/frontends/php/include/page_header.php @@ -387,8 +387,7 @@ COpt::profiling_start("page"); <meta name="Author" content="ZABBIX SIA" /> <link rel="stylesheet" href="css.css" /> <?php - global $DB; - if(!is_null($DB['DB'])){ + if(isset($DB['DB']) && !is_null($DB['DB'])){ $css = false; $config=select_config(); if(isset($config['default_theme']) && file_exists('styles/'.$config['default_theme'])){ |
