Browse Source
Merge pull request #108 from dshanske/profile
Simple Addition of Profile Data to Quill
pull/110/head
Aaron Parecki
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
27 additions and
1 deletions
-
lib/helpers.php
-
views/index.php
-
views/settings.php
|
@ -42,6 +42,17 @@ function session($key) { |
|
|
return null; |
|
|
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) { |
|
|
function k($a, $k, $default=null) { |
|
|
if(is_array($k)) { |
|
|
if(is_array($k)) { |
|
|
$result = true; |
|
|
$result = true; |
|
|
|
@ -5,7 +5,15 @@ |
|
|
|
|
|
|
|
|
<p class="tagline">Quill is a simple app for posting text notes to your website.</p> |
|
|
<p class="tagline">Quill is a simple app for posting text notes to your website.</p> |
|
|
|
|
|
|
|
|
<? if(session('me')): ?>
|
|
|
|
|
|
|
|
|
<? if(session('me')): |
|
|
|
|
|
if ( profile('photo') ) { |
|
|
|
|
|
?> <img src="<?php echo profile('photo'); ?>" height="125" alt="Profile Image" />
|
|
|
|
|
|
<?php } |
|
|
|
|
|
if ( profile('name') ) { |
|
|
|
|
|
?> <p><?php echo profile('name'); ?></p>
|
|
|
|
|
|
<?php } |
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
<p>You're already signed in!<p> |
|
|
<p>You're already signed in!<p> |
|
|
<p><a href="/dashboard" class="btn btn-primary">Continue</a></p> |
|
|
<p><a href="/dashboard" class="btn btn-primary">Continue</a></p> |
|
|
<? else: ?>
|
|
|
<? else: ?>
|
|
|
|
@ -8,6 +8,13 @@ |
|
|
<td>me</td> |
|
|
<td>me</td> |
|
|
<td><code><?= $this->user->url; ?></code> (should be your URL)</td>
|
|
|
<td><code><?= $this->user->url; ?></code> (should be your URL)</td>
|
|
|
</tr> |
|
|
</tr> |
|
|
|
|
|
<?php if ( profile('name') ) { |
|
|
|
|
|
?>
|
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>User Name</td> |
|
|
|
|
|
<td><code><?= profile('name'); ?></code> </td>
|
|
|
|
|
|
</tr> |
|
|
|
|
|
<?php } ?>
|
|
|
<tr> |
|
|
<tr> |
|
|
<td>scope</td> |
|
|
<td>scope</td> |
|
|
<td><code><?= $this->user->micropub_scope ?></code> (should be a space-separated list of permissions including "create")</td>
|
|
|
<td><code><?= $this->user->micropub_scope ?></code> (should be a space-separated list of permissions including "create")</td>
|
|
|