summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-14 08:18:48 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-14 08:18:48 +0000
commit9aece56f182f4491686494e935f7122ee5295bf1 (patch)
treea377f4e716db7df940e36bac64d935b123dda0a5 /frontends/php/include
parent3bcbd824202608c482702acf1c195df92a65f0b6 (diff)
downloadzabbix-9aece56f182f4491686494e935f7122ee5295bf1.tar.gz
zabbix-9aece56f182f4491686494e935f7122ee5295bf1.tar.xz
zabbix-9aece56f182f4491686494e935f7122ee5295bf1.zip
- [DEV-137] fixes in template linkage. Tnx to Palmertree. (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5827 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/hosts.inc.php20
-rw-r--r--frontends/php/include/items.inc.php5
-rw-r--r--frontends/php/include/triggers.inc.php1
3 files changed, 11 insertions, 15 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index b30763e5..57a675ea 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -172,15 +172,14 @@ require_once "include/httptest.inc.php";
*
* NOTE: templates = array(id => name, id2 => name2, ...)
*/
- function db_save_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$templates,$hostid=null){
- if( !eregi('^'.ZBX_EREG_HOST_FORMAT.'$', $host) )
- {
+ function db_save_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$templates,$hostid=null){
+
+ if(!eregi('^'.ZBX_EREG_HOST_FORMAT.'$', $host)){
error("Incorrect characters used for Hostname");
return false;
}
- if ( !empty($dns) && !eregi('^'.ZBX_EREG_DNS_FORMAT.'$', $dns))
- {
+ if(!empty($dns) && !eregi('^'.ZBX_EREG_DNS_FORMAT.'$', $dns)){
error("Incorrect characters used for DNS");
return false;
}
@@ -229,7 +228,7 @@ require_once "include/httptest.inc.php";
if($result) $result = $hostid;
- return $result;
+ return $result;
}
/*
@@ -245,7 +244,7 @@ require_once "include/httptest.inc.php";
*
* NOTE: templates = array(id => name, id2 => name2, ...)
*/
- function add_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$templates,$newgroup,$groups){
+ function add_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$templates,$newgroup,$groups){
$hostid = db_save_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$templates);
if(!$hostid)
return $hostid;
@@ -287,7 +286,7 @@ require_once "include/httptest.inc.php";
$new_templates = array_diff($templates, $old_templates);
- $result = db_save_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$new_templates,$hostid);
+ $result = (bool) db_save_host($host,$port,$status,$useip,$dns,$ip,$proxy_hostid,$new_templates,$hostid);
if(!$result)
return $result;
@@ -298,7 +297,7 @@ require_once "include/httptest.inc.php";
sync_host_with_templates($hostid,array_keys($new_templates));
}
- return $result;
+ return $result;
}
/*
@@ -603,8 +602,7 @@ require_once "include/httptest.inc.php";
' and status in ('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.')'
);
}
- else
- {
+ else{
return 1;
}
}
diff --git a/frontends/php/include/items.inc.php b/frontends/php/include/items.inc.php
index ee13f9b2..5552f4a5 100644
--- a/frontends/php/include/items.inc.php
+++ b/frontends/php/include/items.inc.php
@@ -284,7 +284,7 @@
DBexecute('INSERT INTO items_applications (itemappid,itemid,applicationid) VALUES('.$itemappid.','.$itemid.','.$appid.')');
}
- info('Added new item '.$host['host'].':$key');
+ info('Added new item '.$host['host'].':'.$key);
// add items to child hosts
@@ -473,8 +473,7 @@
$item_data = get_item_by_itemid($itemid);
- foreach($restore_rules as $var_name => $info)
- {
+ foreach($restore_rules as $var_name => $info){
if (!isset($info['db_varname'])) $info['db_varname'] = $var_name;
if ($item_data['type'] == ITEM_TYPE_HTTPTEST && !isset($info['httptest']))
diff --git a/frontends/php/include/triggers.inc.php b/frontends/php/include/triggers.inc.php
index d2b6a68c..575278cd 100644
--- a/frontends/php/include/triggers.inc.php
+++ b/frontends/php/include/triggers.inc.php
@@ -1417,7 +1417,6 @@
delete_dependencies_by_triggerid($triggerid);
-
foreach($deps as $id => $triggerid_up){
if(!$result2=add_trigger_dependency($triggerid, $triggerid_up)){
error(S_INCORRECT_DEPENDENCY.' ['.expand_trigger_description($triggerid_up).']');