summaryrefslogtreecommitdiff
path: root/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'controllers')
-rw-r--r--controllers/controllers.php4
-rw-r--r--controllers/micropub.php11
2 files changed, 15 insertions, 0 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php
index a4baa0f..f9fad25 100644
--- a/controllers/controllers.php
+++ b/controllers/controllers.php
@@ -182,8 +182,11 @@ $app->get('/event', function() use($app) {
if($user=require_login($app)) {
$params = $app->request()->params();
+ $channels = $user->channels ? json_decode($user->channels, true) : [];
+
render('event', array(
'title' => 'Event',
+ 'channels' => $channels,
'authorizing' => false
));
}
@@ -362,6 +365,7 @@ $app->get('/settings', function() use($app) {
'title' => 'Settings',
'user' => $user,
'syndication_targets' => json_decode($user->syndication_targets, true),
+ 'channels' => json_decode($user->channels, true),
'authorizing' => false
]);
}
diff --git a/controllers/micropub.php b/controllers/micropub.php
index 6eacd4a..cc1ca02 100644
--- a/controllers/micropub.php
+++ b/controllers/micropub.php
@@ -11,6 +11,17 @@ $app->get('/micropub/syndications', function() use($app) {
}
});
+$app->get('/micropub/channels', function() use($app) {
+ if($user=require_login($app)) {
+ $data = get_micropub_config($user, ['q'=>'config']);
+ $app->response()['Content-type'] = 'application/json';
+ $app->response()->body(json_encode(array(
+ 'channels' => $data['channels'],
+ 'response' => $data['response']
+ )));
+ }
+});
+
$app->post('/micropub/post', function() use($app) {
if($user=require_login($app)) {
$params = $app->request()->params();