summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--frontends/php/actionconf.php4
-rw-r--r--frontends/php/include/actions.inc.php29
-rw-r--r--frontends/php/include/config.inc.php7
3 files changed, 16 insertions, 24 deletions
diff --git a/frontends/php/actionconf.php b/frontends/php/actionconf.php
index 485042d9..c8f4fada 100644
--- a/frontends/php/actionconf.php
+++ b/frontends/php/actionconf.php
@@ -253,7 +253,7 @@ include_once 'include/page_header.php';
$_REQUEST['operations'] = get_request('operations',array());
if($new_operation['esc_step_from'] > $new_operation['esc_step_to']) {
- $from = $new_operation['esc_step_to'];
+ $from = $new_operation['esc_step_to'];
$new_operation['esc_step_to'] = $new_operation['esc_step_from'];
$new_operation['esc_step_from'] = $from;
}
@@ -467,6 +467,8 @@ include_once 'include/page_header.php';
$outer_table->AddRow(array($td_l,$td_r));
$frmAction->Additem($outer_table);
+
+ show_messages();
$frmAction->Show();
//*/
}
diff --git a/frontends/php/include/actions.inc.php b/frontends/php/include/actions.inc.php
index 4b4d93b6..c8e08b55 100644
--- a/frontends/php/include/actions.inc.php
+++ b/frontends/php/include/actions.inc.php
@@ -67,7 +67,7 @@ function action_accessible($actionid,$perm){
return $result;
}
-function check_permission_for_action_conditions($conditions){
+function check_permission_for_action_conditions($conditions){
global $USER_DETAILS;
$result = true;
@@ -779,25 +779,20 @@ function validate_condition($conditiontype, $value)
return true;
}
-function validate_operation($operation)
-{
+function validate_operation($operation){
global $USER_DETAILS;
- switch($operation['operationtype'])
- {
+ switch($operation['operationtype']){
case OPERATION_TYPE_MESSAGE:
- switch($operation['object'])
- {
+ switch($operation['object']){
case OPERATION_OBJECT_USER:
- if( !get_user_by_userid($operation['objectid']) )
- {
+ if( !get_user_by_userid($operation['objectid']) ){
error(S_INCORRECT_USER);
return false;
}
break;
case OPERATION_OBJECT_GROUP:
- if( !get_group_by_usrgrpid($operation['objectid']) )
- {
+ if( !get_group_by_usrgrpid($operation['objectid']) ){
error(S_INCORRECT_GROUP);
return false;
}
@@ -814,18 +809,14 @@ function validate_operation($operation)
break;
case OPERATION_TYPE_GROUP_ADD:
case OPERATION_TYPE_GROUP_REMOVE:
- if(!uint_in_array($operation['objectid'],
- get_accessible_groups_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_RES_IDS_ARRAY)))
- {
+ if(!uint_in_array($operation['objectid'], get_accessible_groups_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_RES_IDS_ARRAY))){
error(S_INCORRECT_GROUP);
return false;
}
break;
case OPERATION_TYPE_TEMPLATE_ADD:
case OPERATION_TYPE_TEMPLATE_REMOVE:
- if(!uint_in_array($operation['objectid'],
- get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_RES_IDS_ARRAY)))
- {
+ if(!uint_in_array($operation['objectid'], get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_RES_IDS_ARRAY))){
error(S_INCORRECT_HOST);
return false;
}
@@ -834,14 +825,14 @@ function validate_operation($operation)
error(S_INCORRECT_OPERATION_TYPE);
return false;
}
- return true;
+return true;
}
function validate_commands($commands){
$cmd_list = split("\n",$commands);
foreach($cmd_list as $cmd){
$cmd = trim($cmd, "\x00..\x1F");
- if(!ereg("^(({HOSTNAME})|([0-9a-zA-Z\_\.[.-.]]{1,}))(:|#)[[:print:]]*$",$cmd,$cmd_items)){
+ if(!ereg("^(({HOSTNAME})|".ZBX_EREG_INTERNAL_NAMES.")(:|#)[[:print:]]*$",$cmd,$cmd_items)){
error("Incorrect command: '$cmd'");
return FALSE;
}
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index f07d5a8f..a6389bae 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -748,12 +748,11 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!!
//message scroll if needed
$msg_show = 6;
$msg_font_size = 6;
- $msg_count = count($ZBX_MESSAGES);
+ $msg_count = count($ZBX_MESSAGES) + 1;
if($msg_count > $msg_show) $msg_count = $msg_show;
-
- $msg_count = ($msg_count > $msg_show)?$msg_count:$msg_show;
- $msg_count = ($msg_count * $msg_font_size * 4) + 2;
+
+ $msg_count = ($msg_count * $msg_font_size * 4);
$lst_error->AddOption('style','font-size: '.$msg_font_size.'pt; height: '.$msg_count.'px;');