[Mediawiki-l] Change skin for all users

Rindler, Andreas andreas.rindler at bearingpoint.com
Fri Jul 13 13:31:10 UTC 2007


_______________________________

From: mediawiki-l-bounces at lists.wikimedia.org on behalf of Rob Church
Sent: Fri 13/07/2007 11:46
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] Change skin for all users



On 13/07/07, Rindler, Andreas <andreas.rindler at bearingpoint.com> wrote:
> b) Hack in the database on table user, field user_options. This is a blog, and I don't know yet how to 1) retrieve, change and save a blog object and 2) how to do this for a couple hundred users.

Er, blob, not blog. You might be able to use the
maintenance/userOptions.php script to update the skin preference for
all users...it will be present after the upgrade.
_______________________________________________


Thanks for the tip. I tried it but this error:

DB connection error: MySQL functions missing, have you compiled PHP with the --w
ith-mysql option?

I looked around the included script files but couldn't find anything that would help me debug.

Here is the output from the command line:

D:\Apache2.2\htdocs\wiki110>php -cli maintenance\userOptions.php --list
cols                   : 80
contextchars           : 50
contextlines           : 5
date                   : default
editsection            : 1
editsectiononrightclick: 0
enotifminoredits       : 0
enotifrevealaddr       : 0
enotifusertalkpages    : 1
enotifwatchlistpages   : 0
externaldiff           : 0
externaleditor         : 0
fancysig               : 0
highlightbroken        : 1
imagesize              : 2
language               : en
math                   : 1
numberheadings         : 0
previewontop           : 1
quickbar               : 1
rcdays                 : 7
rclimit                : 50
rememberpassword       : 0
rows                   : 25
searchNs0              : 1
searchlimit            : 20
showjumplinks          : 1
shownumberswatching    : 1
showtoc                : 1
showtoolbar            : 1
skin                   :
stubthreshold          : 0
thumbsize              : 2
underline              : 2
uselivepreview         : 0
variant                : en
watchlistdays          : 3
wllimit                : 250
Done.

D:\Apache2.2\htdocs\wiki110>php -cli maintenance\userOptions.php

This script pass through all users and change one of their options.
The new option is NOT validated.

Usage:
    php userOptions.php --list
    php userOptions.php [user option] --usage
    php userOptions.php [options]?á<user option> --old <old value> --new <new va
lue>

Switchs:
    --list : list available user options and their default value

    --usage : report all options statistics or just one if you specify it.

    --old <old value> : the value to look for
    --new <new value> : new value to update users with

Options:
    --nowarn: hides the 5 seconds warning
    --quiet : do not print what is happening
    --dry   : do not save user settings back to database

D:\Apache2.2\htdocs\wiki110>php -cli maintenance\userOptions.php --old skin: --n
ew skin:BearingPoint
The script is about to change the skin for ALL USERS in the database.
Users with option <> = 'skin:' will be made to use 'skin:BearingPoint'.

Abort with control-c in the next five seconds...0
DB connection error: MySQL functions missing, have you compiled PHP with the --w
ith-mysql option?



I am running this on:
Windows 2003

*       MediaWiki <http://www.mediawiki.org/> : 1.10.0
*       PHP <http://www.php.net/> : 5.2.1 (apache2handler)
*       MySQL <http://www.mysql.com/> : 5.0.37-community-nt

==================================
 
And I tried the option where I manupilate the mySql data. The above options are stored as a blob in user_options. I changed one user's options in the database and logged in. The user prefences did not change. It looks like as if it was ignoring the values in the database?! How is that possible?
 
-Andi
***************************************************************************************************
The information in this email is confidential and may be legally privileged. Access to this email by anyone other than the intended addressee is unauthorized. If you are not the intended recipient of this message, any review, disclosure, copying, distribution, retention, or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. If you are not the intended recipient, please reply to or forward a copy of this message to the sender and delete the message, any attachments, and any copies thereof from your system.
***************************************************************************************************


More information about the MediaWiki-l mailing list