login/edit: remaining access from user object
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 18 Oct 2019 19:14:46 +0000 (21:14 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 19 Oct 2019 00:22:06 +0000 (02:22 +0200)
Some optional code paths broken by commit v3.9-8-g882347cba8 (2019-06-28)
[auth: store global user metadata in User object].

login/edit.inc.php
widget/login/edit.php

index 77bfc9b5bd246df94271defa965a27a992841265..f2bd27b3e784bd2c96140b4923fb43882b327184 100644 (file)
@@ -2,7 +2,7 @@
 $cols = [
        'username' => [
                'label' => 'login',
-               'value' => $user['name'],
+               'value' => $user->login,
                'target' => NULL,
                'attr' => [
                        'pattern' => "[a-z0-9-]+",
@@ -39,7 +39,7 @@ $cols = [
        ],
 ];
 
-if (isset($user['pass'])) {
+if (isset($user->pass)) {
        $cols['newpass'] = [
                'label' => 'wachtwoord',
                'input' => <<<'EOT'
index 829631e875da16065cf069026ea26fbb4364d3da..d8114ff07b065bb8f8b056453442ddc9a0225c7e 100644 (file)
@@ -194,7 +194,7 @@ foreach ($cols as $col => &$colconf) {
        print "\t";
        printf('<li><label for="%s">%s:</label>', $col, ucfirst($colconf['label']));
        if (@$colconf['type'] == 'file' and isset($colconf['value'])) {
-               $target = $user['dir'] . '/' . $colconf['filename'];
+               $target = $user->dir . '/' . $colconf['filename'];
                printf('<a href="/%s"><img src="/thumb/%s/%s?%s" /></a><br />',
                        $target,
                        200, $target, filemtime($target)