Page MenuHomePhabricator

Create the 'MediaWiki default' user on wiki creation, or on upgrade if user does not exist.
Closed, DeclinedPublic

Description

Author: nickpj

Description:
The 'MediaWiki default' user is used by MediaWiki as a system-level user, to record actions performed by MediaWiki itself or by extension. For example, the very first edit to initialise the "Main Page" on a new wiki is performed by the 'MediaWiki default' user.

However, this user does not seem to be created during wiki creation. ( Note: I have only tested this with 1.12.0 stable, and on a very quick examination it still looks like this is the case in SVN head, but I could be wrong ). As shown with an example database query:


mysql> select * from user where user_name like 'MediaWiki default';
Empty set (0.00 sec)

mysql> select * from revision where rev_user_text = 'MediaWiki default';
+--------+----------+-------------+-------------+----------+-------------------+----------------+----------------+-------------+---------+---------------+

rev_idrev_pagerev_text_idrev_commentrev_userrev_user_textrev_timestamprev_minor_editrev_deletedrev_lenrev_parent_id

+--------+----------+-------------+-------------+----------+-------------------+----------------+----------------+-------------+---------+---------------+

1110MediaWiki default2008052207431000449NULL

+--------+----------+-------------+-------------+----------+-------------------+----------------+----------------+-------------+---------+---------------+

1 row in set (0.00 sec)

The 'MediaWiki default' user is referred to in ~ 7 places in core (grep -nr 'MediaWiki default' includes/ config/ maintenance/ ), and ~ 5 places in extensions (grep -nr 'MediaWiki default' extensions/ ).

My primary concern is for logging - I would like to be able to add something to the log, from the 'MediaWiki default' user, and have it appear normally in [[Special:Log]]. However at the moment such
entries do not appear, because Special:Log performs a join between the user table and the logging table. One possible solution may be to create the 'MediaWiki default' user when creating the wiki, and possibly also when upgrading the wiki.


Version: 1.13.x
Severity: minor
URL: http://en.wikipedia.org/wiki/User:MediaWiki_default

Details

Reference
bz14569

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:12 PM
bzimport set Reference to bz14569.
bzimport added a subscriber: Unknown Object (MLST).

Might be sensible to add it over in the installer, or it might be better actually to assign that installer edit to the initially-created sysop user...

I don't know about that. It's quite nice that MW makes automatic edits with a nonexistant user with id0. There are some setups where there may not even be an initial user. Namely Starter wiki like setups where a base db is created but not likely to have a user. Perhaps it would be best to create a "<System>" user with id0 which by definition cannot be logged into.

I'm with Daniel on this. The auto-generated edits shouldn't be done by the wikisysop account, as that account isn't doing the editing.

A userID of 0 for the "system" account makes it _really_ easy to check whether to allow things to be done to it (block, login, etc; none of which should be allowed).

"There are some setups where there may not even be an initial user."

Well, that would exclude those created with the installer. :)