Changeset 2019 in subversion
- Timestamp:
- Oct 27, 2008 1:49:05 PM (5 years ago)
- File:
-
- 1 edited
-
trunk/roundcubemail/bin/quotaimg.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/bin/quotaimg.php
r2012 r2019 97 97 if (ereg("^[^0-9?]*$", $used) || ereg("^[^0-9?]*$", $total)) { 98 98 return false; 99 }99 } 100 100 101 if (strpos($used, '?') !== false || strpos($total, '?') !== false 102 && $used != 0) { 101 if (strpos($used, '?') !== false || strpos($total, '?') !== false && $used != 0) { 103 102 $unknown = true; 104 }103 } 105 104 106 105 $im = imagecreate($width, $height); … … 154 153 $fill = imagecolorallocate($im, $r, $g, $b); 155 154 } else { 156 // if($quota >= $limit['low'])155 // if($quota >= $limit['low']) 157 156 list($r, $g, $b) = explode(',', $color['fill']['low']); 158 157 $fill = imagecolorallocate($im, $r, $g, $b); … … 164 163 $string = $quota . '%'; 165 164 $mid = floor(($width-(strlen($string)*imagefontwidth($font)))/2)+1; 166 // Print percent in black165 // Print percent in black 167 166 imagestring($im, $font, $mid, $padding, $string, $text); 168 167 } 169 168 170 169 header('Content-Type: image/gif'); 171 172 // @todo is harcoding GMT necessary? 173 header('Expires: ' . gmdate('D, d M Y H:i:s', mktime()+86400) . ' GMT');174 header(' Cache-Control:');175 header(' Pragma: ');170 171 // cache for 1 hour 172 $maxage = 3600; 173 header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$maxage). ' GMT'); 174 header('Cache-Control: max-age=' . $maxage); 176 175 177 176 imagegif($im); … … 179 178 } 180 179 181 genQuota($used, $quota, $width, $height); 180 if ($width > 1 && $height > 1) { 181 genQuota($used, $quota, $width, $height); 182 } 183 else { 184 header("HTTP/1.0 404 Not Found"); 185 } 186 182 187 exit; 183 188 ?>
Note: See TracChangeset
for help on using the changeset viewer.
