From 2c642c223a10ae626d27f93fe85d7256e7d99d7d Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 14 Apr 2014 11:10:17 +0200 Subject: [PATCH] [ADDED] Help option --- scripts/validate_users.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/validate_users.php b/scripts/validate_users.php index 2c7cae82..fe80e2aa 100755 --- a/scripts/validate_users.php +++ b/scripts/validate_users.php @@ -8,10 +8,18 @@ // Include all settings and classes require_once('shared.inc.php'); - $options = getopt("d:a"); + $options = getopt("d:n:ah"); isset($options['d']) ? $timeLimitInDays = (int)$options['d'] : $timeLimitInDays = 90; isset($options['a']) ? $allUsers = true : $allUsers = false; - $notifyStaleUsers = False; + isset($options['n']) ? $notifyStaleUsers = true : $notifyStaleUsers = false; + if (isset($options['h'])) { + echo "Usage " . basename($argv[0]) . " [-d #] [-a] [-n]:" . PHP_EOL; + echo " -h : Show this help" . PHP_EOL; + echo " -d # : Only show users inactive for more that # days" . PHP_EOL; + echo " -n : Notify stale accounts via e-mail [EXPERIMENTAL]" . PHP_EOL; + echo " -a : Show all pool users regardless of inactivity" . PHP_EOL; + exit(0); + } // Fetch all users $users = $user->getAllAssoc();