Refactored Http.

This commit is contained in:
Dmitry Khomutov 2018-03-04 17:22:14 +07:00
commit 1fdf9a7ab1
No known key found for this signature in database
GPG key ID: EC19426474B37AAC
19 changed files with 48 additions and 42 deletions

View file

@ -7,6 +7,7 @@ use PHPCensor\Exception\HttpException\NotFoundException;
use b8\Form;
use PHPCensor\Controller;
use PHPCensor\Helper\Lang;
use PHPCensor\Http\Response\RedirectResponse;
use PHPCensor\Model\User;
use PHPCensor\Service\UserService;
use PHPCensor\View;
@ -183,7 +184,7 @@ class UserController extends Controller
$this->userService->createUser($name, $email, 'internal', json_encode(['type' => 'internal']), $password, $isAdmin);
$response = new b8\Http\Response\RedirectResponse();
$response = new RedirectResponse();
$response->setHeader('Location', APP_URL . 'user');
return $response;
}
@ -224,7 +225,7 @@ class UserController extends Controller
$this->userService->updateUser($user, $name, $email, $password, $isAdmin);
$response = new b8\Http\Response\RedirectResponse();
$response = new RedirectResponse();
$response->setHeader('Location', APP_URL . 'user');
return $response;
}
@ -298,7 +299,7 @@ class UserController extends Controller
$this->userService->deleteUser($user);
$response = new b8\Http\Response\RedirectResponse();
$response = new RedirectResponse();
$response->setHeader('Location', APP_URL . 'user');
return $response;
}