mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
Adds logic to detect when an API key is about to expire and sends a notification email to the user if the key expires within 7 days and no recent notification was sent. Introduces a new 'last_notified_on' column to the user_auth_keys table to track notification timing.
24 lines
928 B
PHP
24 lines
928 B
PHP
<?php
|
|
// +-----------------------------------------------------------------------+
|
|
// | This file is part of Piwigo. |
|
|
// | |
|
|
// | For copyright and license information, please view the COPYING.txt |
|
|
// | file that was distributed with this source code. |
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
if (!defined('PHPWG_ROOT_PATH'))
|
|
{
|
|
die('Hacking attempt!');
|
|
}
|
|
|
|
$upgrade_description = 'Modification to the user_auth_key table to add last_notified_on';
|
|
|
|
// For API KEY, add a column last_notified_on, to know when the last email (for the moment)
|
|
// notifying of an upcoming expiration date was sent.
|
|
pwg_query(
|
|
'ALTER TABLE `'.PREFIX_TABLE.'user_auth_keys`
|
|
ADD COLUMN `last_notified_on` datetime DEFAULT NULL
|
|
;');
|
|
|
|
echo "\n".$upgrade_description."\n";
|
|
?>
|