From c1a9577153939aad68d3fbdc86e5ca70afa71394 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Thu, 17 Mar 2005 08:09:48 +0000 Subject: - added frontends/php/include/actions.inc.php (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@1699 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/actions.inc.php | 101 ++++++++++++++++++++++++++++++++++ frontends/php/include/config.inc.php | 34 ------------ 2 files changed, 101 insertions(+), 34 deletions(-) create mode 100644 frontends/php/include/actions.inc.php (limited to 'frontends') diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php new file mode 100644 index 00000000..17f332c8 --- /dev/null +++ b/frontends/php/include/actions.inc.php @@ -0,0 +1,101 @@ + +"; + $result=DBselect($sql); + while($row=DBfetch($result)) + { + $sql="insert into actions (triggerid,userid,good,delay,nextcheck,subject,message,scope,severity,recipient) values (".$row["hostid"].",$id,$good,$delay,0,'*Automatically generated*','*Automatically generated*',$scope,$severity,$recipient)"; +// echo "$sql
"; + DBexecute($sql); + } + return TRUE; + } + else + { + $sql="insert into actions (triggerid,userid,good,delay,nextcheck,subject,message,scope,severity,recipient) values ($triggerid,$id,$good,$delay,0,'$subject','$message',$scope,$severity,$recipient)"; + return DBexecute($sql); + } + } + + # Delete Action by userid + + function delete_actions_by_userid( $userid ) + { + $sql="select actionid from actions where userid=$userid"; + $result=DBexecute($sql); + for($i=0;$i diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 8b49352f..4254574a 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1781,13 +1781,6 @@ echo ""; return DBexecute($sql); } - # Update Action - - function update_action( $actionid, $triggerid, $userid, $good, $delay, $subject, $message, $scope, $severity, $recipient, $usrgrpid) - { - delete_action($actionid); - return add_action( $triggerid, $userid, $good, $delay, $subject, $message, $scope, $severity, $recipient, $usrgrpid); - } # Delete System Map @@ -1823,33 +1816,6 @@ echo ""; return DBexecute($sql); } - - # Delete Action by userid - - function delete_actions_by_userid( $userid ) - { - $sql="select actionid from actions where userid=$userid"; - $result=DBexecute($sql); - for($i=0;$i