@@ -12,14 +12,11 @@ |
||
| 12 | 12 | namespace Icybee\Modules\Users\Block; |
| 13 | 13 | |
| 14 | 14 | use Brickrouge\Group; |
| 15 | - |
|
| 16 | - |
|
| 17 | 15 | use Brickrouge\Document; |
| 18 | 16 | use Brickrouge\Element; |
| 19 | 17 | use Brickrouge\Form; |
| 20 | 18 | use Brickrouge\Text; |
| 21 | 19 | use Brickrouge\Widget; |
| 22 | - |
|
| 23 | 20 | use Icybee\Modules\Users\Module; |
| 24 | 21 | use Icybee\Modules\Users\User; |
| 25 | 22 | |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | Element::GROUPS => [ |
| 67 | 67 | |
| 68 | - 'connection' => [ 'title' => 'Connection' ], |
|
| 69 | - 'advanced' => [ 'title' => 'Advanced' ] |
|
| 68 | + 'connection' => ['title' => 'Connection'], |
|
| 69 | + 'advanced' => ['title' => 'Advanced'] |
|
| 70 | 70 | |
| 71 | 71 | ] |
| 72 | 72 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | Group::LABEL => 'language', |
| 173 | 173 | Element::GROUP => 'advanced', |
| 174 | 174 | Element::DESCRIPTION => 'language', |
| 175 | - Element::OPTIONS => [ null => '' ] + $languages |
|
| 175 | + Element::OPTIONS => [null => ''] + $languages |
|
| 176 | 176 | |
| 177 | 177 | ]), |
| 178 | 178 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | return null; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - $rid = [ 2 => true ]; |
|
| 217 | + $rid = [2 => true]; |
|
| 218 | 218 | |
| 219 | 219 | if ($uid) |
| 220 | 220 | { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | Form::LABEL => 'roles', |
| 237 | 237 | Element::GROUP => 'advanced', |
| 238 | 238 | Element::OPTIONS => $options, |
| 239 | - Element::OPTIONS_DISABLED => [ 2 => true ], |
|
| 239 | + Element::OPTIONS_DISABLED => [2 => true], |
|
| 240 | 240 | Element::REQUIRED => true, |
| 241 | 241 | Element::DESCRIPTION => 'roles', |
| 242 | 242 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | { |
| 256 | 256 | $values = $this->values; |
| 257 | 257 | |
| 258 | - $options = [ '<username>' ]; |
|
| 258 | + $options = ['<username>']; |
|
| 259 | 259 | |
| 260 | 260 | if ($values[User::USERNAME]) |
| 261 | 261 | { |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | * |
| 217 | 217 | * This is the getter for the `$app->user` property. |
| 218 | 218 | * |
| 219 | - * @param Core|CoreBindings|\ICanBoogie\Binding\ActiveRecord\CoreBindings $app |
|
| 219 | + * @param Core $app |
|
| 220 | 220 | * |
| 221 | 221 | * @return User The user object, or guest user object. |
| 222 | 222 | */ |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | /** |
| 276 | 276 | * Checks if a user has a given permission. |
| 277 | 277 | * |
| 278 | - * @param Core|CoreBindings $app |
|
| 278 | + * @param Core $app |
|
| 279 | 279 | * @param User $user |
| 280 | 280 | * @param string $permission |
| 281 | 281 | * @param string $target |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | /** |
| 293 | 293 | * Checks if a user has the ownership of a record. |
| 294 | 294 | * |
| 295 | - * @param Core|CoreBindings $app |
|
| 295 | + * @param Core $app |
|
| 296 | 296 | * @param User $user |
| 297 | 297 | * @param ActiveRecord $record |
| 298 | 298 | * |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | |
| 360 | 360 | /** |
| 361 | - * @return Core|\Icybee\Binding\CoreBindings |
|
| 361 | + * @return Core |
|
| 362 | 362 | */ |
| 363 | 363 | static private function app() |
| 364 | 364 | { |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $event->errors['rid'] = $event->errors->format('The role %name is used by :count users.', [ 'name' => $operation->record->name, ':count' => $count ]); |
|
| 53 | + $event->errors['rid'] = $event->errors->format('The role %name is used by :count users.', ['name' => $operation->record->name, ':count' => $count]); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -233,7 +233,9 @@ |
||
| 233 | 233 | $user = $model[$uid]; |
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | - catch (\Exception $e) {} |
|
| 236 | + catch (\Exception $e) |
|
| 237 | + { |
|
| 238 | +} |
|
| 237 | 239 | |
| 238 | 240 | if (!$user) |
| 239 | 241 | { |
@@ -16,13 +16,10 @@ |
||
| 16 | 16 | use ICanBoogie\HTTP\AuthenticationRequired; |
| 17 | 17 | use ICanBoogie\HTTP\PermissionRequired; |
| 18 | 18 | use ICanBoogie\HTTP\Response; |
| 19 | -use ICanBoogie\HTTP\RequestDispatcher; |
|
| 20 | 19 | use ICanBoogie\HTTP\SecurityError; |
| 21 | 20 | use ICanBoogie\Operation; |
| 22 | 21 | use ICanBoogie\PropertyNotDefined; |
| 23 | 22 | use ICanBoogie\Routing\RouteDispatcher; |
| 24 | -use ICanBoogie\Session; |
|
| 25 | - |
|
| 26 | 23 | use Icybee\Element\AdminDecorator; |
| 27 | 24 | use Icybee\Element\DocumentDecorator; |
| 28 | 25 | use Icybee\Modules\Members\Member; |
@@ -11,15 +11,12 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace Icybee\Modules\Users; |
| 13 | 13 | |
| 14 | -use ICanBoogie\Operation; |
|
| 15 | - |
|
| 16 | 14 | use Brickrouge\A; |
| 17 | 15 | use Brickrouge\Button; |
| 18 | 16 | use Brickrouge\Document; |
| 19 | 17 | use Brickrouge\Element; |
| 20 | 18 | use Brickrouge\Form; |
| 21 | 19 | use Brickrouge\Text; |
| 22 | - |
|
| 23 | 20 | use Icybee\Binding\Core\PrototypedBindings; |
| 24 | 21 | |
| 25 | 22 | class LoginForm extends Form |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | { |
| 51 | 51 | $app = $this->app; |
| 52 | 52 | |
| 53 | - $this->lost_password = new A($this->t('lost_password', [], [ 'scope' => 'users.label', 'default' => 'I forgot my password' ]), "#lost-password", [ |
|
| 53 | + $this->lost_password = new A($this->t('lost_password', [], ['scope' => 'users.label', 'default' => 'I forgot my password']), "#lost-password", [ |
|
| 54 | 54 | |
| 55 | 55 | 'rel' => 'nonce-request' |
| 56 | 56 | |
@@ -11,9 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace Icybee\Modules\Users; |
| 13 | 13 | |
| 14 | -use ICanBoogie\I18n; |
|
| 15 | 14 | use ICanBoogie\Operation; |
| 16 | - |
|
| 17 | 15 | use Brickrouge\Button; |
| 18 | 16 | use Brickrouge\Element; |
| 19 | 17 | use Brickrouge\Form; |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | |
| 82 | 82 | Element::CHILDREN => [ |
| 83 | 83 | |
| 84 | - new Button('logout', [ 'type' => 'submit' ]) |
|
| 84 | + new Button('logout', ['type' => 'submit']) |
|
| 85 | 85 | |
| 86 | 86 | ] |
| 87 | 87 | |
@@ -12,11 +12,9 @@ |
||
| 12 | 12 | namespace Icybee\Modules\Users\Operation; |
| 13 | 13 | |
| 14 | 14 | use ICanBoogie\Errors; |
| 15 | -use ICanBoogie\HTTP\Request; |
|
| 16 | 15 | use ICanBoogie\I18n; |
| 17 | 16 | use ICanBoogie\Operation; |
| 18 | 17 | use ICanBoogie\Module\ControllerBindings as ModuleBindings; |
| 19 | - |
|
| 20 | 18 | use Icybee\Binding\Core\PrototypedBindings; |
| 21 | 19 | use Icybee\Modules\Registry\MetaCollection; |
| 22 | 20 | use Icybee\Modules\Users\LoginForm; |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | attack attempt on the website. If you think this is the case, please contact its admin. |
| 147 | 147 | |
| 148 | 148 | The remote address of the request was: $request->ip. |
| 149 | -EOT |
|
| 149 | +eot |
|
| 150 | 150 | ]); |
| 151 | 151 | |
| 152 | 152 | unset($errors[User::PASSWORD]); |
@@ -91,8 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | if ($login_unlock_time > $now) |
| 93 | 93 | { |
| 94 | - throw new \Exception |
|
| 95 | - ( |
|
| 94 | + throw new \Exception( |
|
| 96 | 95 | \ICanBoogie\format("The user account has been locked after multiple failed login attempts. |
| 97 | 96 | An e-mail has been sent to unlock the account. Login attempts are locked until %time, |
| 98 | 97 | unless you unlock the account using the email sent.", [ |
@@ -168,7 +167,7 @@ discard block |
||
| 168 | 167 | |
| 169 | 168 | if (!$user->is_admin && !$user->is_activated) |
| 170 | 169 | { |
| 171 | - $errors->add_generic("User %username is not activated", [ '%username' => $username ]); |
|
| 170 | + $errors->add_generic("User %username is not activated", ['%username' => $username]); |
|
| 172 | 171 | |
| 173 | 172 | return false; |
| 174 | 173 | } |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | |
| 14 | 14 | use ICanBoogie\Errors; |
| 15 | 15 | use ICanBoogie\Operation; |
| 16 | - |
|
| 17 | 16 | use Icybee\Modules\Users\User; |
| 18 | 17 | |
| 19 | 18 | /** |
@@ -14,11 +14,9 @@ |
||
| 14 | 14 | use ICanBoogie\ActiveRecord; |
| 15 | 15 | use ICanBoogie\ActiveRecord\CreatedAtProperty; |
| 16 | 16 | use ICanBoogie\ActiveRecord\RecordNotFound; |
| 17 | - |
|
| 18 | 17 | use Brickrouge\AlterCSSClassNamesEvent; |
| 19 | 18 | use Brickrouge\CSSClassNames; |
| 20 | 19 | use Brickrouge\CSSClassNamesProperty; |
| 21 | - |
|
| 22 | 20 | use Icybee\Modules\Users\Roles\Role; |
| 23 | 21 | use Icybee\Binding\Core\PrototypedBindings as IcybeeBindings; |
| 24 | 22 | use Icybee\Modules\Registry\Binding\UserBindings as RegistryBindings; |
@@ -355,7 +355,7 @@ |
||
| 355 | 355 | { |
| 356 | 356 | if (!$this->uid) |
| 357 | 357 | { |
| 358 | - return [ $models['users.roles'][1] ]; |
|
| 358 | + return [$models['users.roles'][1]]; |
|
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | 361 | catch (\Exception $e) |
@@ -12,8 +12,6 @@ |
||
| 12 | 12 | namespace Icybee\Modules\Users; |
| 13 | 13 | |
| 14 | 14 | use ICanBoogie\DateTime; |
| 15 | -use ICanBoogie\ActiveRecord; |
|
| 16 | - |
|
| 17 | 15 | use Icybee\ConstructorModel; |
| 18 | 16 | |
| 19 | 17 | class UserModel extends ConstructorModel |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | continue; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - $has_many_roles->execute('INSERT {self} SET uid = ?, rid = ?', [ $rc, $rid ]); |
|
| 76 | + $has_many_roles->execute('INSERT {self} SET uid = ?, rid = ?', [$rc, $rid]); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | foreach ($restricted_sites as $site_id) |
| 90 | 90 | { |
| 91 | - $has_many_sites->execute('INSERT {self} SET uid = ?, site_id = ?', [ $rc, $site_id ]); |
|
| 91 | + $has_many_sites->execute('INSERT {self} SET uid = ?, site_id = ?', [$rc, $site_id]); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | return [ |
| 11 | 11 | |
| 12 | - ICanBoogie\HTTP\AuthenticationRequired::class .'::rescue' => $hooks . 'on_security_exception_rescue', |
|
| 12 | + ICanBoogie\HTTP\AuthenticationRequired::class . '::rescue' => $hooks . 'on_security_exception_rescue', |
|
| 13 | 13 | ICanBoogie\HTTP\PermissionRequired::class . '::rescue' => $hooks . 'on_security_exception_rescue', |
| 14 | 14 | ICanBoogie\Routing\RouteDispatcher::class . '::dispatch:before' => $hooks . 'before_routing_dispatcher_dispatch', |
| 15 | 15 | Icybee\Modules\Users\Roles\Operation\DeleteOperation::class . '::process:before' => $hooks . 'before_roles_delete', |