From 2bb18a66be585384acd5a4068a4311a976e28c57 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Tue, 8 Sep 2015 22:55:56 -0700 Subject: add banner to opt in to html content change --- controllers/controllers.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'controllers/controllers.php') diff --git a/controllers/controllers.php b/controllers/controllers.php index b3e23a7..70e84cf 100644 --- a/controllers/controllers.php +++ b/controllers/controllers.php @@ -271,6 +271,24 @@ $app->get('/settings', function() use($app) { } }); +$app->post('/settings/html-content', function() use($app) { + if($user=require_login($app)) { + $params = $app->request()->params(); + $user->micropub_optin_html_content = $params['html'] ? 1 : 0; + $user->save(); + $app->response()->body(json_encode(array( + 'html' => $user->micropub_optin_html_content + ))); + } +}); +$app->get('/settings/html-content', function() use($app) { + if($user=require_login($app)) { + $app->response()->body(json_encode(array( + 'html' => $user->micropub_optin_html_content + ))); + } +}); + $app->get('/favorite-popup', function() use($app) { if($user=require_login($app)) { $params = $app->request()->params(); -- cgit v1.2.3