From 7113a3df95549e67e3ff6136323d0fe886fb266d Mon Sep 17 00:00:00 2001 From: james Date: Tue, 16 Nov 2010 04:29:16 +0000 Subject: [PATCH] Oops, i never committed this before - add configerence id as an optional parameter to /auth/login --- api.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api.php b/api.php index e20a4b2..926a9fc 100644 --- a/api.php +++ b/api.php @@ -342,12 +342,13 @@ switch($request[0]) { case "auth": /* APIDOC: auth/login description(login to an account) - post(username varchar(64), password varchar(64)) + post(username varchar(64), password varchar(64), conferences_id integer optional) return(account array, roles array, conferences_id integer) */ if($request[1]=="login") { $user = $_POST['username']; $pass = $_POST['password']; + $cid = $_POST['conferences_id']; $accounts_id = try_login($user, $pass); if($accounts_id == false) { @@ -362,9 +363,10 @@ switch($request[0]) { $_SESSION['superuser'] = ($a['superuser'] == 'yes') ? 'yes' : 'no'; $_SESSION['roles']=array(); - $status=user_conference_load($accounts_id,$_SESSION['conferences_id']); + if(!$cid) $cid=$_SESSION['conferences_id']; + $status=user_conference_load($accounts_id,$cid); - $ret['conferences_id']=$_SESSION['conferences_id']; + $ret['conferences_id']=$cid; $ret['status']="ok"; $ret['account']=$a; //$ret['user']=user_load($_SESSION['users_id']);