Last modified: 2014-02-13 19:25:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54894, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52894 - The mw.user object needs to be rewritten
The mw.user object needs to be rewritten
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: code_quality 39813
  Show dependency treegraph
 
Reported: 2013-08-15 20:28 UTC by Tyler Romeo
Modified: 2014-02-13 19:25 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tyler Romeo 2013-08-15 20:28:08 UTC
What the title says. It's a pretty terrible interface, and needs to be redesigned. Here are some of the issues with it:

* Is just an object, so there's no way for other code to make user objects for other users,
* Has a bunch of functions (see user.bucket(), user.sessionId()) that don't belong there,
* Doesn't give you an IP address for anonymous users when calling getName(), making it tough to get an identifier for that user (E:Annotator just ran into this problem),
* Doesn't have username validation functions, which would be useful for client-side validation.

In the end, it's only useful purpose is the ability to retrieve the current user's name and ID, and even then the getId and getName functions are just wrappers for mw.config, so it's pretty trivial to get the info manually.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links