aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-11 11:43:56 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-03-11 11:43:56 +0000
commit2506daa080f44cca1d62efe5d2c2b68e0fe9c284 (patch)
tree945405322bca4d1f5c4dc4950fd3366adf6faf20 /engine
parent8aa66785033b40cad44c1e3a9c9c11b4285d407f (diff)
downloadelgg-2506daa080f44cca1d62efe5d2c2b68e0fe9c284.tar.gz
elgg-2506daa080f44cca1d62efe5d2c2b68e0fe9c284.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Site id specified git-svn-id: https://code.elgg.org/elgg/trunk@153 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r--engine/lib/api.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/engine/lib/api.php b/engine/lib/api.php
index 7e685cdd6..3f97b0c8c 100644
--- a/engine/lib/api.php
+++ b/engine/lib/api.php
@@ -198,6 +198,9 @@
$site = (int)$site;
$token = sanitise_string($token);
+ if (!$site) throw new ConfigurationException("No site ID has been specified.");
+ if (!$token) throw new APIException("User token not specified.");
+
$time = time();
$user = get_data_row("SELECT * from {$CONFIG->dbprefix}users_apisessions where token='$token' and site_id=$site and expires>$time");