|
|
|
|
|
|
|
|
addNavbar($response); |
|
|
addNavbar($response); |
|
|
$response->getBody()->write('logged out'); |
|
|
$response->getBody()->write('logged out'); |
|
|
addFooter($response); |
|
|
addFooter($response); |
|
|
return $response; |
|
|
|
|
|
|
|
|
return $response->withHeader('location', '/')->withStatus(302); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$app->map(['GET', 'POST'],'/login', function (Request $request, Response $response, array $args) { |
|
|
$app->map(['GET', 'POST'],'/login', function (Request $request, Response $response, array $args) { |
|
|
|
|
|
|
|
|
addNavbar($response); |
|
|
addNavbar($response); |
|
|
$response->getBody()->write('logged in'); |
|
|
$response->getBody()->write('logged in'); |
|
|
addFooter($response); |
|
|
addFooter($response); |
|
|
|
|
|
|
|
|
|
|
|
return $response->withHeader('location', '/')->withStatus(302); |
|
|
} else { |
|
|
} else { |
|
|
$response->getBody()->write('username and/or password incorrect'); |
|
|
$response->getBody()->write('username and/or password incorrect'); |
|
|
} |
|
|
} |