-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from netis-cms/dev
Dev
- Loading branch information
Showing
156 changed files
with
1,021 additions
and
1,294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1 @@ | ||
# Disable directory listing for security reasons | ||
<IfModule mod_autoindex.c> | ||
Options -Indexes | ||
</IfModule> | ||
|
||
# Disable listing files | ||
<Files ~ "\.(neon|latte|log|html)$"> | ||
order allow,deny | ||
deny from all | ||
</Files> | ||
Require all denied |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
declare(strict_types=1); | ||
|
||
namespace App\Services; | ||
namespace App\Core\Settings; | ||
|
||
|
||
class Settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Core\Settings; | ||
|
||
use Nette\Application\UI\Presenter; | ||
use Nette\DI\Attributes\Inject; | ||
|
||
|
||
trait SettingsRequire | ||
{ | ||
#[Inject] | ||
public SettingsRepository $settingsRepository; | ||
|
||
|
||
public function injectSettings(Presenter $presenter): void | ||
{ | ||
$presenter->onRender[] = function () use ($presenter) { | ||
$settings = $this->settingsRepository->getSettings(); | ||
$settingsRecords = new Settings( | ||
website: $settings['website'], | ||
description: $settings['description'], | ||
); | ||
$presenter->template->settings = $settingsRecords; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Core\User; | ||
|
||
use Exception; | ||
|
||
|
||
class UserDuplicateEmailException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Core\User; | ||
|
||
use Exception; | ||
|
||
|
||
class UserIdentityException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Core\User; | ||
|
||
use Nette\Application\UI\Presenter; | ||
|
||
|
||
trait UserRequireLogged | ||
{ | ||
public function injectRequireLoggedUser(Presenter $presenter, User $user): void | ||
{ | ||
$presenter->onStartup[] = function () use ($presenter, $user) { | ||
if ($user->isLoggedIn()) { | ||
return; | ||
|
||
} elseif ($user->getLogoutReason() === $user::LogoutInactivity) { | ||
$presenter->flashMessage('You have been signed out due to inactivity. Please sign in again.'); | ||
$presenter->redirect(':Backend:Sign:in', ['backlink' => $presenter->storeRequest()]); | ||
|
||
} else { | ||
$presenter->redirect(':Backend:Sign:in'); | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.