forked from science-ation/science-ation
remove the student table from the register_participants_signature auth
add 'participant' to the auth requirement for projects in the API
This commit is contained in:
parent
06fdbe1621
commit
0320f662dd
4
api.php
4
api.php
@ -849,12 +849,12 @@ switch($request[0]) {
|
||||
|
||||
default:
|
||||
$ret['status']="error";
|
||||
$ret['error']="invalidi school API command ({$request[1]})";
|
||||
$ret['error']="invalid school API command ({$request[1]})";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'project':
|
||||
$chk=api_user_auth_required();
|
||||
$chk=api_user_auth_required('participant');
|
||||
if($chk['status']!="ok") {
|
||||
$ret['status']="error";
|
||||
$ret['error']=$chk['error'];
|
||||
|
@ -41,14 +41,12 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
$q=mysql_query("SELECT registrations.id AS regid, students.id AS studentid, students.firstname
|
||||
FROM registrations,students
|
||||
WHERE students.email='{$_SESSION['email']}'
|
||||
AND registrations.num='{$_SESSION['registration_number']}'
|
||||
$q=mysql_query("SELECT registrations.id AS regid
|
||||
FROM registrations
|
||||
WHERE registrations.num='{$_SESSION['registration_number']}'
|
||||
AND registrations.id='{$_SESSION['registration_id']}'
|
||||
AND students.registrations_id=registrations.id
|
||||
AND registrations.conferences_id={$conference['id']}
|
||||
AND students.conferences_id={$conference['id']}");
|
||||
AND registrations.conferences_id={$conference['id']}");
|
||||
|
||||
$registration_number=$_SESSION['registration_number'];
|
||||
$registration_id=$_SESSION['registration_id'];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user