| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Anything that wants to be "central" right now has to depend on
CentralAuth, and then either can't work without CentralAuth or has to
branch all over the place based on whether CentralAuth is present. Most
of the time all it really needs is a mapping from local users to central
user IDs and back or the ability to query whether the local user is
attached on some other wiki, so let's make an interface for that in
core.
See I52aa0460 for an example implementation (CentralAuth), and Ibd192e29
for an example use (OAuth).
Bug: T111302
Change-Id: I49568358ec35fdfd0b9e53e441adabded5c7b80f
|
|
|
|
|
|
|
| |
This avoids mishaps when User::idFromName is called first without,
then with READ_LATEST.
Change-Id: I4ea723d9568f77d91a4ab3a9d963652cc00d6c89
|
|
|
|
|
| |
Bug: T119021
Change-Id: I5e0599d1d045b0389a7825fddc2b346e4cfd001d
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoid having one wiki access another wiki's local keyspace.
Instead, use the global keyspace to share values across wikis.
Also, imitating wfMemcKey from wfForeignMemcKey was semantically
incorrect due to $wgCachePrefix having precedence. Most interfaces
(e.g. UserRightsProxy, FileRepo, JobQueue etc.) only have access
to the wiki id (dbname + prefix). The local cache configuration
for wgCachePrefix is not and shouldn't have to be exposed.
Start enforcing that local cache keys are left private and
to share keys, one must use global keys.
Global keys (prefixed with "global:") have their own space and we
can use the wiki-id as regular key segment for keys about users.
Also:
* Expose a method to keep formatting of this key in one place.
As it used used in many different places in core, as well
as in CentralAuth.
* Make use of wfWikiId() in getDefaultKeyspace() to avoid
duplicating this logic.
Change-Id: I58836a24b9e239f460ab489bd2fe8ced8259833c
|
|
|
|
|
|
|
|
|
|
| |
Change I2c736ad mostly removed the password handling from the User
object, but left in a little password handling to preserve the existing
ability to call $user->setPassword() before the user was actually added
to the database. That ability is now removed.
Bug: T47716
Change-Id: Id3d40742f2e2b197ad6facd149cc6350006bf289
|
|
|
|
|
|
|
| |
Also consistently use self:: instead of BagOStuff:: for constants
referenced within the BagOStuff class.
Change-Id: I20fde9fa5cddcc9e92fa6a02b05dc7effa846742
|
|
|
|
|
|
|
| |
Callers should use more expliciy lazy-loaded
cache factory methods.
Change-Id: Ifa0bf389720a09a931ee6466b993f787d83a09a7
|
|
|
|
| |
Change-Id: Ib209747f1ebd1433969b13b1ecb86d3b57f9be9a
|
|
|
|
|
|
| |
Follow up to I2c736ad to fix use of undefined `$id` variable.
Change-Id: I04bd9c1dd7e3e1e63b8008d02df91cfb1ad971a3
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Remove empty line comments as found by the
MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.EmptyComment sniff
Change-Id: I5d694f7a7d3bc97e16300ba03c60ad17f3c912a5
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AuthManager is coming, which will make it easier to add alternative
methods of authentication. But in order to do that, we need to finally
get around to ripping the password-related bits out of the User class.
The password expiration handling isn't used anywhere in core or
extensions in Gerrit beyond testing for expired passwords on login and
resetting the expiry date on password change. Those bits have been
inlined and the functions removed; AuthManager will allow each
"authentication provider" to handle its own password expiration.
The methods for fetching passwords, including the fact that mPassword
and other fields are public, has also been removed. This is already
broken in combination with basically any extension that messes with
authentication, and the major use outside of that was in creating
system users like MassMessage's "MediaWiki message delivery" user.
Password setting methods are silently deprecated, since most of the
replacements won't be available until AuthManager. But uses in unit
testing can be replaced with TestUser::setPasswordForUser() immediately.
User::randomPassword() and User::getPasswordFactory() don't really
belong in User either. For the former a new PasswordFactory method has
been created, while the latter should just be replaced by the two lines
to create a PasswordFactory via its constructor.
Bug: T47716
Change-Id: I2c736ad72d946fa9b859e6cd335fa58aececc0d5
|
|
|
|
|
|
|
| |
* This is less verbose that DatabaseBase
* Also add a few WAN cache doc comments
Change-Id: I5b6de6d0ffa06753ea96c50b63db7dae796475dc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* This gets lag information that is useful when
the calling code is about to run queries that
will have their results cached.
* This is now used in place of trxTimestamp() for
WANObjectCache set() and getWithSetCallback().
* The WAN cache will use a low TTL if the lag is
too high to avoid caching stale data for weeks.
* Bumped MAX_COMMIT_DELAY as nothing enforces it.
Bug: T113204
Change-Id: I2a95b4088cff42d6e980351555f81a4b13519e24
|
|
|
|
| |
Change-Id: I420998351663d92c4a101f61842e40591eebcd5f
|
|
|
|
|
|
|
|
| |
* That flag is used for anti-dependencies and thus
should never rely on cache
Bug: T95839
Change-Id: I4ffc8325e55588ef649b96e7b90bc95282f765a9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have this nice class for unit testing cookie-setting, but the
cookie-setting method ignores all the parameters! Fix that. Also provide
accessors to check the entire set of cookie data, and the set cookies as
a whole.
While this does change the semantics of FauxRequest::getcookie() in that
the name now needs to be prefixed, no extension in Gerrit uses this
method so we should be fine.
Also clean up the case of the setCookie and getCookie methods while
we're at it. Since PHP method names are case-insensitive, this doesn't
even break compatibility with extensions.
Change-Id: Ib44a074bf9796bc0b470d557e39465792f399d30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Within the UPDATE query, if user_editcount IS NULL, user_editcount+1 will
also be NULL, and the change becomes a no-op. So in MySQL, the number of
affected rows would be zero, which is the number of rows that actually
changed.
However, other DBMSs (e.g. PostgreSQL, SQLite) do count no-op changes,
meaning the code would not initialize user_editcount if it were NULL.
Explicitly checking for NULL should ensure consistent behavior across
database types.
Also, if the CLIENT_FOUND_ROWS flag is set when connecting to MySQL, the
server returns "Rows matched:" instead of "Changed:" as the affected row
count. This change would be necessary if MediaWiki, like Drupal, is
changed to use that flag <https://www.drupal.org/node/805858>.
Change-Id: Idac160bae56adc5c5d17f8558c55d87000019741
|
|
|
|
|
|
|
|
| |
* This can avoid some stale write race conditions
* Made use of this option in a few key places
* HOLDOFF_TTL was also bumped
Change-Id: I83505a59cce0119e456191c3100f7d97bc86bdbf
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* This works by adding a refresh mode to clearSharedCache()
when we want to purge the cache in case it might stale to
avoid further CAS errors. Because an exception will be
thrown, the usual DB callback will not get fired, so avoid
using commit hooks when doing these cache purges.
* Also lowered the tombstone TTL for such purges, since no
data actually changed.
Bug: T114023
Change-Id: Iaad87b4ed24733dac40bc9607d3c97c940710087
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| | |
Bug: T95839
Change-Id: I62f8eea31164be1ab0eacf31c494f0b296b367f2
|
| |
| |
| |
| | |
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
|
|/
|
|
|
|
|
|
|
| |
* They now issue the delete() write before COMMIT of
the relevant DB (or immediately if no trx is active)
* This can avoid some stale write race conditions
* Updated the WAN cache delete() docs
Change-Id: Id54887976051120b76528070d5f2ceb357d57897
|
|
|
|
|
|
|
|
| |
When the array syntax is used for the DNS blacklist, PHP throws a notice about array to string
conversion. This change ensures that the correct string name is used regardless of what type of
blacklist entry is used.
Change-Id: I2511a8320474a02d8f321d04f005bb9d18fb15b3
|
|
|
|
|
|
|
|
| |
This allows extensions (e.g. Echo) to detect who made the change without
relying upon $wgUser. It also allows for differentiation between
autopromotion entries which will pass in `false` as the performer.
Change-Id: Idebd78b54dcea1bdc84c83f402e87b240ab4ade1
|
|\
| |
| |
| | |
AuthPlugin methods"
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
AuthPlugin methods
* LocalUserCreated: Replaces AuthPlugin::initUser()
* UserGroupsChanged: Replaces AuthPlugin::updateExternalDBGroups()
** The similar UserRights hook is deprecated, mainly to get rid of the
passing of $user by reference.
* UserIsHidden: Replaces AuthPluginUser::isHidden()
* UserIsLocked: Replaces AuthPluginUser::isLocked()
* UserLoggedIn: Replaces AuthPlugin::updateUser()
Also, AuthPlugin::updateExternalDB() is deprecated in favor of the
existing UserSaveSettings hook.
Also, 'ResetSessionID' has been removed. Nothing uses it, I don't know
why I even added it in the first place.
Also, replacing the User object passed to AuthPlugin::initUser() and
AuthPlugin::updateUser() will now raise a warning.
Change-Id: If7474cfb26a29b11c2e78147069419ca3b1cba95
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| | |
It is a minor cleanup operation. I replaced a comparison of user 'mId'
with a corresponding 'User::equals()' call.
Change-Id: I89dea55789f343e794429c38934c263168ef608d
|
| |
| |
| |
| |
| |
| | |
* WAN cache key salting/tombstones makes this overkill now
Change-Id: I078daacc5d2987858d720677f11e9828d71021e2
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* This got created if unset on API or GUI preferences access,
which leads to writes on GET requests. Try to avoid that
deriving it from user_token, unless overriden. This also
means that changing the password always resets the key,
which is how these things work on most sites anyway.
* The whole getTokenFromOption() method is deprecated, and
this functionality is already in OAuth.
Bug: T92357
Change-Id: I96c0d6f6e535e67545049f01205430249eea8da0
|
|/
|
|
| |
Change-Id: I75e56ab02af6aee5dbed1735ae8a3a415094508d
|
|
|
|
|
|
|
|
|
|
|
| |
* Hint that mariadb can avoid scanning already NULL rows since
we want to set them all to NULL. This lets the index with the
timestamp be used, which avoids logs of scanning for users with
many rows. For non-parallel replication, this also avoids slave
lag in particular.
Bug: T107923
Change-Id: I8cded5476ef6adb2f8fea57239afd6e9b2a49708
|
|
|
|
|
|
|
| |
* This can help guard against stale reads if the user was
created or changed a second ago.
Bug: T105896
Change-Id: Ib2a59762cd8f4a4b7ad86d0700f186bee1d5b2d1
|
|
|
|
| |
Change-Id: Ibb34a3bd33c1eb92a2e2787a7e2402615ef02ccd
|
|
|
|
|
|
|
|
| |
$replyto and $contentType should now be passed as an array of $options.
This will make it easier to add more options in the future without
having a long list of optional parameters.
Change-Id: I2c38bb438bd01e0ed2552024a40311f3e8e2dc08
|
|
|
|
|
|
|
|
| |
* Also only issue DELETE if notifications exist. Previously,
this would issue a DELETE for all self talk page views.
Bug: T92007
Change-Id: Ifef11c9e5175d68d9615e59e2ed7de2f2c57bde1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
* This better alignes with IDBAccessObject docs and
still locks out INSERTs
Change-Id: Ib8713938e0afa14bee6f90bc51d6331eaf356447
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* This gives more visibility and the error rate is not
extreme (and mostly affects certain users due to
usage patterns).
Change-Id: I3eae28a584e4db8ae40ae80087a97c416b3bd3e8
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I68c30fd81a266aa1acdf74162bfa864b67922347
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Allow callers to specify why they are checking a passwords validity, so
some checks can be modified. Only check the default policy on creation,
since the account doesn't exist it's not a member of any groups.
Bug: T104615
Change-Id: I56b66002562aaa1493d94a90309bc8e4ae3841c8
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
authenticate"
Does not work as it will also log failed login attempts due
to a wrong password.
This reverts commit 9a97a7530f2a637cbb95603cfa4e0b51da753207.
Change-Id: I6abd19da4e6939315a7fe6f7debe5227b68d38a7
|
| |
| |
| |
| |
| |
| |
| | |
To be able to identify any users who are unable to log in when switching
from allowing local authentication to strict.
Change-Id: I2ebdccdad9c7794d1c1b13db6a646a43bc770c4e
|
|\ \ |
|