diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-09 13:38:49 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-05-09 13:38:49 +0000 |
| commit | 600d1fa907d54c247ab2fdb38573c4503aeffc8a (patch) | |
| tree | 2a19f8ce66f3eb4874763a39e73b4fb6ee6bca3b /frontends/php | |
| parent | aa379c6f18a008a13b3daef3770177da0198ae80 (diff) | |
| download | zabbix-600d1fa907d54c247ab2fdb38573c4503aeffc8a.tar.gz zabbix-600d1fa907d54c247ab2fdb38573c4503aeffc8a.tar.xz zabbix-600d1fa907d54c247ab2fdb38573c4503aeffc8a.zip | |
- increased maximal size of images (Eugene)
- improoved validation
- more
git-svn-id: svn://svn.zabbix.com/trunk@4109 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/config.php | 2 | ||||
| -rw-r--r-- | frontends/php/image.php | 5 | ||||
| -rw-r--r-- | frontends/php/include/config.inc.php | 2 | ||||
| -rw-r--r-- | frontends/php/map.php | 3 | ||||
| -rw-r--r-- | frontends/php/report4.php | 18 | ||||
| -rw-r--r-- | frontends/php/sysmap.php | 4 |
6 files changed, 24 insertions, 10 deletions
diff --git a/frontends/php/config.php b/frontends/php/config.php index 3a54f5d5..85f9335f 100644 --- a/frontends/php/config.php +++ b/frontends/php/config.php @@ -122,7 +122,7 @@ include_once "include/page_header.php"; add_audit(AUDIT_ACTION_UPDATE,AUDIT_RESOURCE_IMAGE,"Image [".$image['name']."] deleted"); unset($_REQUEST["form"]); } - unset($_REQUEST["imageid"]); + unset($image, $_REQUEST["imageid"]); } } elseif(isset($_REQUEST["save"])&&in_array($_REQUEST["config"],array(0,5,7))) diff --git a/frontends/php/image.php b/frontends/php/image.php index 3717c86f..e6a9d4b1 100644 --- a/frontends/php/image.php +++ b/frontends/php/image.php @@ -57,6 +57,8 @@ include_once "include/page_header.php"; $source = ImageCreateFromString($row["image"]); + unset($row); + if($resize == 1) { $src_width = imagesx($source); @@ -98,11 +100,12 @@ include_once "include/page_header.php"; $th_width, $th_height, $src_width, $src_height); + imagedestroy($source); + $source = $thumb; } } ImageOut($source); - ImageDestroy($source); ?> <?php diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 90ec4ab1..0badb8c4 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -1911,6 +1911,8 @@ else if (document.getElementById) ImageJPEG($image); else ImagePNG($image); + + imagedestroy($image); } /* function: diff --git a/frontends/php/map.php b/frontends/php/map.php index 5a05b40d..6434ebeb 100644 --- a/frontends/php/map.php +++ b/frontends/php/map.php @@ -95,7 +95,7 @@ include_once "include/page_header.php"; ImageFilledRectangle($im,0,0,$width,$height,$white); - if(($db_image = get_image_by_imageid($backgroundid, 2))) + if(($db_image = get_image_by_imageid($backgroundid))) { $back = ImageCreateFromString($db_image["image"]); ImageCopy($im,$back,0,0,0,0,imagesx($back),imagesy($back)); @@ -105,6 +105,7 @@ include_once "include/page_header.php"; $x=imagesx($im)/2-ImageFontWidth(4)*strlen($name)/2; ImageString($im, 4,$x,1, $name , $darkred); } + unset($db_image); $str=date("m.d.Y H:i:s",time(NULL)); ImageString($im, 0,imagesx($im)-120,imagesy($im)-12,"$str", $gray); diff --git a/frontends/php/report4.php b/frontends/php/report4.php index cbd63524..dc04f714 100644 --- a/frontends/php/report4.php +++ b/frontends/php/report4.php @@ -38,13 +38,21 @@ include_once "include/page_header.php"; check_fields($fields); ?> <?php - $year = get_request("year", 2006); + $year = get_request("year", intval(date("Y"))); $period = get_request("period", "weekly"); $media_type = get_request("media_type", 0); ?> <?php - define("YEAR_LEFT_SHIFT", 5); - + if( ($min_time = DBfetch(DBselect('select min(clock) as clock from alerts'))) && $min_time['clock']) + { + $MIN_YEAR = intval(date("Y", $min_time['clock'])); + } + + if( !isset($MIN_YEAR) ) + { + $MIN_YEAR = intval(date("Y")); + } + $form = new CForm(); $form->AddItem(SPACE.S_MEDIA_TYPE.SPACE); @@ -69,7 +77,7 @@ include_once "include/page_header.php"; { $form->AddItem(SPACE.S_YEAR.SPACE); $cmbYear = new CComboBox("year", $year, "submit();"); - for($y = date("Y")-YEAR_LEFT_SHIFT; $y <= date("Y"); $y++) + for($y = $MIN_YEAR; $y <= date("Y"); $y++) $cmbYear->AddItem($y, $y); $form->AddItem($cmbYear); } @@ -105,7 +113,7 @@ include_once "include/page_header.php"; switch($period) { case "yearly": - $from = (date("Y") - YEAR_LEFT_SHIFT); + $from = $MIN_YEAR; $to = date("Y"); array_unshift($header, new CCol(S_YEAR,"center")); function get_time($y) { return mktime(0,0,0,1,1,$y); } diff --git a/frontends/php/sysmap.php b/frontends/php/sysmap.php index c0ca255c..1db42031 100644 --- a/frontends/php/sysmap.php +++ b/frontends/php/sysmap.php @@ -48,8 +48,8 @@ include_once "include/page_header.php"; "label_location"=>array(T_ZBX_INT, O_OPT, NULL, IN("-1,0,1,2,3"),'isset({save})'), "linkid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), - "selementid1"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID,'isset({save_link})'), - "selementid2"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID,'isset({save_link})'), + "selementid1"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID.'{}!={selementid2}','isset({save_link})'), + "selementid2"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID.'{}!={selementid1}','isset({save_link})'), "triggerid"=> array(T_ZBX_INT, O_OPT, NULL, DB_ID,'isset({save_link})'), "drawtype_off"=>array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3,4"),'isset({save_link})'), "drawtype_on"=> array(T_ZBX_INT, O_OPT, NULL, IN("0,1,2,3,4"),'isset({save_link})'), |
