Changeset 2012 in subversion


Ignore:
Timestamp:
Oct 26, 2008 10:58:57 AM (5 years ago)
Author:
thomasb
Message:

Lets keep things simple. quotaimage does not use session stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/bin/quotaimg.php

    r2002 r2012  
    1919*/ 
    2020 
    21 // define INSTALL_PATH since it's sort of custom from /bin/quotaimg.php 
    22 define('INSTALL_PATH', str_replace('bin', '', dirname(__FILE__))); 
    23  
    24 // include environment 
    25 require_once INSTALL_PATH . 'program/include/iniset.php'; 
    26  
    27 // init application and start session with requested task 
    28 $RCMAIL = rcmail::get_instance(); 
    29 if (empty($RCMAIL->user->ID)) { 
    30     die('You are not logged in, there is no need you are allowed to render the quota image.'); 
    31 } 
    32  
    33 $used   = ((isset($_GET['u']) && !empty($_GET['u'])) || $_GET['u']=='0')?(int)$_GET['u']:'??'; 
    34 $quota  = ((isset($_GET['q']) && !empty($_GET['q'])) || $_GET['q']=='0')?(int)$_GET['q']:'??'; 
    35 $width  = empty($_GET['w']) ? 100 : (int)$_GET['w']; 
    36 $height = empty($_GET['h']) ? 14 : (int)$_GET['h']; 
    37  
    38 // let's apply some sanity 
    39 // @todo Maybe a config option? 
    40 if ($width > 200 || $height > 50) { 
    41     $width = 100; 
    42     $height = 14; 
    43 } 
     21$used   = isset($_GET['u']) ? intval($_GET['u']) : '??'; 
     22$quota  = isset($_GET['q']) ? intval($_GET['q']) : '??'; 
     23$width  = empty($_GET['w']) ? 100 : min(300, intval($_GET['w'])); 
     24$height = empty($_GET['h']) ? 14  : min(50,  intval($_GET['h'])); 
    4425 
    4526/** 
Note: See TracChangeset for help on using the changeset viewer.