Skip to content

Commit

Permalink
EZEE-3453: Fixed admin user draft create during frontend login (#162)
Browse files Browse the repository at this point in the history
* EZEE-3453: Fixed admin user draft create during frontend login

https://issues.ibexa.co/browse/EZEE-3453

* Fixed search tests by user email in SearchServiceTest
  • Loading branch information
ciastektk authored Jan 27, 2021
1 parent 94937f8 commit 01e30cd
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 63 deletions.
4 changes: 2 additions & 2 deletions data/mysql/cleandata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14)
(34), (35), (36), (37);

INSERT INTO `ezuser` (`contentobject_id`, `email`, `login`, `password_hash`, `password_hash_type`)
VALUES (10,'nospam@ez.no','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7),
(14,'nospam@ez.no','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7);
VALUES (10,'anonymous@link.invalid','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7),
(14,'admin@link.invalid','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7);

INSERT INTO `ezuser_role` (`contentobject_id`, `id`, `limit_identifier`, `limit_value`, `role_id`)
VALUES (11,28,'','',1),
Expand Down
4 changes: 2 additions & 2 deletions data/postgresql/cleandata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14)
(34), (35), (36), (37);

INSERT INTO "ezuser" ("contentobject_id", "email", "login", "password_hash", "password_hash_type")
VALUES (10,'nospam@ez.no','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7),
(14,'nospam@ez.no','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7);
VALUES (10,'anonymous@link.invalid','anonymous','$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',7),
(14,'admin@link.invalid','admin','$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',7);

INSERT INTO "ezuser_role" ("contentobject_id", "id", "limit_identifier", "limit_value", "role_id")
VALUES (11,28,'','',1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ public function getCriteriaForInitialData(): iterable
yield 'SectionIdentifier=standard' => new Criterion\SectionIdentifier('standard');
yield 'Sibling IN 2, 1]' => new Criterion\Sibling(2, 1);
yield 'Subtree=/1/2/' => new Criterion\Subtree('/1/2/');
yield 'UserEmail=nospam@ez.no' => new Criterion\UserEmail('nospam@ez.no');
yield 'UserEmail=nospam@*' => new Criterion\UserEmail('*@ez.no', Criterion\Operator::LIKE);
yield 'UserEmail=admin@link.invalid' => new Criterion\UserEmail('admin@link.invalid');
yield 'UserEmail=admin@*' => new Criterion\UserEmail('*@link.invalid', Criterion\Operator::LIKE);
yield 'UserId=14' => new Criterion\UserId(14);
yield 'UserLogin=admin' => new Criterion\UserLogin('admin');
yield 'UserLogin=a*' => new Criterion\UserLogin('a*', Criterion\Operator::LIKE);
Expand Down
6 changes: 3 additions & 3 deletions eZ/Publish/API/Repository/Tests/SearchServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,23 +753,23 @@ public function getContentQuerySearches()
],
[
[
'query' => new Criterion\UserEmail('*nospam*', Operator::LIKE),
'query' => new Criterion\UserEmail('*anonymous*', Operator::LIKE),
'sortClauses' => [new SortClause\ContentId()],
'limit' => 50,
],
$fixtureDir . 'UserEmail.php',
],
[
[
'query' => new Criterion\UserEmail('nospam@ez.no', Operator::EQ),
'query' => new Criterion\UserEmail('anonymous@link.invalid', Operator::EQ),
'sortClauses' => [new SortClause\ContentId()],
'limit' => 50,
],
$fixtureDir . 'UserEmail.php',
],
[
[
'query' => new Criterion\UserEmail(['nospam@ez.no'], Operator::IN),
'query' => new Criterion\UserEmail(['anonymous@link.invalid'], Operator::IN),
'sortClauses' => [new SortClause\ContentId()],
'limit' => 50,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ ezurlalias_ml_incr:
- { id: 41 }
ezurlwildcard: { }
ezuser:
- { contentobject_id: 10, email: nospam@ez.no, login: anonymous, password_hash: $2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC, password_hash_type: 7 }
- { contentobject_id: 14, email: spam@ez.no, login: admin, password_hash: $2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy, password_hash_type: 7 }
- { contentobject_id: 10, email: anonymous@link.invalid, login: anonymous, password_hash: $2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC, password_hash_type: 7 }
- { contentobject_id: 14, email: admin@link.invalid, login: admin, password_hash: $2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy, password_hash_type: 7 }
ezuser_accountkey: { }
ezuser_role:
- { contentobject_id: 12, id: 25, limit_identifier: '', limit_value: '', role_id: 2 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function providerForGetFieldData(): array
'hasStoredLogin' => true,
'contentId' => 10,
'login' => 'anonymous',
'email' => 'nospam@ez.no',
'email' => 'anonymous@link.invalid',
'passwordHash' => '$2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC',
'passwordHashType' => User::PASSWORD_HASH_PHP_DEFAULT,
'enabled' => true,
Expand All @@ -37,7 +37,7 @@ public function providerForGetFieldData(): array
'hasStoredLogin' => true,
'contentId' => 14,
'login' => 'admin',
'email' => 'spam@ez.no',
'email' => 'admin@link.invalid',
'passwordHash' => '$2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy',
'passwordHashType' => User::PASSWORD_HASH_PHP_DEFAULT,
'enabled' => true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ezuser:
- { contentobject_id: 10, email: nospam@ez.no, login: anonymous, password_hash: $2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC, password_hash_type: 7 }
- { contentobject_id: 10, email: anonymous@link.invalid, login: anonymous, password_hash: $2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC, password_hash_type: 7 }
- { contentobject_id: 16, email: test@link.invalid, login: test, password_hash: $2y$10$35gOSQs6JK4u4whyERaeUuVeQBi2TUBIZIfP7HEj7sfz.MxvTuOeC, password_hash_type: 5 }
- { contentobject_id: 14, email: spam@ez.no, login: admin, password_hash: $2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy, password_hash_type: 7 }
- { contentobject_id: 14, email: admin@link.invalid, login: admin, password_hash: $2y$10$FDn9NPwzhq85cLLxfD5Wu.L3SL3Z/LNCvhkltJUV0wcJj7ciJg2oy, password_hash_type: 7 }
4 changes: 2 additions & 2 deletions eZ/Publish/Core/Persistence/Cache/Tests/UserHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function providerForCachedLoadMethods(): array
return [
['load', [14], 'ez-user-14', $user],
['loadByLogin', ['admin'], 'ez-user-admin-by-login', $user],
['loadByEmail', ['nospam@ez.no'], 'ez-user-nospam_Aez.no-by-email', $user],
['loadUsersByEmail', ['nospam@ez.no'], 'ez-users-nospam_Aez.no-by-email', [$user]],
['loadByEmail', ['admin@link.invalid'], 'ez-user-admin_Alink.invalid-by-email', $user],
['loadUsersByEmail', ['admin@link.invalid'], 'ez-users-admin_Alink.invalid-by-email', [$user]],
['loadUserByToken', ['hash'], 'ez-user-hash-by-account-key', $user],
['loadRole', [9], 'ez-role-9', $role],
['loadRoleByIdentifier', ['member'], 'ez-role-member-by-identifier', $role],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '333',
Expand Down Expand Up @@ -2784,7 +2784,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '345',
Expand Down Expand Up @@ -2908,7 +2908,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '357',
Expand Down Expand Up @@ -3107,7 +3107,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '376',
Expand Down Expand Up @@ -3231,7 +3231,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '388',
Expand Down Expand Up @@ -3355,7 +3355,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '400',
Expand Down Expand Up @@ -3674,7 +3674,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '433',
Expand Down Expand Up @@ -3798,7 +3798,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '445',
Expand Down Expand Up @@ -3922,7 +3922,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '457',
Expand Down Expand Up @@ -4706,7 +4706,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '531',
Expand Down Expand Up @@ -8614,7 +8614,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '893',
Expand Down Expand Up @@ -8738,7 +8738,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '905',
Expand Down Expand Up @@ -8937,7 +8937,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '924',
Expand Down Expand Up @@ -9061,7 +9061,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '936',
Expand Down Expand Up @@ -9185,7 +9185,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '948',
Expand Down Expand Up @@ -9459,7 +9459,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '974',
Expand Down Expand Up @@ -10904,7 +10904,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '1103',
Expand Down Expand Up @@ -11075,7 +11075,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '1119',
Expand Down Expand Up @@ -11575,7 +11575,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '1163',
Expand Down Expand Up @@ -12075,7 +12075,7 @@
'data_float' => '0',
'data_int' => null,
'data_text' => '<?xml version="1.0" encoding="utf-8"?>
<ezauthor><authors><author id="0" name="Administrator User" email="nospam@ez.no"/></authors></ezauthor>
<ezauthor><authors><author id="0" name="Administrator User" email="admin@link.invalid"/></authors></ezauthor>
',
'data_type_string' => 'ezauthor',
'id' => '1207',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public function providerForLanguagesLookupMethods()
['loadSubUserGroups', [$userGroup, 50, 50, self::LANG_ARG], [$userGroup], 3],
['loadUser', [14, self::LANG_ARG], $user, 1],
['loadUserByLogin', ['admin', self::LANG_ARG], $user, 1],
['loadUserByEmail', ['nospam@ez.no', self::LANG_ARG], $user, 1],
['loadUsersByEmail', ['nospam@ez.no', self::LANG_ARG], [$user], 1],
['loadUserByEmail', ['admin@link.invalid', self::LANG_ARG], $user, 1],
['loadUsersByEmail', ['admin@link.invalid', self::LANG_ARG], [$user], 1],
['loadUserGroupsOfUser', [$user, 50, 50, self::LANG_ARG], [$userGroup], 3],
['loadUsersOfUserGroup', [$userGroup, 50, 50, self::LANG_ARG], [$user], 3],
['loadUserByToken', ['43ir43jrt43', self::LANG_ARG], $user, 1],
Expand Down
Loading

0 comments on commit 01e30cd

Please sign in to comment.