forked from science-ation/science-ation
Oops, i never committed this before - add configerence id as an optional parameter to /auth/login
This commit is contained in:
parent
00f380483b
commit
7113a3df95
8
api.php
8
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']);
|
||||
|
Loading…
Reference in New Issue
Block a user