From: Antoine Musso Date: Thu, 5 Jan 2006 23:16:11 +0000 (+0000) Subject: * use the $option system X-Git-Tag: 1.6.0~755 X-Git-Url: https://git.cyclocoop.org/admin/Duna?a=commitdiff_plain;h=bc0b47fa05e25c1c2bb8e147d6bfaf4156a69944;p=lhc%2Fweb%2Fwiklou.git * use the $option system * add '--help' (and die after showing the message) * clean up parameter handling a bit --- diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index 038875f4d9..a3a893835b 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -8,22 +8,33 @@ * @subpackage Maintenance * @author Rob Church */ + +# Options available +$options = array( 'delete','help' ); require_once( 'commandLine.inc' ); require_once( 'removeUnusedAccounts.inc' ); -echo( "REMOVE UNUSED ACCOUNTS\nThis script will delete all users who have made no edits.\n\n" ); -echo( "Syntax: removeUnusedAccounts.php [delete]\n * delete -> delete the accounts\n * The first user (usually the site owner) is left alone\n\n" ); + +# Default action (just report): +$action = ACTION_REPORT; # Handle parameters -if( isset( $args[0] ) ) { - $param = array_shift( $args ); - if( $param == 'delete' ) { - $action = ACTION_DELETE; - } else { - $action = ACTION_REPORT; - } -} else { - $action = ACTION_REPORT; +if(@$options['help']) { +echo << 0 ) ) { echo( " Deleting..." ); DeleteUsers( $del ); echo( "done.\n" ); +} else { + echo "\nYou can delete them by using the '--delete' switch (see help).\n"; } -?> \ No newline at end of file +?>