Compare commits
No commits in common. "9ee8ae39df43391b3965a578db6831b69be6b786" and "88cf11d45d8e6077b81edd76233a922584df71be" have entirely different histories.
9ee8ae39df
...
88cf11d45d
|
@ -12,11 +12,6 @@ ini_set(option: 'display_startup_errors', value: 1);
|
||||||
// no one sane should ignore deprecations
|
// no one sane should ignore deprecations
|
||||||
error_reporting(error_level: E_ALL);
|
error_reporting(error_level: E_ALL);
|
||||||
|
|
||||||
// just during dev
|
|
||||||
opcache_reset();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
require dirname(path: __DIR__) . '/src/bootstrap.php';
|
require dirname(path: __DIR__) . '/src/bootstrap.php';
|
||||||
|
|
|
@ -32,7 +32,6 @@ class SecurityController
|
||||||
$password = $_POST['password'] ?? '';
|
$password = $_POST['password'] ?? '';
|
||||||
|
|
||||||
if ($nick && $password) {
|
if ($nick && $password) {
|
||||||
$nick = strtolower(string: $nick);
|
|
||||||
if ($user = $this->userRepository->findbyNick(nick: $nick)) {
|
if ($user = $this->userRepository->findbyNick(nick: $nick)) {
|
||||||
if (password_verify(password: $password, hash: $user->getPassword())) {
|
if (password_verify(password: $password, hash: $user->getPassword())) {
|
||||||
$_SESSION['user_id'] = $user->getId();
|
$_SESSION['user_id'] = $user->getId();
|
||||||
|
|
|
@ -105,6 +105,7 @@ class AddressRepository
|
||||||
public function update(AddressBookEntry $address): bool|int
|
public function update(AddressBookEntry $address): bool|int
|
||||||
{
|
{
|
||||||
$id = $address->getId();
|
$id = $address->getId();
|
||||||
|
$owner = $address->getOwner();
|
||||||
$first = $address->getFirst();
|
$first = $address->getFirst();
|
||||||
$last = $address->getLast();
|
$last = $address->getLast();
|
||||||
$street = $address->getStreet();
|
$street = $address->getStreet();
|
||||||
|
|
|
@ -71,8 +71,6 @@ class UserRepository
|
||||||
|
|
||||||
public function findByNick(string $nick): ?User
|
public function findByNick(string $nick): ?User
|
||||||
{
|
{
|
||||||
$nick = strtolower(string: $nick);
|
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
SELECT id, nick, password, first, last, is_admin
|
SELECT id, nick, password, first, last, is_admin
|
||||||
FROM " . DatabaseConnection::TABLE_USERS . "
|
FROM " . DatabaseConnection::TABLE_USERS . "
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
namespace App\Service;
|
namespace App\Service;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Router
|
||||||
|
|
||||||
foreach ($this->dynamicRoutes as $route) {
|
foreach ($this->dynamicRoutes as $route) {
|
||||||
// PHPStorm doesn't know that $parameters are always available,
|
// PHPStorm doesn't know that $parameters are always available,
|
||||||
// (as it this are dynamic routes) so I init the array just to make PHPStorm happy.
|
// (as it is a dynamic route) so I init the array just to make PHPStorm happy.
|
||||||
$parameters = [];
|
$parameters = [];
|
||||||
if (preg_match(pattern: $route->getRegex(), subject: $requestUri, matches: $matches)) {
|
if (preg_match(pattern: $route->getRegex(), subject: $requestUri, matches: $matches)) {
|
||||||
foreach ($route->getParameters() as $id => $parameter) {
|
foreach ($route->getParameters() as $id => $parameter) {
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace App\Service;
|
||||||
* using PHP as a templating engine.
|
* using PHP as a templating engine.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use JetBrains\PhpStorm\NoReturn;
|
||||||
|
|
||||||
class Template
|
class Template
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -26,7 +28,8 @@ class Template
|
||||||
/*
|
/*
|
||||||
* Add variables to template and throw it out
|
* Add variables to template and throw it out
|
||||||
*/
|
*/
|
||||||
public function render(string $templateName, array $vars = []): never
|
#[NoReturn]
|
||||||
|
public function render(string $templateName, array $vars = []): void
|
||||||
{
|
{
|
||||||
// assign template vars
|
// assign template vars
|
||||||
foreach ($vars as $name => $value) {
|
foreach ($vars as $name => $value) {
|
||||||
|
|
Loading…
Reference in New Issue