login/edit: separate columns declaration
[minimedit.git] / login / edit.php
index 4a2e6f4665c39d429d08a8fea4203ee401878150..15b0a2a7dbebd8ded892b98a882bd9d5ee1cef8a 100644 (file)
@@ -14,32 +14,7 @@ and !empty($Place['user']) and $Place['user'] !== $User['name']) {
        ];
 }
 
-$cols = [
-       'name'  => [
-               'label' => 'volledige naam',
-               'explain' => "Alleen zichtbaar voor andere leden.",
-               'filter' => ["\n", '; '],
-               'size' => 30,
-               'filename' => 'name.txt',
-       ],
-       'email' => [
-               'label' => 'e-mailadres',
-               'type' => 'email',
-               'explain' => "Voor contact van of met deze site. Wij zullen dit nooit vrij- of doorgeven.",
-               'size' => 30,
-               'filename' => 'email.txt',
-       ],
-       'avatar' => [
-               'label' => 'portretfoto',
-               'type' => 'file',
-               'filename' => 'avatar.jpg',
-       ],
-       'tags' => [
-               'label' => 'groepen',
-               'values' => [],
-               'filename' => 'profile/.tags',
-       ],
-];
+require_once('edit.inc.php');
 
 foreach ($cols as $col => &$colconf) {
        if (!isset($colconf['filename'])) {
@@ -85,29 +60,6 @@ foreach ($cols as $col => &$colconf) {
        $colconf['target'] = $colpath;  # editing allowed
 }
 
-$cols = [
-       'username' => [
-               'label' => 'login',
-               'value' => $user['name'],
-               'target' => NULL,
-               'pattern' => "[a-z0-9-]+",
-               'size' => 10,
-       ],
-] + $cols;
-
-if (isset($user['pass'])) {
-       $cols['newpass'] = [
-               'label' => 'wachtwoord',
-               'input' => <<<'EOT'
-                       <input type="password" name="oldpass" value="" placeholder="Huidig wachtwoord" />
-                       <input type="password" id="newpass" name="newpass" value="" placeholder="Nieuw wachtwoord" />
-                       <input type="password" name="passconf" value="" placeholder="Nogmaals" />
-EOT
-               ,
-               'hide'  => 'pass',
-       ];
-}
-
 $colwarn = [];
 if ($_POST) {
        if (!file_exists($user['dir']) and !@mkdir($user['dir'])) {