$username = ltrim($Args, '/');
$user = [
'dir' => "profile/$username",
+ 'name' => $username,
];
if (!is_writable($user['dir'])) {
print "<p class=warn>Het is niet mogelijk om de gebruiker <em>{$user['name']}</em> aan te passen.</p>\n\n";
}
$cols = [
+ 'name' => ['label' => 'volledige naam'],
'email' => ['label' => 'e-mailadres', 'type' => 'email'],
];
$colconf['target'] = $colpath; # editing allowed
}
+$cols = [
+ 'login' => ['label' => 'login', 'value' => $user['name'], 'target' => NULL],
+] + $cols;
+
$colwarn = [];
if ($_POST) {
foreach ($_POST as $col => $val) {
}
?>
-<form method="post" class="inline">
+<form method="post">
<p>
Geef een e-mailadres op waarmee we u kunnen bereiken indien nodig.
Wij zullen dit adres nooit vrij- of doorgeven.
<p>
<?php
foreach ($cols as $col => &$colconf) {
- print "\t<input";
+ print "\t";
+ printf('<label for="%s">%s:</label> ', $col, ucfirst($colconf['label']));
+ print "<input";
if (empty($colconf['target'])) print ' readonly';
printf(' type="%s" name="%s" id="%1$s" value="%s"',
@$colconf['type'] ?: 'text',
$col,
htmlspecialchars(@$colconf['value'])
);
- print ' placeholder="Geen '.$colconf['label'].' ingesteld"';
- print " />\n";
+ print ' placeholder="Niet ingesteld"';
+ print " />";
if ($error = @$colwarn[$col]) {
- print "<span class=warn>$error</span>\n";
+ print " <span class=warn>$error</span>\n";
}
+ print "<br />\n";
}
?>
<input type="submit" value="Opslaan" />