Adding a function to AuthPlugin for getting the user's domain. This allows the extension to determine how the user's domain is get and set, rather than core.
Change-Id: Ib2414bd55dfde67f7caf6439680fa88d9266e991
* cleanupSpam.php now can delete spam pages if --delete was specified instead of blanking
them.
* Added new hook ChangePasswordForm to allow adding of additional fields in Special:ChangePassword
+* Added new function getDomain to AuthPlugin for getting a user's domain
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
$this->domain = $domain;
}
+ /**
+ * Get the user's domain
+ *
+ * @return string
+ */
+ public function getDomain() {
+ if ( $this->domain ) {
+ return $this->domain;
+ } else {
+ return 'invaliddomain';
+ }
+ }
+
/**
* Check to see if the specific domain is a valid domain.
*
if( $request->wasPosted() && $user->matchEditToken( $request->getVal( 'token' ) ) ) {
try {
- if ( isset( $_SESSION['wsDomain'] ) ) {
- $this->mDomain = $_SESSION['wsDomain'];
- }
- $wgAuth->setDomain( $this->mDomain );
+ $this->mDomain = $wgAuth->getDomain();
if( !$wgAuth->allowPasswordChange() ) {
$this->error( $this->msg( 'resetpass_forbidden' )->text() );
return;
}
if( !$wgAuth->validDomain( $this->mDomain ) ) {
- if ( isset( $_SESSION['wsDomain'] ) ) {
- $this->mDomain = $_SESSION['wsDomain'];
- } else {
- $this->mDomain = 'invaliddomain';
- }
+ $this->mDomain = $wgAuth->getDomain();
}
$wgAuth->setDomain( $this->mDomain );