From: Mischa POSLAWSKY Date: Sat, 16 Jun 2018 21:17:03 +0000 (+0200) Subject: login/edit: password input from common form option X-Git-Tag: v3.2~4 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/94f6dcc3be03d69237776d97db4a00745fa1acd6 login/edit: password input from common form option --- diff --git a/login/edit.php b/login/edit.php index 6dfbfab..bd39f5e 100644 --- a/login/edit.php +++ b/login/edit.php @@ -41,6 +41,19 @@ $cols = [ 'login' => ['label' => 'login', 'value' => $user['name'], 'target' => NULL], ] + $cols; +if (isset($user['pass'])) { + $cols['newpass'] = [ + 'label' => 'wachtwoord', + 'input' => <<<'EOT' + + + +EOT + , + 'hide' => 'pass', + ]; +} + $colwarn = []; if ($_POST) { if (!file_exists($user['dir']) and !@mkdir($user['dir'])) { @@ -95,7 +108,7 @@ if ($_POST) { if (!empty($_POST['newpass'])) { require_once('login/pass.inc.php'); if ($error = passform($user, $_POST)) { - $colwarn['pass'] = $error; + $colwarn['newpass'] = $error; } } @@ -125,7 +138,17 @@ foreach ($cols as $col => &$colconf) { ); } - { + if ($hide = @$colconf['hide'] and empty($_POST[$col])) { + printf('Wijzigen'; } - print "\n"; -} -if (isset($user['pass'])) { -?> -
  • - - Wijzigen - - > - - - -$error\n"; } -?> -
  • -\n"; } ?>