diff options
Diffstat (limited to 'frontends/php/screenedit.php')
-rw-r--r-- | frontends/php/screenedit.php | 61 |
1 files changed, 51 insertions, 10 deletions
diff --git a/frontends/php/screenedit.php b/frontends/php/screenedit.php index ed8481fa..15d131da 100644 --- a/frontends/php/screenedit.php +++ b/frontends/php/screenedit.php @@ -19,26 +19,62 @@ **/ ?> <?php - include "include/config.inc.php"; - include "include/forms.inc.php"; + require_once "include/config.inc.php"; + require_once "include/screens.inc.php"; + require_once "include/forms.inc.php"; + $page["title"] = "S_CONFIGURATION_OF_SCREENS"; $page["file"] = "screenedit.php"; - show_header($page["title"],0,0); + +include_once "include/page_header.php"; + insert_confirm_javascript(); ?> +<?php +// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION + $fields=array( + "screenid"=> array(T_ZBX_INT, O_MAND, P_SYS, DB_ID, null), + + "screenitemid"=>array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '{form}=="update"'), + "resourcetype"=> array(T_ZBX_INT, O_OPT, null, + BETWEEN(SCREEN_RESOURCE_GRAPH,SCREEN_RESOURCE_EVENTS), 'isset({save})'), + "resourceid"=> array(T_ZBX_INT, O_OPT, null, DB_ID, 'isset({save})'), + "width"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(0,65535), null), + "height"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(0,65535), null), + "colspan"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(0,100), null), + "rowspan"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(0,100), null), + "elements"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,65535), null), + "valign"=> array(T_ZBX_INT, O_OPT, null, + BETWEEN(VALIGN_MIDDLE,VALIGN_BOTTOM), null), + "halign"=> array(T_ZBX_INT, O_OPT, null, + BETWEEN(HALIGN_CENTER,HALIGN_RIGHT), null), + "style"=> array(T_ZBX_INT, O_OPT, null, + BETWEEN(STYLE_HORISONTAL,STYLE_VERTICAL), 'isset({save})'), + "url"=> array(T_ZBX_STR, O_OPT, null, null, 'isset({save})'), + "x"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,100), 'isset({save})&&{form}!="update"'), + "y"=> array(T_ZBX_INT, O_OPT, null, BETWEEN(1,100), 'isset({save})&&{form}!="update"'), + + "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null), + "delete"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, null, null), + "cancel"=> array(T_ZBX_STR, O_OPT, P_SYS, null, null), + "form"=> array(T_ZBX_STR, O_OPT, P_SYS, null, null), + "form_refresh"=> array(T_ZBX_INT, O_OPT, null, null, null) + ); + + check_fields($fields); +?> <?php show_table_header(S_CONFIGURATION_OF_SCREEN_BIG); if(isset($_REQUEST["screenid"])) { + if(!screen_accessiable($_REQUEST["screenid"], PERM_READ_WRITE)) + access_deny(); + + $screen = get_screen_by_screenid($_REQUEST["screenid"]); + echo BR; - if(!check_right("Screen","U",$_REQUEST["screenid"])) - { - show_table_header("<font color=\"AA0000\">".S_NO_PERMISSIONS."</font>"); - show_page_footer(); - exit; - } if(isset($_REQUEST["save"])) { if(!isset($_REQUEST["elements"])) $_REQUEST["elements"]=0; @@ -65,6 +101,9 @@ show_messages($result, S_ITEM_ADDED, S_CANNOT_ADD_ITEM); } if($result){ + add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_SCREEN," Name [".$screen['name']."] cell changed ". + (isset($_REQUEST["screenitemid"]) ? "[".$_REQUEST["screenitemid"]."]" : + "[".$_REQUEST["x"].",".$_REQUEST["y"]."]")); unset($_REQUEST["form"]); } } elseif(isset($_REQUEST["delete"])) { @@ -83,5 +122,7 @@ ?> <?php - show_page_footer(); + +include_once "include/page_footer.php"; + ?> |