diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-18 15:53:39 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-18 15:53:39 +0000 |
| commit | 274354c2aff78c8d96f78a36a654b215bd6232fa (patch) | |
| tree | cb9c0d9e87d73dbe98a07fc8f03c4d4eb9644d98 /frontends/php/config.php | |
| parent | 3c99a2e8c2dd141362ccc16ed2e2bd0fb2c60192 (diff) | |
| download | zabbix-274354c2aff78c8d96f78a36a654b215bd6232fa.tar.gz zabbix-274354c2aff78c8d96f78a36a654b215bd6232fa.tar.xz zabbix-274354c2aff78c8d96f78a36a654b215bd6232fa.zip | |
Forntend improvements.
git-svn-id: svn://svn.zabbix.com/trunk@2538 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/config.php')
| -rw-r--r-- | frontends/php/config.php | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/frontends/php/config.php b/frontends/php/config.php index 5bf714e4..fb06552c 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -61,16 +61,30 @@ define("NOT_EMPTY","({}!='')&&"); -// VAR TYPE OPTIONAL TABLE FIELD OPTIONAL VALIDATION EXCEPTION +// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields=array( - "config"=> array(T_ZBX_INT, O_OPT, NULL, NULL, IN("0,1,3,4,5"), NULL), - "refresh_unsupported"=> array(T_ZBX_INT, O_NO, "config", NULL, BETWEEN(30,65535), 'in_array($_REQUEST["config"],0,5)') + "config"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1,3,4,5"), NULL), + + "alert_history"=> array(T_ZBX_INT, O_NO, NULL, BETWEEN(0,65535),'in_array({config},array(0,5))&&({save}=="Save")'), + "alarm_history"=> array(T_ZBX_INT, O_NO, NULL, BETWEEN(0,65535),'in_array({config},array(0,5))&&({save}=="Save")'), + "refresh_unsupported"=> array(T_ZBX_INT, O_NO, NULL, BETWEEN(0,65535),'in_array({config},array(0,5))&&({save}=="Save")'), + + "mediatypeid"=> array(T_ZBX_INT, O_NO, P_SYS, BETWEEN(0,65535),'({config}==1)&&(isset({form}))'), + "type"=> array(T_ZBX_INT, O_NO, NULL, IN("0,1"), '({config}==1)&&(isset({save}))'), + "description"=> array(T_ZBX_STR, O_NO, NULL, NOT_EMPTY, '({config}==1)&&(isset({save}))'), + "smtp_server"=> array(T_ZBX_STR, O_NO, NULL, NOT_EMPTY, '({config}==1)&&({type}==0)'), + "smtp_helo"=> array(T_ZBX_STR, O_NO, NULL, NOT_EMPTY, '({config}==1)&&({type}==0)'), + "smtp_email"=> array(T_ZBX_STR, O_NO, NULL, NOT_EMPTY, '({config}==1)&&({type}==0)'), + "exec_path"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '({config}==1)&&({type}==1)&&isset({save})'), +// "exec_path"=> array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '({config}==1)&&({type}==1)'), + + "imageid"=> array(T_ZBX_INT, O_NO, P_SYS, BETWEEN(0,65535),'{config}==3'), + + "save"=> array(T_ZBX_STR, O_OPT, P_SYS|P_ACT, NULL, NULL), + "delete"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), + "cancel"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), + "form"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL) ); - - if(!check_fields($fields)) - { - show_messages(); - } ?> <?php @@ -79,6 +93,11 @@ $_REQUEST["config"]=@iif(isset($_REQUEST["config"]),$_REQUEST["config"],get_profile("web.config.config",0)); update_profile("web.config.config",$_REQUEST["config"]); + if(check_fields($fields)!=TRUE) + { + show_messages(FALSE, "", "Invalid URL"); + } + if(isset($_REQUEST["save"])&&isset($_REQUEST["config"])&&(in_array($_REQUEST["config"],array(0,5)))) { $result=update_config($_REQUEST["alarm_history"],$_REQUEST["alert_history"],$_REQUEST["refresh_unsupported"]); @@ -104,7 +123,7 @@ } } - if(isset($_REQUEST["save"])&&!isset($_REQUEST["mediatypeid"])&&($_REQUEST["config"]==1)) + if(isset($_REQUEST["save"])&&($_REQUEST["config"]==1)) { if(isset($_REQUEST["mediatypeid"])) { @@ -340,7 +359,7 @@ $result=DBselect("select mt.mediatypeid,mt.type,mt.description,mt.smtp_server,mt.smtp_helo,mt.smtp_email,mt.exec_path from media_type mt order by mt.type"); while($row=DBfetch($result)) { - $description="<a href=\"config.php?config=1&form=0®ister=change&mediatypeid=".$row["mediatypeid"]."\">".$row["description"]."</a>"; + $description="<a href=\"config.php?config=1&form=0&mediatypeid=".$row["mediatypeid"]."\">".$row["description"]."</a>"; if($row["type"]==0) { $type=S_EMAIL; |
