Authenticacion

This commit is contained in:
2020-04-07 15:37:21 -04:00
parent 2ae6826ff4
commit bca4665721
27 changed files with 378 additions and 34 deletions

View File

@ -11,7 +11,7 @@ abstract class Controller implements ControllerInterface {
->withHeader('Content-Type', 'application/json')
->withStatus(201);
}
public function withRedirect(string $uri): Response {
public function withRedirect(Response $response, string $uri): Response {
return $response
->withHeader('Location', $uri)
->withStatus(303);

View File

@ -30,9 +30,12 @@ class Filemanager {
public function folder(string $name) {
return new Filemanager($this->filesystem, $this->folders[$name]);
}
public function exists(string $filename) {
return $this->filesystem->exists($this->fullPath($filename));
}
public function load(string $filename) {
$filename = $this->fullPath($filename);
if (!$this->filesystem->exists($filename)) {
if (!$this->exists($filename)) {
return false;
}
$file = new \SplFileInfo($filename);