$token = $this->getOption( $oname );
if ( !$token ) {
$token = $this->resetTokenFromOption( $oname );
- $this->saveSettings();
+ if ( !wfReadOnly() ) {
+ $this->saveSettings();
+ }
}
return $token;
}
// 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();
+ if ( !wfReadOnly() ) {
+ $this->saveSettings();
+ }
}
$session = array(
'wsUserID' => $this->mId,
public function saveSettings() {
global $wgAuth;
- $this->load();
- $this->loadPasswords();
if ( wfReadOnly() ) {
return; // @TODO: caller should deal with this instead!
}
+
+ $this->load();
+ $this->loadPasswords();
if ( 0 == $this->mId ) {
return;
}
}
$passwordFactory = self::getPasswordFactory();
- if ( $passwordFactory->needsUpdate( $this->mPassword ) ) {
+ if ( $passwordFactory->needsUpdate( $this->mPassword ) && !wfReadOnly() ) {
$this->mPassword = $passwordFactory->newFromPlaintext( $password );
$this->saveSettings();
}
$request->getVal( 'nsRemember' ),
'searchnamespace',
$request
- )
+ ) && !wfReadOnly()
) {
// 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.
- if ( !$u->isEmailConfirmed() ) {
+ if ( !$u->isEmailConfirmed() && !wfReadOnly() ) {
$u->confirmEmail();
$u->saveSettings();
}