From 63a9e4ae1c297d714f8d172da0f2152439f262ea Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 7 Jul 2018 15:01:46 +0200 Subject: [PATCH] login/edit: list user existence in tags Grouping for avatars page. --- login/edit.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/login/edit.php b/login/edit.php index 4002cb9..759eba5 100644 --- a/login/edit.php +++ b/login/edit.php @@ -53,6 +53,36 @@ $cols = [ ], ] + $cols; +$tagdir = 'profile/.tags'; +if (file_exists($tagdir)) { + $tags = []; + foreach (glob("$tagdir/*") as $tag) { + $tagname = pathinfo($tag, PATHINFO_BASENAME); + $target = "$tag/{$user['name']}"; + $tags[$tagname] = file_exists($tagname); + } + + if ($tags) { + $options = ''; + foreach ($tags as $tag => $val) { + $options .= sprintf( + "\n\t\t" . + '' . + ' %s', + $tag, + $val ? ' checked' : '', + ' readonly', + ucfirst($tag) + ); + } + + $cols['tags'] = [ + 'label' => 'groepen', + 'input' => $options, + ]; + } +} + if (isset($user['pass'])) { $cols['newpass'] = [ 'label' => 'wachtwoord', -- 2.30.0