@@ -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', |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | 'patron.markups' => [ |
13 | 13 | |
14 | - 'user' => [ $hooks . 'markup_user' ], |
|
15 | - 'users:form:login' => [ $hooks . 'markup_form_login' ] |
|
14 | + 'user' => [$hooks . 'markup_user'], |
|
15 | + 'users:form:login' => [$hooks . 'markup_form_login'] |
|
16 | 16 | |
17 | 17 | ] |
18 | 18 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | 'pattern' => '/api/logout', |
27 | 27 | 'controller' => LogoutOperation::class, |
28 | - 'via' => [ 'GET', 'POST' ] |
|
28 | + 'via' => ['GET', 'POST'] |
|
29 | 29 | |
30 | 30 | ], |
31 | 31 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ] + Make::admin('users', Routing\UsersAdminController::class, [ |
59 | 59 | |
60 | 60 | 'id_name' => 'uid', |
61 | - 'only' => [ 'index', 'new', 'edit', 'confirm-delete', 'profile', 'authenticate' ], |
|
61 | + 'only' => ['index', 'new', 'edit', 'confirm-delete', 'profile', 'authenticate'], |
|
62 | 62 | 'actions' => [ |
63 | 63 | |
64 | 64 | 'profile' => [ |
@@ -17,19 +17,19 @@ discard block |
||
17 | 17 | Model::SCHEMA => [ |
18 | 18 | |
19 | 19 | 'uid' => 'serial', |
20 | - 'constructor' => [ 'varchar', 64, 'indexed' => true ], |
|
21 | - 'email' => [ 'varchar', 64, 'unique' => true ], |
|
22 | - 'password_hash' => [ 'varchar', 255, 'charset' => 'ascii/bin' ], |
|
23 | - 'username' => [ 'varchar', 32, 'unique' => true ], |
|
24 | - 'firstname' => [ 'varchar', 32 ], |
|
25 | - 'lastname' => [ 'varchar', 32 ], |
|
26 | - 'nickname' => [ 'varchar', 32 ], |
|
27 | - 'name_as' => [ 'integer', 'tiny' ], |
|
28 | - 'language' => [ 'varchar', 8 ], |
|
29 | - 'timezone' => [ 'varchar', 32 ], |
|
20 | + 'constructor' => ['varchar', 64, 'indexed' => true], |
|
21 | + 'email' => ['varchar', 64, 'unique' => true], |
|
22 | + 'password_hash' => ['varchar', 255, 'charset' => 'ascii/bin'], |
|
23 | + 'username' => ['varchar', 32, 'unique' => true], |
|
24 | + 'firstname' => ['varchar', 32], |
|
25 | + 'lastname' => ['varchar', 32], |
|
26 | + 'nickname' => ['varchar', 32], |
|
27 | + 'name_as' => ['integer', 'tiny'], |
|
28 | + 'language' => ['varchar', 8], |
|
29 | + 'timezone' => ['varchar', 32], |
|
30 | 30 | 'logged_at' => 'datetime', |
31 | - 'created_at' => [ 'timestamp', 'default' => 'CURRENT_TIMESTAMP' ], |
|
32 | - 'is_activated' => [ 'boolean', 'indexed' => true ] |
|
31 | + 'created_at' => ['timestamp', 'default' => 'CURRENT_TIMESTAMP'], |
|
32 | + 'is_activated' => ['boolean', 'indexed' => true] |
|
33 | 33 | |
34 | 34 | ] |
35 | 35 | ], |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | Model::CLASSNAME => 'ICanBoogie\ActiveRecord\Model', |
42 | 42 | Model::SCHEMA => [ |
43 | 43 | |
44 | - 'uid' => [ 'foreign', 'primary' => true ], |
|
45 | - 'rid' => [ 'foreign', 'primary' => true ] |
|
44 | + 'uid' => ['foreign', 'primary' => true], |
|
45 | + 'rid' => ['foreign', 'primary' => true] |
|
46 | 46 | |
47 | 47 | ] |
48 | 48 | ], |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | Model::CLASSNAME => 'ICanBoogie\ActiveRecord\Model', |
55 | 55 | Model::SCHEMA => [ |
56 | 56 | |
57 | - 'uid' => [ 'foreign', 'primary' => true ], |
|
58 | - 'site_id' => [ 'foreign', 'primary' => true ] |
|
57 | + 'uid' => ['foreign', 'primary' => true], |
|
58 | + 'site_id' => ['foreign', 'primary' => true] |
|
59 | 59 | |
60 | 60 | ] |
61 | 61 | ] |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | ], |
70 | 70 | |
71 | 71 | Descriptor::REQUIRED => true, |
72 | - Descriptor::REQUIRES => [ 'users.roles' ], |
|
72 | + Descriptor::REQUIRES => ['users.roles'], |
|
73 | 73 | Descriptor::TITLE => "Users" |
74 | 74 | |
75 | 75 | ]; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | /* @var $site \Icybee\Modules\Sites\Site */ |
23 | 23 | $site = $app->site; |
24 | - $ws_title = \ICanBoogie\escape($site->admin_title ? $site->admin_title : $site->title .':' . $site->language); |
|
24 | + $ws_title = \ICanBoogie\escape($site->admin_title ? $site->admin_title : $site->title . ':' . $site->language); |
|
25 | 25 | |
26 | 26 | $available = $site->model |
27 | 27 | ->where('site_id IN(' . implode(',', $app->user->restricted_sites_ids) . ')') |
@@ -76,6 +76,6 @@ |
||
76 | 76 | please select another website to work with:</p> |
77 | 77 | $form |
78 | 78 | </div> |
79 | -EOT; |
|
79 | +eot; |
|
80 | 80 | } |
81 | 81 | } |
@@ -30,8 +30,8 @@ |
||
30 | 30 | { |
31 | 31 | parent::__construct($module, $attributes + [ |
32 | 32 | |
33 | - self::T_COLUMNS_ORDER => [ User::USERNAME, User::IS_ACTIVATED, User::EMAIL, 'roles', User::CREATED_AT, User::LOGGED_AT ], |
|
34 | - self::T_ORDER_BY => [ 'created_at', 'desc' ] |
|
33 | + self::T_COLUMNS_ORDER => [User::USERNAME, User::IS_ACTIVATED, User::EMAIL, 'roles', User::CREATED_AT, User::LOGGED_AT], |
|
34 | + self::T_ORDER_BY => ['created_at', 'desc'] |
|
35 | 35 | |
36 | 36 | ]); |
37 | 37 | } |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | if ($value) |
96 | 96 | { |
97 | - $query->and([ $this->id => $value ]); |
|
97 | + $query->and([$this->id => $value]); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | return $query; |
@@ -175,7 +175,7 @@ |
||
175 | 175 | { |
176 | 176 | return <<<EOT |
177 | 177 | <div class="alert alert-error undismissable">Undefined user: {$uid}</div> |
178 | -EOT; |
|
178 | +eot; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | return new FilterDecorator($record, $this->id, $this->is_filtering, $user ? $user->name : ''); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | { |
32 | 32 | parent::__construct('select', $attributes + [ |
33 | 33 | |
34 | - Element::OPTIONS => [ null => '' ] + $this->create_options($attributes) |
|
34 | + Element::OPTIONS => [null => ''] + $this->create_options($attributes) |
|
35 | 35 | |
36 | 36 | ]); |
37 | 37 | } |