X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/f38864d3eacdb90d0fd0d2aa7a8bd88ca9974ff1..2013f7a1c3ef61a66f5b158823d19c8e6ade8886:/login/post/index.php diff --git a/login/post/index.php b/login/post/index.php index e491e35..23c4451 100644 --- a/login/post/index.php +++ b/login/post/index.php @@ -1,7 +1,11 @@ admin('user') and $username = @$_REQUEST['login']) { +if (!$User->login) { + $target = urlencode($_SERVER['REQUEST_URI']); + abort("/login?goto=$target", 303); +} +elseif ($User->admin('user') and $username = @$_REQUEST['login']) { try { $user = new User("profile/$username"); } @@ -9,23 +13,22 @@ if ($User->admin('user') and $username = @$_REQUEST['login']) { printf('

%s

', $e->getMessage()); return; } - $Article->title = $user->login . ': ' . $Article->title; + $Page->title = $user->login . ': ' . $Page->title; } else { $user = $User; } -$Place['login/name'] = $user->name ?: 'bewoner'; -$Place['user'] = $user->login; +$Page->place['login/name'] = $user->name ?: 'bewoner'; +$Page->place['user'] = $user->login; if ( $password = trim(@file_get_contents("{$user->dir}/.passwd")) ) { if (substr($password, 0, 1) == '$') { $password = NULL; // hashed } - $Place['pass'] = htmlspecialchars($password) ?: 'zelf ingesteld'; + $Page->place['pass'] = htmlspecialchars($password) ?: 'zelf ingesteld'; } else { - $Place['pass'] = 'onbekend'; + $Page->place['pass'] = 'onbekend'; } -print ''."\n"; -print $body; +print ''."\n";