Loading app/Config/Events.php +0 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ use CodeIgniter\Exceptions\FrameworkException; */ Events::on('pre_system', static function () { // @phpstan-ignore-next-line if (ENVIRONMENT !== 'testing') { if (ini_get('zlib.output_compression')) { throw FrameworkException::forEnabledZlibOutputCompression(); Loading @@ -46,8 +45,6 @@ Events::on('pre_system', static function () { * Debug Toolbar Listeners. * -------------------------------------------------------------------- * If you delete, they will no longer be collected. * * @phpstan-ignore-next-line */ if (CI_DEBUG && ! is_cli()) { Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); Loading modules/Auth/Config/Auth.php +17 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Modules\Auth\Config; use CodeIgniter\Shield\Authentication\Actions\ActionInterface; use CodeIgniter\Shield\Authentication\Actions\Email2FA; use CodeIgniter\Shield\Config\Auth as ShieldAuth; use Modules\Auth\Models\UserModel; Loading Loading @@ -75,6 +76,14 @@ class Auth extends ShieldAuth */ public bool $allowRegistration = true; /** * -------------------------------------------------------------------- * Allow Two-Factor Authentication * -------------------------------------------------------------------- * Determines whether email 2FA is enabled. */ public bool $enable2FA = false; /** * -------------------------------------------------------------------- * Welcome Link Lifetime Loading Loading @@ -108,6 +117,8 @@ class Auth extends ShieldAuth public function __construct() { parent::__construct(); $adminGateway = config('Admin') ->gateway; Loading @@ -116,6 +127,12 @@ class Auth extends ShieldAuth 'login' => $adminGateway, 'logout' => $adminGateway, ]; // FIXME: enable2FA config can only be updated in the .env // Using the settings service to have it set in the db causes infinite loop. if ($this->enable2FA) { $this->actions['login'] = Email2FA::class; } } /** Loading modules/Auth/Language/en/Auth.php +4 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,10 @@ return [ 'episodes.manage-publications' => 'Can publish/unpublish episodes and posts of podcast #{id}.', 'episodes.manage-comments' => 'Can create/remove episode comments of podcast #{id}.', ], // missing keys 'code' => 'Your 6-digit code', 'notEnoughPrivilege' => 'You do not have sufficient permissions to access that page.', 'set_password' => 'Set your password', Loading phpstan.neon +5 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,11 @@ parameters: - app/Views/* - modules/*/Views/* - themes/* dynamicConstantNames: - APP_NAMESPACE - CI_DEBUG - ENVIRONMENT - SODIUM_LIBRARY_VERSION ignoreErrors: - '#Cannot access property [\$a-z_]+ on ((array\|)?object)#' - '#^Call to an undefined method CodeIgniter\\Database\\ConnectionInterface#' Loading public/index.php +12 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,18 @@ use CodeIgniter\Config\DotEnv; use Config\Paths; use Config\Services; // Check PHP version. $minPhpVersion = '8.0'; // If you update this, don't forget to update `spark`. if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { $message = sprintf( 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', $minPhpVersion, PHP_VERSION ); exit($message); } // Path to the front controller (this file) define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR); Loading Loading
app/Config/Events.php +0 −3 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ use CodeIgniter\Exceptions\FrameworkException; */ Events::on('pre_system', static function () { // @phpstan-ignore-next-line if (ENVIRONMENT !== 'testing') { if (ini_get('zlib.output_compression')) { throw FrameworkException::forEnabledZlibOutputCompression(); Loading @@ -46,8 +45,6 @@ Events::on('pre_system', static function () { * Debug Toolbar Listeners. * -------------------------------------------------------------------- * If you delete, they will no longer be collected. * * @phpstan-ignore-next-line */ if (CI_DEBUG && ! is_cli()) { Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect'); Loading
modules/Auth/Config/Auth.php +17 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Modules\Auth\Config; use CodeIgniter\Shield\Authentication\Actions\ActionInterface; use CodeIgniter\Shield\Authentication\Actions\Email2FA; use CodeIgniter\Shield\Config\Auth as ShieldAuth; use Modules\Auth\Models\UserModel; Loading Loading @@ -75,6 +76,14 @@ class Auth extends ShieldAuth */ public bool $allowRegistration = true; /** * -------------------------------------------------------------------- * Allow Two-Factor Authentication * -------------------------------------------------------------------- * Determines whether email 2FA is enabled. */ public bool $enable2FA = false; /** * -------------------------------------------------------------------- * Welcome Link Lifetime Loading Loading @@ -108,6 +117,8 @@ class Auth extends ShieldAuth public function __construct() { parent::__construct(); $adminGateway = config('Admin') ->gateway; Loading @@ -116,6 +127,12 @@ class Auth extends ShieldAuth 'login' => $adminGateway, 'logout' => $adminGateway, ]; // FIXME: enable2FA config can only be updated in the .env // Using the settings service to have it set in the db causes infinite loop. if ($this->enable2FA) { $this->actions['login'] = Email2FA::class; } } /** Loading
modules/Auth/Language/en/Auth.php +4 −0 Original line number Diff line number Diff line Loading @@ -80,6 +80,10 @@ return [ 'episodes.manage-publications' => 'Can publish/unpublish episodes and posts of podcast #{id}.', 'episodes.manage-comments' => 'Can create/remove episode comments of podcast #{id}.', ], // missing keys 'code' => 'Your 6-digit code', 'notEnoughPrivilege' => 'You do not have sufficient permissions to access that page.', 'set_password' => 'Set your password', Loading
phpstan.neon +5 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,11 @@ parameters: - app/Views/* - modules/*/Views/* - themes/* dynamicConstantNames: - APP_NAMESPACE - CI_DEBUG - ENVIRONMENT - SODIUM_LIBRARY_VERSION ignoreErrors: - '#Cannot access property [\$a-z_]+ on ((array\|)?object)#' - '#^Call to an undefined method CodeIgniter\\Database\\ConnectionInterface#' Loading
public/index.php +12 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,18 @@ use CodeIgniter\Config\DotEnv; use Config\Paths; use Config\Services; // Check PHP version. $minPhpVersion = '8.0'; // If you update this, don't forget to update `spark`. if (version_compare(PHP_VERSION, $minPhpVersion, '<')) { $message = sprintf( 'Your PHP version must be %s or higher to run CodeIgniter. Current version: %s', $minPhpVersion, PHP_VERSION ); exit($message); } // Path to the front controller (this file) define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR); Loading