mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 09:13:02 +02:00
fixes #2449 enhance password reset flow with verification and lockout
Added email notification for successful password reset, improved verification code handling, and implemented account lockout after too many failed attempts. Introduced new language strings for user feedback and security messages. Refactored password reset logic to better handle guest/generic users and API key recommendations.
This commit is contained in:
@@ -2759,6 +2759,31 @@ SELECT
|
||||
return $api_keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all available api_key
|
||||
*
|
||||
* @since 16
|
||||
* @param string $user_id
|
||||
* @return array|false
|
||||
*/
|
||||
function get_available_api_key($user_id)
|
||||
{
|
||||
$api_keys = get_api_key($user_id);
|
||||
|
||||
if (!$api_keys) return false;
|
||||
|
||||
$available = array();
|
||||
foreach($api_keys as $api_key)
|
||||
{
|
||||
if (!$api_key['is_expired'] && empty($api_key['revoked_on']))
|
||||
{
|
||||
$available[] = $api_key;
|
||||
}
|
||||
}
|
||||
|
||||
return count($available) > 0 ? $available : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is connected with pwg_ui (identification.php)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user