Added checkinactiveusers.php script
This script checks for inactive users and lists them.
This commit is contained in:
17
scripts/checkinactiveusers.php
Normal file
17
scripts/checkinactiveusers.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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)' : '');
|
||||
}
|
||||
|
Reference in New Issue
Block a user