summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-10-26 14:58:57 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-10-26 14:58:57 +0000
commit5a32b534095d4ac41fa4efd4b908c0f662203c89 (patch)
treed106dcdf67cc9cb6339716af1251bba564e1dcf3
parente331b0a19b3c199f17469144a16453a6bc18b808 (diff)
Lets keep things simple. quotaimage does not use session stuff
git-svn-id: https://svn.roundcube.net/trunk@2012 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--roundcubemail/bin/quotaimg.php27
1 files changed, 4 insertions, 23 deletions
diff --git a/roundcubemail/bin/quotaimg.php b/roundcubemail/bin/quotaimg.php
index 74a3d994a..a62bf3690 100644
--- a/roundcubemail/bin/quotaimg.php
+++ b/roundcubemail/bin/quotaimg.php
@@ -18,29 +18,10 @@
*/
-// define INSTALL_PATH since it's sort of custom from /bin/quotaimg.php
-define('INSTALL_PATH', str_replace('bin', '', dirname(__FILE__)));
-
-// include environment
-require_once INSTALL_PATH . 'program/include/iniset.php';
-
-// init application and start session with requested task
-$RCMAIL = rcmail::get_instance();
-if (empty($RCMAIL->user->ID)) {
- die('You are not logged in, there is no need you are allowed to render the quota image.');
-}
-
-$used = ((isset($_GET['u']) && !empty($_GET['u'])) || $_GET['u']=='0')?(int)$_GET['u']:'??';
-$quota = ((isset($_GET['q']) && !empty($_GET['q'])) || $_GET['q']=='0')?(int)$_GET['q']:'??';
-$width = empty($_GET['w']) ? 100 : (int)$_GET['w'];
-$height = empty($_GET['h']) ? 14 : (int)$_GET['h'];
-
-// let's apply some sanity
-// @todo Maybe a config option?
-if ($width > 200 || $height > 50) {
- $width = 100;
- $height = 14;
-}
+$used = isset($_GET['u']) ? intval($_GET['u']) : '??';
+$quota = isset($_GET['q']) ? intval($_GET['q']) : '??';
+$width = empty($_GET['w']) ? 100 : min(300, intval($_GET['w']));
+$height = empty($_GET['h']) ? 14 : min(50, intval($_GET['h']));
/**
* Quota display