mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Force user index file to be updated to fix email addresses [getgrav/grav-plugin-login#229]
This commit is contained in:
parent
8e6b823833
commit
fb1e31d0e4
|
|
@ -7,6 +7,7 @@
|
|||
* Added new `Pages::getSimplePagesHash` which is useful for caching pages specific data
|
||||
1. [](#bugfix)
|
||||
* An attempt to workaround windows reading locked file issue [getgrav/grav-plugin-admin#2299](https://github.com/getgrav/grav-plugin-admin/issues/2299)
|
||||
* Force user index file to be updated to fix email addresses [getgrav/grav-plugin-login#229](https://github.com/getgrav/grav-plugin-login/issues/229)
|
||||
|
||||
# v1.7.36
|
||||
## 09/08/2022
|
||||
|
|
@ -15,7 +16,7 @@
|
|||
* Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object
|
||||
* Added support for `flex-ignore@` to hide all the nested fields in the blueprint
|
||||
1. [](#bugfix)
|
||||
* Fixed loggin with a capitalised email address when using old users [getgrav/grav-plugin-login#229](https://github.com/getgrav/grav-plugin-login/issues/229)
|
||||
* Fixed login with a capitalised email address when using old users [getgrav/grav-plugin-login#229](https://github.com/getgrav/grav-plugin-login/issues/229)
|
||||
|
||||
# v1.7.35
|
||||
## 08/04/2022
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ use function is_string;
|
|||
*/
|
||||
class UserIndex extends FlexIndex implements UserCollectionInterface
|
||||
{
|
||||
public const VERSION = parent::VERSION . '.1';
|
||||
public const VERSION = parent::VERSION . '.2';
|
||||
|
||||
/**
|
||||
* @param FlexStorageInterface $storage
|
||||
|
|
@ -50,7 +50,7 @@ class UserIndex extends FlexIndex implements UserCollectionInterface
|
|||
// return $index['index'];
|
||||
//}
|
||||
|
||||
// Load up to date index.
|
||||
// Load up-to-date index.
|
||||
$entries = parent::loadEntriesFromStorage($storage);
|
||||
|
||||
return static::updateIndexFile($storage, $index['index'], $entries, ['force_update' => $force]);
|
||||
|
|
@ -142,9 +142,11 @@ class UserIndex extends FlexIndex implements UserCollectionInterface
|
|||
} elseif ($field === 'flex_key') {
|
||||
$user = $this->withKeyField('flex_key')->get($query);
|
||||
} elseif ($field === 'email') {
|
||||
$user = $this->withKeyField('email')->get(static::filterUsername($query, $this->getFlexDirectory()->getStorage()));
|
||||
$email = mb_strtolower($query);
|
||||
$user = $this->withKeyField('email')->get($email);
|
||||
} elseif ($field === 'username') {
|
||||
$user = $this->get(static::filterUsername($query, $this->getFlexDirectory()->getStorage()));
|
||||
$username = static::filterUsername($query, $this->getFlexDirectory()->getStorage());
|
||||
$user = $this->get($username);
|
||||
} else {
|
||||
$user = $this->__call('find', [$query, $field]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user