Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/56901
Change subject: Remove unused variables and globals
......................................................................
Remove unused variables and globals
Also remove superfluous newlines, update some formatting and simplify two
if() statements.
Change-Id: Ie23d9cb0445bb113fddd7223af7858be97bf5890
---
M SpecialOpenIDIdentifier.body.php
M SpecialOpenIDLogin.body.php
M SpecialOpenIDServer.body.php
3 files changed, 16 insertions(+), 27 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenID
refs/changes/01/56901/1
diff --git a/SpecialOpenIDIdentifier.body.php b/SpecialOpenIDIdentifier.body.php
index d8270c4..48b8982 100644
--- a/SpecialOpenIDIdentifier.body.php
+++ b/SpecialOpenIDIdentifier.body.php
@@ -24,7 +24,6 @@
*/
class SpecialOpenIDIdentifier extends unlistedSpecialPage {
-
function __construct() {
parent::__construct( 'OpenIDIdentifier' );
}
@@ -39,7 +38,6 @@
}
self::showOpenIDIdentifier( User::newFromId( $par ), false,
true );
-
}
private static function isUser( $user ) {
@@ -47,21 +45,20 @@
}
/**
- * @param $user User
- * @param $delegate bool
+ * @param User $user
+ * @param bool $delegate
+ * @param bool $showSpecialPageText
*/
public static function showOpenIDIdentifier( $user, $delegate = false,
$showSpecialPageText = false ) {
global $wgOut, $wgUser, $wgOpenIDClientOnly,
$wgOpenIDShowUrlOnUserPage,
- $wgOpenIDAllowServingOpenIDUserAccounts,
$wgOpenIDIdentifiersURL;
+ $wgOpenIDAllowServingOpenIDUserAccounts;
// show the own OpenID Url as a subtitle on the user page
// but only for the user when visiting their own page
// and when the options say so
- if ( !self::isUser( $user ) ) {
- if ( $showSpecialPageText ) {
- $wgOut->addWikiMsg(
'openid-identifier-page-text-no-such-local-openid' );
- }
+ if ( !self::isUser( $user ) && $showSpecialPageText ) {
+ $wgOut->addWikiMsg(
'openid-identifier-page-text-no-such-local-openid' );
return;
}
@@ -69,11 +66,10 @@
# Add OpenID data if its allowed
if ( !$wgOpenIDClientOnly ) {
-
if ( !( count( $openid )
&& ( strlen( $openid[0]->uoi_openid ) != 0 )
- && !$wgOpenIDAllowServingOpenIDUserAccounts ) )
{
-
+ && !$wgOpenIDAllowServingOpenIDUserAccounts )
+ ) {
$serverTitle = SpecialPage::getTitleFor(
'OpenIDServer' );
$serverUrl = $serverTitle->getFullURL();
$wgOut->addLink( array( 'rel' =>
'openid.server', 'href' => $serverUrl ) );
@@ -93,8 +89,8 @@
if ( ( $user->getID() === $wgUser->getID() )
&& ( $user->getID() != 0 )
&& ( $wgOpenIDShowUrlOnUserPage === 'always'
- || ( ( $wgOpenIDShowUrlOnUserPage ===
'user' ) && !$wgUser->getOption( 'openid-hide-openid' ) ) ) ) {
-
+ || ( ( $wgOpenIDShowUrlOnUserPage ===
'user' ) && !$wgUser->getOption( 'openid-hide-openid' ) ) )
+ ) {
$wgOut->setSubtitle( "<span class='subpages'>" .
OpenIDHooks::getOpenIDSmallLogoUrlImageTag() .
SpecialOpenIDServer::getLocalIdentityLink( $wgUser ) .
@@ -103,17 +99,9 @@
if ( $showSpecialPageText ) {
$wgOut->addWikiMsg(
'openid-identifier-page-text-user', $wgUser->getName() );
}
-
- } else {
-
- if ( $showSpecialPageText ) {
- $wgOut->addWikiMsg(
'openid-identifier-page-text-different-user', $user->getID() );
- }
-
+ } elseif ( $showSpecialPageText ) {
+ $wgOut->addWikiMsg(
'openid-identifier-page-text-different-user', $user->getID() );
}
-
}
-
}
-
}
diff --git a/SpecialOpenIDLogin.body.php b/SpecialOpenIDLogin.body.php
index c182304..e6cf136 100644
--- a/SpecialOpenIDLogin.body.php
+++ b/SpecialOpenIDLogin.body.php
@@ -163,6 +163,7 @@
*
* @param $openid String: OpenID url
* @param $sreg Array: options get from OpenID
+ * @param $ax
* @param $messagekey String or null: message name to display at the top
*/
function chooseNameForm( $openid, $sreg, $ax, $messagekey = null ) {
diff --git a/SpecialOpenIDServer.body.php b/SpecialOpenIDServer.body.php
index 78bff57..b0e120b 100644
--- a/SpecialOpenIDServer.body.php
+++ b/SpecialOpenIDServer.body.php
@@ -250,6 +250,7 @@
# respond with the authenticated local identity OpenID Url. Utility
/**
+ * @param $user
* @return getLocalIdentity
*/
static function getLocalIdentity( $user ) {
@@ -267,6 +268,7 @@
}
/**
+ * @param $user
* @return getLocalIdentityLink
*/
static function getLocalIdentityLink( $user ) {
@@ -287,8 +289,7 @@
# clarity.
function Check( $server, $request, $sreg, $imm = true ) {
-
- global $wgUser, $wgOut,
$wgOpenIDAllowServingOpenIDUserAccounts, $wgOpenIDIdentifiersURL;
+ global $wgUser, $wgOut, $wgOpenIDAllowServingOpenIDUserAccounts;
assert( isset( $wgUser ) && isset( $wgOut ) );
assert( isset( $server ) );
@@ -766,7 +767,6 @@
if ( !$user->checkPassword( $password ) ) {
return wfMessage( 'wrongpassword' )->text();
} else {
- $id = $user->getId();
$wgUser = $user;
wfSetupSession();
$wgUser->SetCookies();
--
To view, visit https://gerrit.wikimedia.org/r/56901
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie23d9cb0445bb113fddd7223af7858be97bf5890
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OpenID
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits