diff options
| author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-01 08:42:44 +0000 |
|---|---|---|
| committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-01 08:42:44 +0000 |
| commit | 5d4cf5c68822f6cca3241cf88a5b383fe09df923 (patch) | |
| tree | fdddf76401aa525898e11d7cbb8e8e932bcc2ae2 /frontends/php/scripts_exec.php | |
| parent | ed11a2ed5b13699b30ba1d36f868c2ade959d3a1 (diff) | |
| download | zabbix-5d4cf5c68822f6cca3241cf88a5b383fe09df923.tar.gz zabbix-5d4cf5c68822f6cca3241cf88a5b383fe09df923.tar.xz zabbix-5d4cf5c68822f6cca3241cf88a5b383fe09df923.zip | |
- [DEV-75] Empty command result window
- [DEV-74] Scripts of all nodes are displayed
[svn merge -r4948:4957 svn://svn.zabbix.com/branches/1.4.j]
git-svn-id: svn://svn.zabbix.com/trunk@4958 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/scripts_exec.php')
| -rw-r--r-- | frontends/php/scripts_exec.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/frontends/php/scripts_exec.php b/frontends/php/scripts_exec.php index ec587c86..4c01f23d 100644 --- a/frontends/php/scripts_exec.php +++ b/frontends/php/scripts_exec.php @@ -26,9 +26,9 @@ $page['title'] = "S_SCRIPTS"; $page['file'] = 'scripts_exec.php'; - + define('ZBX_PAGE_NO_MENU', 1); - + include_once "include/page_header.php"; //---------------------------------- CHECKS ------------------------------------ @@ -38,17 +38,16 @@ include_once "include/page_header.php"; $fields=array( 'hostid'=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), 'scriptid'=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({execute})'), - 'execute'=> array(T_ZBX_INT, O_OPT, P_ACT, IN('0,1'), null), + 'execute'=> array(T_ZBX_INT, O_OPT, P_ACT, IN('0,1'), null), ); - check_fields($fields); if(isset($_REQUEST['execute'])){ if($script = get_script_by_scriptid($_REQUEST['scriptid'])){ if($script['host_access'] == SCRIPT_HOST_ACCESS_WRITE){ - $hosts_read_write = explode(',',get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_WRITE,null,null,get_current_nodeid())); - + $hosts_read_write = explode(',',get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_WRITE,null,null,null,$_REQUEST['hostid'])); + if(in_array($_REQUEST['hostid'],$hosts_read_write)){ //SDI('WRITE: '.$_REQUEST['scriptid'].' : '.$_REQUEST['hostid']); // $result = execute_script($_REQUEST['scriptid'],$_REQUEST['hostid']); @@ -56,10 +55,9 @@ if(isset($_REQUEST['execute'])){ insert_command_result_form($_REQUEST['scriptid'],$_REQUEST['hostid']); /* echo nl2br(htmlspecialchars($result));*/ } - } - else{ - $hosts_read_only = explode(',',get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,null,null,get_current_nodeid())); - + } else { + $hosts_read_only = explode(',',get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,null,null,null,$_REQUEST['hostid'])); + if(in_array($_REQUEST['hostid'],$hosts_read_only)){ //SDI('READ: '.$_REQUEST['scriptid'].' : '.$_REQUEST['hostid']); // $result = execute_script($_REQUEST['scriptid'],$_REQUEST['hostid']); |
