Files
Piwigo/install/db/179-database.php
Linty dbec498287 fixes #2404 notify users of impending API key expiration
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.
2025-09-04 17:21:53 +02:00

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";
?>