From d30486e7c610e2ba2998ed5997fd86c6dcae5c77 Mon Sep 17 00:00:00 2001 From: David Shanske Date: Sun, 24 Feb 2019 19:44:12 +0000 Subject: [PATCH] Simple Addition of Profile Data to Quill --- lib/helpers.php | 11 +++++++++++ views/index.php | 10 +++++++++- views/settings.php | 7 +++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/helpers.php b/lib/helpers.php index 36e964b..0edaa5c 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -42,6 +42,17 @@ function session($key) { return null; } +function profile($key) { + if ( ! session('auth') ) { + return null; + } + $auth = session('auth'); + if ( array_key_exists('profile', $auth) && array_key_exists($key, $auth['profile'] ) ) { + return $auth['profile'][$key]; + } + return null; + } + function k($a, $k, $default=null) { if(is_array($k)) { $result = true; diff --git a/views/index.php b/views/index.php index f60b560..4277fe1 100644 --- a/views/index.php +++ b/views/index.php @@ -5,7 +5,15 @@

Quill is a simple app for posting text notes to your website.

- + Profile Image +

+ +

You're already signed in!

Continue

diff --git a/views/settings.php b/views/settings.php index f94b9fe..51d3a6b 100644 --- a/views/settings.php +++ b/views/settings.php @@ -8,6 +8,13 @@ me user->url; ?> (should be your URL) + + + User Name + + + scope user->micropub_scope ?> (should be a space-separated list of permissions including "create")