Skip to content

Commit

Permalink
Auth within add_player api call
Browse files Browse the repository at this point in the history
  • Loading branch information
silasary committed Jan 27, 2024
1 parent 57d3d14 commit 391aff2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gatherling/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@

case 'eventinfo':
case 'event_info':
$eventname = $_REQUEST['event'];
$event = new Event($eventname);
$result = repr_json_event($event);
if (Event::exists(arg('event'))) {
$event = new Event(arg('event'));
$result = repr_json_event($event);
} else {
$result['error'] = 'Event not found';
}
break;


case 'seriesinfo':
case 'series_info':
$seriesname = $_REQUEST['series'];
Expand All @@ -47,6 +51,7 @@

case 'addplayer':
case 'add_player':
auth();
$event = new Event(arg('event'));
$player = arg('addplayer');
$decklist = arg('decklist', '');
Expand Down

0 comments on commit 391aff2

Please sign in to comment.