*/
var $mNewtalk, $mDatePreference, $mBlockedby, $mHash, $mRights,
$mBlockreason, $mEffectiveGroups, $mImplicitGroups, $mFormerGroups, $mBlockedGlobally,
- $mLocked, $mHideName, $mOptions, $mDisplayName;
+ $mLocked, $mHideName, $mOptions;
/**
* @var WebRequest
$this->mEffectiveGroups = null;
$this->mImplicitGroups = null;
$this->mOptions = null;
- $this->mDisplayName = null;
if ( $reloadFrom ) {
$this->mLoadedItems = array();
$this->mRealName = $str;
}
- /**
- * Return the name of this user we should used to display in the user interface
- * @return String The user's display name
- */
- public function getDisplayName() {
- global $wgRealNameInInterface;
- if ( is_null( $this->mDisplayName ) ) {
- $displayName = null;
-
- // Allow hooks to set a display name
- wfRunHooks( 'UserDisplayName', array( $this, &$displayName ) );
-
- if ( is_null( $displayName ) && $wgRealNameInInterface && $this->getRealName() ) {
- // If $wgRealNameInInterface is true use the real name as the display name if it's set
- $displayName = $this->getRealName();
- }
-
- if ( is_null( $displayName ) ) {
- $displayName = $this->getName();
- }
-
- $this->mDisplayName = $displayName;
- }
- return $this->mDisplayName;
- }
-
/**
* Get the user's current setting for a given option.
*
$this->load();
if ( 0 == $this->mId ) return;
+ if ( !$this->mToken ) {
+ // When token is empty or NULL generate a new one and then save it to the database
+ // This allows a wiki to re-secure itself after a leak of it's user table or $wgSecretKey
+ // Simply by setting every cell in the user_token column to NULL and letting them be
+ // regenerated as users log back into the wiki.
+ $this->setToken();
+ $this->saveSettings();
+ }
$session = array(
'wsUserID' => $this->mId,
'wsToken' => $this->mToken,
/**
* Alias for getEditToken.
- * @deprecated since 1.19, use getEditToken instead. Warnings in 1.21.
+ * @deprecated since 1.19, use getEditToken instead.
*
* @param $salt String|Array of Strings Optional function-specific data for hashing
* @param $request WebRequest object to use or null to use $wgRequest
* @return String The new edit token
*/
public function editToken( $salt = '', $request = null ) {
- # wfDeprecated( __METHOD__, '1.19' );
+ wfDeprecated( __METHOD__, '1.19' );
return $this->getEditToken( $salt, $request );
}
}
/**
- * Add a newuser log entry for this user
+ * Add a newuser log entry for this user. Before 1.19 the return value was always true.
*
* @param $byEmail Boolean: account made by email?
* @param $reason String: user supplied reason
__METHOD__
);
+ $this->mOptionOverrides = array();
foreach ( $res as $row ) {
$this->mOptionOverrides[$row->up_property] = $row->up_value;
$this->mOptions[$row->up_property] = $row->up_value;