summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/hosts.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/php/include/hosts.inc.php')
-rw-r--r--frontends/php/include/hosts.inc.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/frontends/php/include/hosts.inc.php b/frontends/php/include/hosts.inc.php
index 920adde5..9e3caf9b 100644
--- a/frontends/php/include/hosts.inc.php
+++ b/frontends/php/include/hosts.inc.php
@@ -327,12 +327,13 @@ require_once "include/items.inc.php";
* Comments: !!! Don't forget sync code with C !!!
*
*/
- function unlink_template($hostid, $templateid, $unlink_mode = true)
- {
- if( !is_numeric($templateid) ) fatal_error('Not supported type for [templateid] in [unlink_template] - ['.$templateid.']');
+ function unlink_template($hostid, $templateid, $unlink_mode = true){
+ 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);
+ $result = delete_template_elements($hostid, $templateid, $unlink_mode);
+ $result&= DBexecute("delete from hosts_templates where hostid=".$hostid.' and templateid='.$templateid);
+ return $result;
}
/*
@@ -353,6 +354,7 @@ require_once "include/items.inc.php";
delete_template_triggers($hostid, $templateid, $unlink_mode);
delete_template_items($hostid, $templateid, $unlink_mode);
delete_template_applications($hostid, $templateid, $unlink_mode);
+ return true;
}
/*
@@ -1130,8 +1132,7 @@ require_once "include/items.inc.php";
function delete_template_applications($hostid, $templateid = null, $unlink_mode = false)
{
$db_apps = get_applications_by_hostid($hostid);
- while($db_app = DBfetch($db_apps))
- {
+ while($db_app = DBfetch($db_apps)){
if($db_app["templateid"] == 0)
continue;