diff options
author | Aaron Parecki <aaron@parecki.com> | 2014-05-24 14:55:15 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2014-05-24 14:55:15 -0700 |
commit | e357730b316827789a6a677d197a58135033fce6 (patch) | |
tree | 07064e6caa0a695eb5f7cc2ef405eabf1174bc20 /controllers/controllers.php | |
parent | 3f82ec2f757c62c25a31b461e0a0cddc14886117 (diff) |
remember if the user checks the "location" checkbox and always find their location in the future if so
Diffstat (limited to 'controllers/controllers.php')
-rw-r--r-- | controllers/controllers.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/controllers/controllers.php b/controllers/controllers.php index 18879e3..3ff111e 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -32,12 +32,24 @@ $app->get('/new', function() use($app) { 'micropub_scope' => $user->micropub_scope, 'micropub_access_token' => $user->micropub_access_token, 'response_date' => $user->last_micropub_response_date, - 'test_response' => $test_response + 'test_response' => $test_response, + 'location_enabled' => $user->location_enabled )); $app->response()->body($html); } }); +$app->post('/prefs', function() use($app) { + if($user=require_login($app)) { + $params = $app->request()->params(); + $user->location_enabled = $params['enabled']; + $user->save(); + } + $app->response()->body(json_encode(array( + 'result' => 'ok' + ))); +}); + $app->get('/creating-a-token-endpoint', function() use($app) { $app->redirect('http://indiewebcamp.com/token-endpoint', 301); }); |