Permalink
Show file tree
Hide file tree
1 comment
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Rework user sessions system (#3000)
Co-authored-by: samerton <samerton@users.noreply.github.com>
- Loading branch information
1 parent
5b996f3
commit 469bebc
Showing
7 changed files
with
89 additions
and
68 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
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
22 changes: 22 additions & 0 deletions
22
core/migrations/20220807142446_add_user_session_activity_columns.php
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,22 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| use Phinx\Migration\AbstractMigration; | ||
|
|
||
| final class AddUserSessionActivityColumns extends AbstractMigration | ||
| { | ||
| public function change(): void | ||
| { | ||
| $table = $this->table('nl2_users_session'); | ||
| $table->addColumn('remember_me', 'boolean', ['default' => false]); | ||
| $table->addColumn('active', 'boolean', ['default' => false]); | ||
| $table->addColumn('device_name', 'string', ['length' => 256, 'null' => true, 'default' => null]); | ||
| $table->addColumn('last_seen', 'integer', ['length' => 11, 'null' => true, 'default' => null]); | ||
| $table->addColumn('login_method', 'string', ['length' => 32]); | ||
| $table->addIndex('hash', ['unique' => true]); | ||
| $table->update(); | ||
|
|
||
| // Remove old data | ||
| $table->truncate(); | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
core/migrations/20220807153708_delete_admin_session_table.php
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,14 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
|
|
||
| use Phinx\Migration\AbstractMigration; | ||
|
|
||
| final class DeleteAdminSessionTable extends AbstractMigration | ||
| { | ||
| public function change(): void | ||
| { | ||
| $table = $this->table('nl2_users_admin_session'); | ||
| $table->drop(); | ||
| $table->update(); | ||
| } | ||
| } |
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
469bebcThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@admin maintainer as given the permission for assigning CVE. So please assign a CVE for this report