diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-05-16 20:58:53 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-05-16 20:58:53 +0000 |
commit | cecb985bee3bdd252e1b8dc0bd500b37cd52be01 (patch) | |
tree | 17266aa237742640aabee7856f0202317a45d540 /maintenance/importImages.php | |
parent | 0bac06c301f2a83edb0236e4c2434da16848d549 (diff) |
Aktualisierung auf MediaWiki 1.10.0
Plugins angepasst und verbessert
kleine Korrekturen am Design
Diffstat (limited to 'maintenance/importImages.php')
-rw-r--r-- | maintenance/importImages.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/maintenance/importImages.php b/maintenance/importImages.php index abf0ec09..8302982c 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -4,8 +4,7 @@ * Maintenance script to import one or more images from the local file system into * the wiki without using the web-based interface * - * @package MediaWiki - * @subpackage Maintenance + * @addtogroup Maintenance * @author Rob Church <robchur@gmail.com> */ @@ -25,15 +24,13 @@ if( count( $args ) > 1 ) { # Search the directory given and pull out suitable candidates $files = findFiles( $dir, $exts ); - # Set up a fake user for this operation - if( isset( $options['user'] ) ) { - $wgUser = User::newFromName( $options['user'] ); - } else { - $wgUser = User::newFromName( 'Image import script' ); - } - if ( $wgUser->isAnon() ) { - $wgUser->addToDatabase(); - } + # Initialise the user for this operation + $user = isset( $options['user'] ) + ? User::newFromName( $options['user'] ) + : User::newFromName( 'Maintenance script' ); + if( !$user instanceof User ) + $user = User::newFromName( 'Maintenance script' ); + $wgUser = $user; # Get the upload comment $comment = isset( $options['comment'] ) |