php-password-store/scripts/checknonusedpasswords.php
Gergely Polonkai (W00d5t0ck) a850066271 Added the checknonusedpasswords.php script
This script checks for passwords that were not accessed for a while.
2011-02-22 15:36:20 +01:00

25 lines
635 B
PHP

<?php
// Check for inactive users
// OPTIONS
$webDir = '/var/www/localhost/htdocs/passwordstore';
require_once $webDir . '/config.php';
require_once $webDir . '/class.db.php';
$passwords = pwsdbh($dbDSN)->getInactivePasswords($passwordInactiveTime);
foreach ($passwords as $password)
{
if ($password['username'] == '')
{
printf("The password for %s (%s) was not accessed since %s\n", $password['short'], $password['long'], $password['lastaccess']);
}
else
{
printf("The password for %s on %s (%s) was not accessed since %s\n", $password['username'], $password['short'], $password['long'], $password['lastaccess']);
}
}