diff options
author | Aaron Parecki <aaron@parecki.com> | 2017-01-17 09:24:41 -0800 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2017-01-17 09:24:41 -0800 |
commit | 0e8ee9973a550a3ab0a2069d9a12b683651b7d9b (patch) | |
tree | a6f5449d8dd09e815ad659396a1aaa350354215e /controllers/controllers.php | |
parent | 3bdcd009c8817df5275041d5c4d72c716d660456 (diff) |
use `mp-syndicate-to` by default, add setting
* adds setting to choose the property to use for the syndication targets
* all existing users default to the old value `syndicate-to`
* new users default to `mp-syndicate-to`
closes #66
Diffstat (limited to 'controllers/controllers.php')
-rw-r--r-- | controllers/controllers.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php index 505589f..3f95147 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -115,6 +115,7 @@ $app->get('/bookmark', function() use($app) { 'bookmark_tags' => $tags, 'token' => generate_login_token(), 'syndication_targets' => json_decode($user->syndication_targets, true), + 'user' => $user, 'authorizing' => false )); } @@ -323,6 +324,9 @@ $app->post('/settings/save', function() use($app) { if(array_key_exists('slug_field', $params) && $params['slug_field']) $user->micropub_slug_field = $params['slug_field']; + if(array_key_exists('syndicate_field', $params) && $params['syndicate_field']) + $user->micropub_syndicate_field = $params['syndicate_field']; + $user->save(); $app->response()['Content-type'] = 'application/json'; $app->response()->body(json_encode(array( |