remember if the user checks the "location" checkbox and always find their location in the future if so

This commit is contained in:
Aaron Parecki 2014-05-24 14:55:15 -07:00
parent 3f82ec2f75
commit e357730b31
3 changed files with 73 additions and 24 deletions

View file

@ -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);
});