summaryrefslogtreecommitdiffstats
path: root/frontends/php/config.php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-11 14:48:34 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-02-11 14:48:34 +0000
commit8e0de84965c91f571e94fa4e1bd7848310a787b3 (patch)
tree36c838de1bbed7a330901d286873fddcde8c9390 /frontends/php/config.php
parentec99dcce124d70002c5eee4af75a9cf57479b2f1 (diff)
downloadzabbix-8e0de84965c91f571e94fa4e1bd7848310a787b3.tar.gz
zabbix-8e0de84965c91f571e94fa4e1bd7848310a787b3.tar.xz
zabbix-8e0de84965c91f571e94fa4e1bd7848310a787b3.zip
- [DEV-112] added themes option in frontend (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5341 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/config.php')
-rw-r--r--frontends/php/config.php56
1 files changed, 37 insertions, 19 deletions
diff --git a/frontends/php/config.php b/frontends/php/config.php
index d4705340..b4b15306 100644
--- a/frontends/php/config.php
+++ b/frontends/php/config.php
@@ -34,7 +34,7 @@ include_once "include/page_header.php";
$fields=array(
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
- "config"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,3,5,6,7,8"), NULL),
+ "config"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,3,5,6,7,8,9"), NULL),
// other form
"alert_history"=> array(T_ZBX_INT, O_NO, NULL, BETWEEN(0,65535), 'isset({config})&&({config}==0)&&isset({save})'),
@@ -65,6 +65,8 @@ include_once "include/page_header.php";
'event_ack_enable'=> array(T_ZBX_INT, O_OPT, P_SYS|P_ACT, IN("0,1"), 'isset({config})&&({config}==8)&&isset({save})'),
'event_expire'=> array(T_ZBX_INT, O_OPT, P_SYS|P_ACT, BETWEEN(1,65535), 'isset({config})&&({config}==8)&&isset({save})'),
'event_show_max'=> array(T_ZBX_INT, O_OPT, P_SYS|P_ACT, BETWEEN(1,65535), 'isset({config})&&({config}==8)&&isset({save})'),
+/* Themes */
+ 'default_theme'=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({config})&&({config}==9)&&isset({save})'),
/* other */
"form"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL),
"form_refresh"=> array(T_ZBX_INT, O_OPT, NULL, NULL, NULL)
@@ -132,16 +134,12 @@ include_once "include/page_header.php";
access_deny();
/* OTHER ACTIONS */
- $result=update_config(
- get_request('event_history'),
- get_request('alert_history'),
- get_request('refresh_unsupported'),
- get_request('work_period'),
- get_request('alert_usrgrpid'),
- get_request('event_ack_enable'),
- get_request('event_expire'),
- get_request('event_show_max')
+ $configs = array(
+ 'event_ack_enable' => get_request('event_ack_enable'),
+ 'event_expire' => get_request('event_expire'),
+ 'event_show_max' => get_request('event_show_max')
);
+ $result=update_config($configs);
show_messages($result, S_CONFIGURATION_UPDATED, S_CONFIGURATION_WAS_NOT_UPDATED);
@@ -158,6 +156,23 @@ include_once "include/page_header.php";
add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_ZABBIX_CONFIG,implode('; ',$msg));
}
}
+ elseif(isset($_REQUEST["save"]) && ($_REQUEST["config"]==9)){
+ if(count(get_accessible_nodes_by_user($USER_DETAILS,PERM_READ_WRITE,PERM_MODE_LT,PERM_RES_IDS_ARRAY,get_current_nodeid())))
+ access_deny();
+
+/* OTHER ACTIONS */
+ $configs = array(
+ 'default_theme' => get_request('default_theme')
+ );
+ $result=update_config($configs);
+
+ show_messages($result, S_CONFIGURATION_UPDATED, S_CONFIGURATION_WAS_NOT_UPDATED);
+
+ if($result){
+ $msg = S_DEFAULT_THEME.' ['.get_request('default_theme').']';
+ add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_ZABBIX_CONFIG,$msg);
+ }
+ }
elseif(isset($_REQUEST["save"])&&uint_in_array($_REQUEST["config"],array(0,5,7)))
{
@@ -165,16 +180,14 @@ include_once "include/page_header.php";
access_deny();
/* OTHER ACTIONS */
- $result=update_config(
- get_request('event_history'),
- get_request('alert_history'),
- get_request('refresh_unsupported'),
- get_request('work_period'),
- get_request('alert_usrgrpid'),
- get_request('event_ack_enable'),
- get_request('event_expire'),
- get_request('event_show_max')
+ $configs = array(
+ 'event_history' => get_request('event_history'),
+ 'alert_history' => get_request('alert_history'),
+ 'refresh_unsupported' => get_request('refresh_unsupported'),
+ 'work_period' => get_request('work_period'),
+ 'alert_usrgrpid' => get_request('alert_usrgrpid')
);
+ $result=update_config($configs);
show_messages($result, S_CONFIGURATION_UPDATED, S_CONFIGURATION_WAS_NOT_UPDATED);
if($result)
@@ -295,6 +308,7 @@ include_once "include/page_header.php";
$cmbConfig->AddItem(0,S_HOUSEKEEPER);
// $cmbConfig->AddItem(2,S_ESCALATION_RULES);
$cmbConfig->AddItem(3,S_IMAGES);
+ $cmbConfig->AddItem(9,S_THEMES);
// $cmbConfig->AddItem(4,S_AUTOREGISTRATION);
$cmbConfig->AddItem(6,S_VALUE_MAPPING);
$cmbConfig->AddItem(7,S_WORKING_TIME);
@@ -332,6 +346,10 @@ include_once "include/page_header.php";
{
insert_event_ack_form();
}
+ elseif($_REQUEST["config"]==9)
+ {
+ insert_themes_form();
+ }
elseif($_REQUEST["config"]==3)
{
if(isset($_REQUEST["form"]))