This commit is contained in:
Pinga 2025-07-01 17:57:42 +03:00
parent 887c85c51e
commit 0bf30ff362
4 changed files with 22 additions and 1 deletions

View file

@ -884,6 +884,15 @@ function checkPasswordComplexity($password) {
} }
function checkPasswordRenewal($lastPasswordUpdateTimestamp) { function checkPasswordRenewal($lastPasswordUpdateTimestamp) {
// Check if expiration should be skipped for this user
$skipList = envi('PASSWORD_EXPIRATION_SKIP_USERS');
if ($skipList) {
$skipUsers = array_map('trim', explode(',', $skipList));
if (in_array($_SESSION['auth_username'], $skipUsers, true)) {
return null;
}
}
// Use configured or default password expiration days // Use configured or default password expiration days
$passwordExpiryDays = envi('PASSWORD_EXPIRATION_DAYS') ?: 90; // Default to 90 days $passwordExpiryDays = envi('PASSWORD_EXPIRATION_DAYS') ?: 90; // Default to 90 days

View file

@ -48,3 +48,5 @@ SUMSUB_TOKEN=
SUMSUB_KEY= SUMSUB_KEY=
TEST_TLDS=.test,.com.test TEST_TLDS=.test,.com.test
PASSWORD_EXPIRATION_SKIP_USERS=admin,superadmin

View file

@ -104,6 +104,14 @@ PASSWORD_EXPIRATION_DAYS=180
This will extend the password expiration to **180** days. This will extend the password expiration to **180** days.
If you wish to **exclude specific accounts from password expiration**, open `/var/www/cp/.env` and **edit the existing** `PASSWORD_EXPIRATION_SKIP_USERS` line (or add it if missing):
```bash
PASSWORD_EXPIRATION_SKIP_USERS=admin,superadmin
```
Add usernames separated by commas. These accounts will **not be subject to password expiration**.
**How to Apply Changes** **How to Apply Changes**
- Edit the `.env` file located at `/var/www/cp/.env` - Edit the `.env` file located at `/var/www/cp/.env`
- Save the file and restart Caddy if necessary. - Save the file and restart Caddy if necessary.

View file

@ -248,6 +248,8 @@ awk '
echo "Automation config modified successfully." echo "Automation config modified successfully."
sed -i '/^TEST_TLDS/ a\\nPASSWORD_EXPIRATION_SKIP_USERS=admin,superadmin' /var/www/cp/.env
# Start services # Start services
echo "Starting services..." echo "Starting services..."
systemctl start epp systemctl start epp