login/pass: error messages below page title
[minimedit.git] / widget / login / edit.php
index d6ee4c905c8dc5663e76a9d0febfcd478c0eb408..8f96bbd28222cf403f9c87d460721f85f7754609 100644 (file)
@@ -1,21 +1,17 @@
 <?php
-global $User;
-if (empty($user = &$User)) {
-       return;
+global $User, $user;
+if (!$user) {
+       $user = $User;
 }
-
-if ($User->admin
-and !empty($Place['user']) and $Place['user'] !== $User->login) {
-       $username = strtolower($Place['user']);
-       unset($user);
-       $user = new User("profile/$username");
+if (!$user) {
+       return;
 }
 
 require_once('edit.inc.php');
 
 foreach ($cols as $col => &$colconf) {
        if (isset($colconf['visible'])) {
-               if ($colconf['visible'] == 'admin' and !$User->admin) {
+               if ($colconf['visible'] == 'admin' and !$User->admin('user')) {
                        $colconf['visible'] = FALSE;
                        continue;
                }
@@ -160,8 +156,8 @@ if ($_POST) {
                print "<p>Alle instellingen zijn opgeslagen.</p>\n\n";
        }
 }
-
 ?>
+
 <form method="post" enctype="multipart/form-data">
        <ul class="grid">
 <?php
@@ -173,7 +169,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)