diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-26 07:59:00 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-06-26 07:59:00 +0000 |
commit | dfbb4a4388893c8c86e2ca78ceb02091ac3ee499 (patch) | |
tree | d3e330d294525a3f714c4560c72119660ecc5d53 /frontends | |
parent | 0524a8a2dfb101e926b5a092c32a3e7c4dbb2543 (diff) | |
download | zabbix-dfbb4a4388893c8c86e2ca78ceb02091ac3ee499.tar.gz zabbix-dfbb4a4388893c8c86e2ca78ceb02091ac3ee499.tar.xz zabbix-dfbb4a4388893c8c86e2ca78ceb02091ac3ee499.zip |
- [DEV-137] fixed screen save problem (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5794 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/php/include/config.inc.php | 14 | ||||
-rw-r--r-- | frontends/php/include/defines.inc.php | 3 | ||||
-rw-r--r-- | frontends/php/include/func.inc.php | 10 | ||||
-rw-r--r-- | frontends/php/include/screens.inc.php | 6 | ||||
-rw-r--r-- | frontends/php/screenconf.php | 4 |
5 files changed, 17 insertions, 20 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 219df8cd..44a3ebf7 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -24,8 +24,8 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!! ?> <?php - require_once "include/func.inc.php"; require_once "include/defines.inc.php"; + require_once "include/func.inc.php"; require_once "include/html.inc.php"; require_once "include/copt.lib.php"; require_once "include/profiles.inc.php"; @@ -1056,7 +1056,17 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!! /*************** END VALUE MAPPING ******************/ /*************** CONVERTING ******************/ - + function zbx_stripslashes($value){ + if(is_array($value)){ + foreach($value as $id => $data) + $value[$id] = zbx_stripslashes($data); + // $value = array_map('zbx_stripslashes',$value); /* don't use 'array_map' it buggy with indexes */ + } elseif (is_string($value)){ + $value = stripslashes($value); + } + return $value; + } + function empty2null($var){ return ($var == "") ? null : $var; } diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php index a21cb69c..2b11a011 100644 --- a/frontends/php/include/defines.inc.php +++ b/frontends/php/include/defines.inc.php @@ -553,5 +553,4 @@ else{ /* init $_REQUEST */ ini_set('variables_order', 'GP'); $_REQUEST = $_POST + $_GET; - -?> +?>
\ No newline at end of file diff --git a/frontends/php/include/func.inc.php b/frontends/php/include/func.inc.php index d3599abe..180b6e37 100644 --- a/frontends/php/include/func.inc.php +++ b/frontends/php/include/func.inc.php @@ -291,14 +291,4 @@ function str_in_array($needle,$haystack,$strict=false){ return false; } -function zbx_stripslashes($value){ - if(is_array($value)){ - foreach($value as $id => $data) - $value[$id] = zbx_stripslashes($data); - // $value = array_map('zbx_stripslashes',$value); /* don't use 'array_map' it buggy with indexes */ - } elseif (is_string($value)){ - $value = stripslashes($value); - } - return $value; -} ?>
\ No newline at end of file diff --git a/frontends/php/include/screens.inc.php b/frontends/php/include/screens.inc.php index 5fa1419b..16d4c47e 100644 --- a/frontends/php/include/screens.inc.php +++ b/frontends/php/include/screens.inc.php @@ -22,14 +22,12 @@ require_once "include/actions.inc.php"; ?> <?php - function screen_accessible($screenid,$perm) - { + function screen_accessible($screenid,$perm){ global $USER_DETAILS; $result = false; - if(DBfetch(DBselect('SELECT screenid FROM screens WHERE screenid='.$screenid.' AND '.DBin_node('screenid', get_current_nodeid($perm))))) - { + if(DBfetch(DBselect('SELECT screenid FROM screens WHERE screenid='.$screenid.' AND '.DBin_node('screenid', get_current_nodeid($perm))))){ $result = true; $available_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY); diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php index 989fe681..e7a22118 100644 --- a/frontends/php/screenconf.php +++ b/frontends/php/screenconf.php @@ -92,9 +92,9 @@ include_once "include/page_header.php"; show_messages($result, S_SCREEN_UPDATED, S_CANNOT_UPDATE_SCREEN); } else { - if(count(get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_RES_IDS_ARRAY))) + if(!count(get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_RES_IDS_ARRAY))) access_deny(); - + DBstart(); add_screen($_REQUEST["name"],$_REQUEST["hsize"],$_REQUEST["vsize"]); $result = DBend(); |