diff options
Diffstat (limited to 'controllers')
-rw-r--r-- | controllers/controllers.php | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php index ef619a6..475e620 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -140,6 +140,18 @@ $app->get('/favorite', function() use($app) { } }); +$app->get('/event', function() use($app) { + if($user=require_login($app)) { + $params = $app->request()->params(); + + $html = render('event', array( + 'title' => 'Event', + 'authorizing' => false + )); + $app->response()->body($html); + } +}); + $app->get('/itinerary', function() use($app) { if($user=require_login($app)) { $params = $app->request()->params(); @@ -486,20 +498,6 @@ $app->post('/repost', function() use($app) { } }); -$app->post('/itinerary', function() use($app) { - if($user=require_login($app)) { - $params = $app->request()->params(); - - $r = micropub_post_for_user($user, json_decode($params['data'], true), null, true); - - $app->response()->body(json_encode(array( - 'location' => $r['location'], - 'error' => $r['error'], - 'response' => $r['response'] - ))); - } -}); - $app->get('/micropub/syndications', function() use($app) { if($user=require_login($app)) { $data = get_syndication_targets($user); @@ -531,6 +529,20 @@ $app->post('/micropub/post', function() use($app) { } }); +$app->post('/micropub/postjson', function() use($app) { + if($user=require_login($app)) { + $params = $app->request()->params(); + + $r = micropub_post_for_user($user, json_decode($params['data'], true), null, true); + + $app->response()->body(json_encode(array( + 'location' => $r['location'], + 'error' => $r['error'], + 'response' => $r['response'] + ))); + } +}); + /* $app->post('/auth/facebook', function() use($app) { if($user=require_login($app, false)) { |