summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/hosts.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-14 14:05:01 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-14 14:05:01 +0000
commit3273577ef09fe936c968074b9c7ef199ff122c70 (patch)
tree7c3ecd865fae23cb02067d8e2370b33b2660bb0b /frontends/php/include/hosts.inc.php
parent51d63bbf1dbe38e07b0e54a395571bfdecc565e5 (diff)
- merged -r4295:4296 of branches/1.4.1/ (Eugene) [fixed template aplication synchronization]
git-svn-id: svn://svn.zabbix.com/trunk@4297 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
-rw-r--r--frontends/php/include/hosts.inc.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 52f8b3ef..04fa2422 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -260,7 +260,7 @@ require_once "include/items.inc.php";
******************************************************************************/
function unlink_template($hostid, $templateid, $unlink_mode = true)
{
- if(is_array($templateid)) fatal_error('array not supported for [unlink_template]');
+ if( !is_numeric($templateid) ) fatal_error('Not supported type for [templateid] in [unlink_template] - ['.$templateid.']');
delete_template_elements($hostid, $templateid, $unlink_mode);
DBexecute("delete from hosts_templates where hostid=".$hostid.' and templateid='.$templateid);
@@ -824,7 +824,7 @@ require_once "include/items.inc.php";
* Comments: !!! Don't forget sync code with C !!! *
* *
******************************************************************************/
- function delete_template_applications($hostid, $templateid = null /* array format 'arr[id]=name' */, $unlink_mode = false)
+ function delete_template_applications($hostid, $templateid = null, $unlink_mode = false)
{
$db_apps = get_applications_by_hostid($hostid);
while($db_app = DBfetch($db_apps))
@@ -834,11 +834,13 @@ require_once "include/items.inc.php";
if($templateid != null)
{
+ if( !is_array($templateid))
+ $templateid = array($templateid);
+
unset($skip);
- $db_tmp_apps =& get_applications_by_hostid($db_app["templateid"]);
- while($tmp_apps_data = DBfetch($db_tmp_apps))
+ if( ($tmp_app_data = get_application_by_applicationid($db_app["templateid"])) )
{
- if(!isset($templateid[$tmp_app_data["hostid"]]))
+ if( !in_array($tmp_app_data["hostid"], $templateid) )
{
$skip = true;
break;