@@ -21,7 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | # Throw error if no extensions found |
| 23 | 23 | |
| 24 | - if (false === static::$loader->active()) throw new static::$exception_class; |
|
| 24 | + if (false === static::$loader->active()) { |
|
| 25 | + throw new static::$exception_class; |
|
| 26 | + } |
|
| 25 | 27 | |
| 26 | 28 | # Activate user defined extension |
| 27 | 29 | |
@@ -29,9 +31,10 @@ discard block |
||
| 29 | 31 | |
| 30 | 32 | $name = static::$name; $param = static::$param[static::$loader->section()]; |
| 31 | 33 | |
| 32 | - if (static::$loader->activate(Request::get($name)) || static::$loader->activate(Cookie::get($param))) |
|
| 33 | - |
|
| 34 | + if (static::$loader->activate(Request::get($name)) || static::$loader->activate(Cookie::get($param))) { |
|
| 35 | + |
|
| 34 | 36 | Cookie::set($param, static::$loader->data('name'), static::$cookie_expires); |
| 37 | + } |
|
| 35 | 38 | } |
| 36 | 39 | } |
| 37 | 40 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function getItem(string $name) { |
| 14 | 14 | |
| 15 | - $file_name = ($this->dir_name . $name . '/Config.json'); |
|
| 15 | + $file_name = ($this->dir_name.$name.'/Config.json'); |
|
| 16 | 16 | |
| 17 | 17 | if (null === ($data = JSON::load($file_name))) return null; |
| 18 | 18 | |
@@ -14,11 +14,17 @@ |
||
| 14 | 14 | |
| 15 | 15 | $file_name = ($this->dir_name . $name . '/Config.json'); |
| 16 | 16 | |
| 17 | - if (null === ($data = JSON::load($file_name))) return null; |
|
| 17 | + if (null === ($data = JSON::load($file_name))) { |
|
| 18 | + return null; |
|
| 19 | + } |
|
| 18 | 20 | |
| 19 | - if (null === ($data = Schema::get(static::$schema_prototype)->validate($data))) return null; |
|
| 21 | + if (null === ($data = Schema::get(static::$schema_prototype)->validate($data))) { |
|
| 22 | + return null; |
|
| 23 | + } |
|
| 20 | 24 | |
| 21 | - if (!(static::$extension_class::valid($data['name']) && ($data['name'] === $name))) return null; |
|
| 25 | + if (!(static::$extension_class::valid($data['name']) && ($data['name'] === $name))) { |
|
| 26 | + return null; |
|
| 27 | + } |
|
| 22 | 28 | |
| 23 | 29 | # ------------------------ |
| 24 | 30 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (!Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/login'); |
|
| 15 | + if (!Auth::initial()) Request::redirect(INSTALL_PATH.'/admin/login'); |
|
| 16 | 16 | |
| 17 | 17 | return (new Auth\Action\Register)->handle(); |
| 18 | 18 | } |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (!Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/login'); |
|
| 15 | + if (!Auth::initial()) { |
|
| 16 | + Request::redirect(INSTALL_PATH . '/admin/login'); |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | return (new Auth\Action\Register)->handle(); |
| 18 | 20 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 15 | + if (Auth::initial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
| 16 | 16 | |
| 17 | 17 | return (new Auth\Action\Login)->handle(); |
| 18 | 18 | } |
@@ -12,7 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | protected function handle() { |
| 14 | 14 | |
| 15 | - if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 15 | + if (Auth::initial()) { |
|
| 16 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | return (new Auth\Action\Login)->handle(); |
| 18 | 20 | } |
@@ -20,7 +20,9 @@ |
||
| 20 | 20 | |
| 21 | 21 | # Implement form |
| 22 | 22 | |
| 23 | - if (null !== $this->form) $this->form->implement($contents); |
|
| 23 | + if (null !== $this->form) { |
|
| 24 | + $this->form->implement($contents); |
|
| 25 | + } |
|
| 24 | 26 | |
| 25 | 27 | # ------------------------ |
| 26 | 28 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | private static function send(Entitizer\Entity\User $user, string $view, string $subject, string $link) { |
| 12 | 12 | |
| 13 | - $message = View::get((Auth::admin() ? 'Blocks/Auth/Mail/' : 'Blocks/Profile/Auth/Mail/') . $view); |
|
| 13 | + $message = View::get((Auth::admin() ? 'Blocks/Auth/Mail/' : 'Blocks/Profile/Auth/Mail/').$view); |
|
| 14 | 14 | |
| 15 | 15 | $message->name = $user->name; $message->link = $link; $message->copyright = Date::getYear(); |
| 16 | 16 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $to = $user->email; $sender = Settings::get('site_title'); $reply_to = Settings::get('system_email'); |
| 20 | 20 | |
| 21 | - $from = ((false !== ($host = parse_url(Settings::get('system_url'), PHP_URL_HOST))) ? ('noreply@' . $host) : ''); |
|
| 21 | + $from = ((false !== ($host = parse_url(Settings::get('system_url'), PHP_URL_HOST))) ? ('noreply@'.$host) : ''); |
|
| 22 | 22 | |
| 23 | 23 | return Mailer::send($to, $sender, $from, $reply_to, $subject, $message->getContents(), true); |
| 24 | 24 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | public static function reset(Entitizer\Entity\User $user, string $code) { |
| 29 | 29 | |
| 30 | - $link = (Settings::get('system_url') . (Auth::admin() ? '/admin' : '/profile') . '/recover?code=' . $code); |
|
| 30 | + $link = (Settings::get('system_url').(Auth::admin() ? '/admin' : '/profile').'/recover?code='.$code); |
|
| 31 | 31 | |
| 32 | 32 | return self::send($user, 'Reset', Language::get('MAIL_SUBJECT_RESET'), $link); |
| 33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public static function register(Entitizer\Entity\User $user) { |
| 38 | 38 | |
| 39 | - $link = (Settings::get('system_url') . (Auth::admin() ? '/admin' : '/profile')); |
|
| 39 | + $link = (Settings::get('system_url').(Auth::admin() ? '/admin' : '/profile')); |
|
| 40 | 40 | |
| 41 | 41 | return self::send($user, 'Register', Language::get('MAIL_SUBJECT_REGISTER'), $link); |
| 42 | 42 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | if ($this->form->handle(new Auth\Controller\Reset())) { |
| 22 | 22 | |
| 23 | - Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/login?submitted=reset'); |
|
| 23 | + Request::redirect(INSTALL_PATH.(Auth::admin() ? '/admin' : '/profile').'/login?submitted=reset'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | # ------------------------ |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | if ($this->form->handle(new Auth\Controller\Register())) { |
| 22 | 22 | |
| 23 | - Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/login?submitted=register'); |
|
| 23 | + Request::redirect(INSTALL_PATH.(Auth::admin() ? '/admin' : '/profile').'/login?submitted=register'); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | # ------------------------ |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | if (false !== ($code = Auth::secret())) $this->code = $code; |
| 18 | 18 | |
| 19 | - else Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/reset'); |
|
| 19 | + else Request::redirect(INSTALL_PATH.(Auth::admin() ? '/admin' : '/profile').'/reset'); |
|
| 20 | 20 | |
| 21 | 21 | # Create form |
| 22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | if ($this->form->handle(new Auth\Controller\Recover())) { |
| 28 | 28 | |
| 29 | - Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/login?submitted=recover'); |
|
| 29 | + Request::redirect(INSTALL_PATH.(Auth::admin() ? '/admin' : '/profile').'/login?submitted=recover'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | # ------------------------ |
@@ -14,9 +14,11 @@ |
||
| 14 | 14 | |
| 15 | 15 | # Init user by secret code |
| 16 | 16 | |
| 17 | - if (false !== ($code = Auth::secret())) $this->code = $code; |
|
| 18 | - |
|
| 19 | - else Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/reset'); |
|
| 17 | + if (false !== ($code = Auth::secret())) { |
|
| 18 | + $this->code = $code; |
|
| 19 | + } else { |
|
| 20 | + Request::redirect(INSTALL_PATH . (Auth::admin() ? '/admin' : '/profile') . '/reset'); |
|
| 21 | + } |
|
| 20 | 22 | |
| 21 | 23 | # Create form |
| 22 | 24 | |