Skip to content

Instantly share code, notes, and snippets.

@atdt atdt/setSkinToMonoBook.php Secret
Last active Nov 20, 2015

Embed
What would you like to do?
<?php
function setSkinToMonoBook( $userName ) {
$user = User::newFromName( $userName );
$wiki = wfWikiID();
if ( $user->getId() === 0 ) {
echo "User $userName does not exist.\n";
return false;
}
$skin = $user->getOption( 'skin' );
if ( $skin === 'monobook' ) {
echo "{$userName}@{$wiki}: Skin already set to MonoBook; nothing to do.\n";
return false;
}
$user->setOption( 'skin', 'monobook' );
$user->saveSettings();
echo "{$userName}@{$wiki}: Changed from $skin to MonoBook\n";
return true;
}
setSkinToMonoBook( 'Billinghurst' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.