diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-27 13:28:14 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-27 13:28:14 +0000 |
| commit | ffce4b50729fa5ee0e11a666fb0ee4b76eebf342 (patch) | |
| tree | eaf9fe556248da6ca281ce8336f35d46bc45eb40 /frontends/php/include/actions.inc.php | |
| parent | e6d3bc1a6eae3d6847198856e7e7f57eb8a0c98b (diff) | |
| download | zabbix-ffce4b50729fa5ee0e11a666fb0ee4b76eebf342.tar.gz zabbix-ffce4b50729fa5ee0e11a666fb0ee4b76eebf342.tar.xz zabbix-ffce4b50729fa5ee0e11a666fb0ee4b76eebf342.zip | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@2431 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/actions.inc.php')
| -rw-r--r-- | frontends/php/include/actions.inc.php | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php index fed442eb..7b6b4370 100644 --- a/frontends/php/include/actions.inc.php +++ b/frontends/php/include/actions.inc.php @@ -62,13 +62,13 @@ # Add Action - function add_action( $filter_triggerid, $userid, $good, $delay, $subject, $message, $scope, $severity, $recipient, $usrgrpid, $maxrepeats, $repeatdelay) + function add_action( $userid, $good, $delay, $subject, $message, $recipient, $usrgrpid, $maxrepeats, $repeatdelay) { - if(!check_right_on_trigger("A",$triggerid)) - { - error("Insufficient permissions"); - return 0; - } +// if(!check_right_on_trigger("A",$triggerid)) +// { +// error("Insufficient permissions"); +// return 0; +// } if($recipient == RECIPIENT_TYPE_USER) { @@ -79,7 +79,7 @@ $id = $usrgrpid; } - $sql="insert into actions (tilter_triggerid,userid,good,delay,nextcheck,subject,message,severity,recipient,maxrepeats,repeatdelay) values ($filter_triggerid,$id,$good,$delay,0,'$subject','$message',$severity,$recipient,$maxrepeats,$repeatdelay)"; + $sql="insert into actions (userid,good,delay,nextcheck,subject,message,recipient,maxrepeats,repeatdelay) values ($id,$good,$delay,0,'$subject','$message',$recipient,$maxrepeats,$repeatdelay)"; $result=DBexecute($sql); return DBinsert_id($result,"actions","actionid"); } @@ -264,4 +264,41 @@ } return $desc; } + + function get_condition_desc($conditiontype, $operator, $value) + { + if($operator == CONDITION_OPERATOR_EQUAL) + { + $op="="; + } + else if($operator == CONDITION_OPERATOR_NOT_EQUAL) + { + $op="<>"; + } + + $desc=S_UNKNOWN; + if($conditiontype==CONDITION_TYPE_GROUP) + { + $group=get_group_by_groupid($value); + if($group) $desc=S_HOST_GROUP." $op "."\"".$group["name"]."\""; + } + else if($conditiontype==CONDITION_TYPE_TRIGGER_NAME) + { + $desc=S_TRIGGER_DESCRIPTION." $op "."\"".$value."\""; + } + else + { + } + return $desc; + } + + # Add Action's condition + + function add_action_condition($actionid, $conditiontype, $operator, $value) + { + $value=addslashes($value); + $sql="insert into conditions (actionid,conditiontype,operator,value) values ($actionid,$conditiontype,$operator,'$value')"; + $result=DBexecute($sql); + return DBinsert_id($result,"conditions","conditionid"); + } ?> |
