php-password-store/scripts/checkinactiveusers.php
Gergely Polonkai (W00d5t0ck) 1ceaae308f Added checkinactiveusers.php script
This script checks for inactive users and lists them.
2011-02-22 15:15:46 +01:00

18 lines
431 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';
$users = pwsdbh($dbDSN)->getInactiveUsers($userInactiveTime);
foreach ($users as $user)
{
printf("User %s is inactive since %s%s\n", $user['username'], $user['lastlogin'], ($user['administrator'] == 1) ? ' (this user is an administrator)' : '');
}