summaryrefslogtreecommitdiff
path: root/controllers/controllers.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2015-09-08 22:55:56 -0700
committerAaron Parecki <aaron@parecki.com>2015-09-08 22:55:56 -0700
commit2bb18a66be585384acd5a4068a4311a976e28c57 (patch)
tree1f2dc711454a24d76f8004836419ed035f4e22f8 /controllers/controllers.php
parent881550cac72bfcc2e7551fe13288ea8a1d27ca34 (diff)
add banner to opt in to html content change
Diffstat (limited to 'controllers/controllers.php')
-rw-r--r--controllers/controllers.php18
1 files changed, 18 insertions, 0 deletions
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();