From: Antoine Musso Date: Sat, 7 Jan 2006 13:11:17 +0000 (+0000) Subject: fix logic, accounts were always deleted! X-Git-Tag: 1.6.0~720 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=0267db9c42106fd191b8db294e6b167394dae0e4;p=lhc%2Fweb%2Fwiklou.git fix logic, accounts were always deleted! --- diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index 6809f2a7f0..865a2cd29c 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -16,11 +16,11 @@ require_once( 'removeUnusedAccounts.inc' ); echo( "Remove Unused Accounts\nThis script will delete all users who have made no edits.\n\n" ); # Check parameters -if( $options['help'] ) { +if( @$options['help'] ) { echo( "USAGE: removeUnusedAccounts.php [--help|--delete]\n\nThe first (default) account is ignored.\n\n" ); die(); } else { - $delete = ( $options['delete'] ? true : false ); + $delete = @$options['delete'] ? true : false ; } $count = 0; @@ -43,14 +43,12 @@ echo( "done.\n" ); # Purge the inactive accounts we found echo( $count . " inactive accounts found.\n" ); -if( $count > 0 ) { - if( ( $delete ) || ( $count > 0 ) ) { - echo( " Deleting..." ); - DeleteUsers( $del ); - echo( "done.\n" ); - } else { - echo "Run the script with the --delete option to remove them from the database.\n"; - } +if( ( $delete ) and ( $count > 0 ) ) { + echo( " Deleting..." ); + DeleteUsers( $del ); + echo( "done.\n" ); +} else { + echo "Run the script with the --delete option to remove them from the database.\n"; } echo( "\n" );