From 183851b06bd6c52f3cae5375f433da720d410447 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Oct 2006 18:12:39 +0000 Subject: MediaWiki 1.7.1 wiederhergestellt --- maintenance/reassignEdits.php | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 maintenance/reassignEdits.php (limited to 'maintenance/reassignEdits.php') diff --git a/maintenance/reassignEdits.php b/maintenance/reassignEdits.php new file mode 100644 index 00000000..4ac566af --- /dev/null +++ b/maintenance/reassignEdits.php @@ -0,0 +1,57 @@ + + * @licence GNU General Public Licence 2.0 or later + */ + +$options = array( 'force', 'norc', 'quiet', 'report' ); +require_once( 'commandLine.inc' ); +require_once( 'reassignEdits.inc.php' ); + +# Set silent mode; --report overrides --quiet +if( !@$options['report'] && @$options['quiet'] ) + setSilent(); + +out( "Reassign Edits\n\n" ); + +if( @$args[0] && @$args[1] ) { + + # Set up the users involved + $from =& initialiseUser( $args[0] ); + $to =& initialiseUser( $args[1] ); + + # If the target doesn't exist, and --force is not set, stop here + if( $to->getId() || @$options['force'] ) { + # Reassign the edits + $report = @$options['report']; + $count = reassignEdits( $from, $to, !@$options['norc'], $report ); + # If reporting, and there were items, advise the user to run without --report + if( $report ) + out( "Run the script again without --report to update.\n" ); + } else { + $ton = $to->getName(); + echo( "User '{$ton}' not found.\n" ); + } + +} else { + ShowUsage(); +} + +/** Show script usage information */ +function ShowUsage() { + echo( "Reassign edits from one user to another.\n\n" ); + echo( "Usage: php reassignEdits.php [--force|--quiet|--norc|--report] \n\n" ); + echo( " : Name of the user to assign edits from\n" ); + echo( " : Name of the user to assign edits to\n" ); + echo( " --force : Reassign even if the target user doesn't exist\n" ); + echo( " --quiet : Don't print status information (except for errors)\n" ); + echo( " --norc : Don't update the recent changes table\n" ); + echo( " --report : Print out details of what would be changed, but don't update it\n\n" ); +} + +?> \ No newline at end of file -- cgit v1.2.3-54-g00ecf