* Ideally saveSettings() would not just silently do nothing in
read-only mode as not all callers expect that behavior. This
change is just the first step.
Change-Id: Ieeaf531dac3027ddba89c60159b98f9c04de78d3
$token = $this->getOption( $oname );
if ( !$token ) {
$token = $this->resetTokenFromOption( $oname );
$token = $this->getOption( $oname );
if ( !$token ) {
$token = $this->resetTokenFromOption( $oname );
+ if ( !wfReadOnly() ) {
+ $this->saveSettings();
+ }
// 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();
// 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();
+ if ( !wfReadOnly() ) {
+ $this->saveSettings();
+ }
}
$session = array(
'wsUserID' => $this->mId,
}
$session = array(
'wsUserID' => $this->mId,
public function saveSettings() {
global $wgAuth;
public function saveSettings() {
global $wgAuth;
- $this->load();
- $this->loadPasswords();
if ( wfReadOnly() ) {
return; // @TODO: caller should deal with this instead!
}
if ( wfReadOnly() ) {
return; // @TODO: caller should deal with this instead!
}
+
+ $this->load();
+ $this->loadPasswords();
if ( 0 == $this->mId ) {
return;
}
if ( 0 == $this->mId ) {
return;
}
}
$passwordFactory = self::getPasswordFactory();
}
$passwordFactory = self::getPasswordFactory();
- if ( $passwordFactory->needsUpdate( $this->mPassword ) ) {
+ if ( $passwordFactory->needsUpdate( $this->mPassword ) && !wfReadOnly() ) {
$this->mPassword = $passwordFactory->newFromPlaintext( $password );
$this->saveSettings();
}
$this->mPassword = $passwordFactory->newFromPlaintext( $password );
$this->saveSettings();
}
$request->getVal( 'nsRemember' ),
'searchnamespace',
$request
$request->getVal( 'nsRemember' ),
'searchnamespace',
$request
) {
// Reset namespace preferences: namespaces are not searched
// when they're not mentioned in the URL parameters.
) {
// Reset namespace preferences: namespaces are not searched
// when they're not mentioned in the URL parameters.
// As a side-effect, we can authenticate the user's e-mail ad-
// dress if it's not already done, since the temporary password
// was sent via e-mail.
// As a side-effect, we can authenticate the user's e-mail ad-
// dress if it's not already done, since the temporary password
// was sent via e-mail.
- if ( !$u->isEmailConfirmed() ) {
+ if ( !$u->isEmailConfirmed() && !wfReadOnly() ) {
$u->confirmEmail();
$u->saveSettings();
}
$u->confirmEmail();
$u->saveSettings();
}