From 28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89 Mon Sep 17 00:00:00 2001 From: osmiy Date: Mon, 23 Oct 2006 07:34:27 +0000 Subject: - developed group permission system (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3371 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/sysmaps.php | 97 ++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 51 deletions(-) (limited to 'frontends/php/sysmaps.php') diff --git a/frontends/php/sysmaps.php b/frontends/php/sysmaps.php index c7f54221..684fc389 100644 --- a/frontends/php/sysmaps.php +++ b/frontends/php/sysmaps.php @@ -19,71 +19,69 @@ **/ ?> -No permissions !"); - show_page_footer(); - exit; - } - update_profile("web.menu.config.last",$page["file"]); -?> +include_once "include/page_header.php"; + insert_confirm_javascript(); +?> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), - "name"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY,"isset({save})"), - "width"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,65535),"isset({save})"), - "height"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,65535),"isset({save})"), - "background"=> array(T_ZBX_STR, O_OPT, NULL, NULL,"isset({save})"), - "label_type"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,4),"isset({save})"), - "label_location"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,3),"isset({save})"), + "name"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, "isset({save})"), + "width"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,65535), "isset({save})"), + "height"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,65535), "isset({save})"), + "backgroundid"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID, "isset({save})"), + "label_type"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,4), "isset({save})"), + "label_location"=> array(T_ZBX_INT, O_OPT, NULL, BETWEEN(0,3), "isset({save})"), +/* Actions */ "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 */ "form"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form_refresh"=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL) -// "triggerid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,'{form}=="update"'), - -// "description"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY,'isset({save})'), -// "expression"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY,'isset({save})'), -// "priority"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3,4,5"),'isset({save})'), -// "comments"=> array(T_ZBX_STR, O_OPT, NULL, NULL,'isset({save})'), -// "url"=> array(T_ZBX_STR, O_OPT, NULL, NULL,'isset({save})'), -// "disabled"=> array(T_ZBX_STR, O_OPT, NULL, NULL,NULL) ); check_fields($fields); + + if(isset($_REQUEST["sysmapid"])) + { + if(!sysmap_accessiable($_REQUEST["sysmapid"],PERM_READ_WRITE)) + access_deny(); + + $sysmap = DBfetch(DBselect("select * from sysmaps where sysmapid=".$_REQUEST["sysmapid"])); + } ?> - - - - - AddItem(new CButton("form",S_CREATE_MAP)); - show_header2(S_CONFIGURATION_OF_NETWORK_MAPS, $form); + show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form); echo BR; ?> - setHeader(array(S_ID,S_NAME,S_WIDTH,S_HEIGHT,S_MAP)); + $table->SetHeader(array(S_NAME,S_WIDTH,S_HEIGHT,S_MAP)); - $result=DBselect("select sysmapid,name,width,height from sysmaps where mod(sysmapid,100)=$ZBX_CURNODEID order by name"); + $result = DBselect("select sysmapid,name,width,height from sysmaps ". + " where ".DBid2nodeid("sysmapid")."=".$ZBX_CURNODEID." order by name"); while($row=DBfetch($result)) { - if(!check_right("Network map","U",$row["sysmapid"])) - { - continue; - } - - $table->addRow(array( - $row["sysmapid"], + if(!sysmap_accessiable($row["sysmapid"],PERM_READ_WRITE)) continue; + + $table->AddRow(array( new CLink($row["name"], "sysmaps.php?form=update". "&sysmapid=".$row["sysmapid"]."#form",'action'), $row["width"], @@ -135,10 +129,11 @@ new CLink(S_EDIT,"sysmap.php?sysmapid=".$row["sysmapid"]) )); } - $table->show(); + $table->Show(); } ?> - -- cgit