diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-10 10:15:24 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-10 10:15:24 +0000 |
| commit | d2b78889450f7256e878376e71fe025191060af9 (patch) | |
| tree | 540ba58c047c872ee1b7dd37ed89d8382780a3f0 /frontends/php/include | |
| parent | a13221c0a0e7b56cf6f2175ff5c0928f7ca9cdae (diff) | |
| download | zabbix-d2b78889450f7256e878376e71fe025191060af9.tar.gz zabbix-d2b78889450f7256e878376e71fe025191060af9.tar.xz zabbix-d2b78889450f7256e878376e71fe025191060af9.zip | |
- [DEV-137] fixed DB defining (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5756 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/actions.inc.php | 4 | ||||
| -rw-r--r-- | frontends/php/include/db.inc.php | 30 |
2 files changed, 21 insertions, 13 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php index 41645978..4b4d93b6 100644 --- a/frontends/php/include/actions.inc.php +++ b/frontends/php/include/actions.inc.php @@ -992,7 +992,7 @@ function get_action_msgs_for_event($eventid){ while($row=DBfetch($result)){ $time=date("Y.M.d H:i:s",$row["clock"]); if($row['esc_step'] > 0){ - $time = array(bold(S_STEP.': '),br(),$row["esc_step"],br(),br(),bold(S_TIME.': '),br(),$time); + $time = array(bold(S_STEP.': '),$row["esc_step"],br(),bold(S_TIME.': '),br(),$time); } if($row["status"] == ALERT_STATUS_SENT){ @@ -1063,7 +1063,7 @@ function get_action_cmds_for_event($eventid){ while($row=DBfetch($result)){ $time=date("Y.M.d H:i:s",$row["clock"]); if($row['esc_step'] > 0){ - $time = array(bold(S_STEP.': '),br(),$row["esc_step"],br(),br(),bold(S_TIME.': '),br(),$time); + $time = array(bold(S_STEP.': '),$row["esc_step"],br(),bold(S_TIME.': '),br(),$time); } if($row["status"] == ALERT_STATUS_SENT){ diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index ea537418..3b71a16b 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -19,20 +19,20 @@ **/ ?> <?php +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; +} + function DBconnect(&$error){ $result = true; - 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; - } - + global $DB; + $DB['DB'] = null; $DB['TRANSACTIONS'] = 0; @@ -520,6 +520,14 @@ return $result; } +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; +} /* string value prepearing */ if(isset($DB['TYPE']) && $DB['TYPE'] == "ORACLE") { |
