mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-11-27 17:50:15 +00:00
Merge "Couple of fixme comments"
This commit is contained in:
commit
4179be3c42
|
@ -48,4 +48,5 @@ $messages['en'] = array(
|
|||
* @author Ryan Lane <rlane@wikimedia.org>
|
||||
*/
|
||||
$messages['qqq'] = array(
|
||||
'oathauth-desc' => '{{desc}}',
|
||||
);
|
||||
|
|
25
OATHUser.php
25
OATHUser.php
|
@ -14,9 +14,12 @@ class OATHUser {
|
|||
/**
|
||||
* Constructor. Can't be called directly. Call one of the static NewFrom* methods
|
||||
* @param $id Int Database id for the group
|
||||
* @param $name String User-defined name of the group
|
||||
* @param $position int
|
||||
* @param $project string|null
|
||||
* @param $account
|
||||
* @param $secret
|
||||
* @param $secretReset
|
||||
* @param $scratchTokens
|
||||
* @param $scratchTokensReset
|
||||
* @param bool $isValidated bool
|
||||
*/
|
||||
public function __construct( $id, $account, $secret = null, $secretReset = null, $scratchTokens = null, $scratchTokensReset = null, $isValidated = false ) {
|
||||
$this->id = $id;
|
||||
|
@ -36,7 +39,7 @@ class OATHUser {
|
|||
if ( $scratchTokens ) {
|
||||
$this->scratchTokens = $scratchTokens;
|
||||
} else {
|
||||
$this->regenerateScratchTokens();
|
||||
$this->regenerateScratchTokens(); // FIXME: Missing parameter
|
||||
$this->isEnabled = false;
|
||||
}
|
||||
if ( $scratchTokensReset ) {
|
||||
|
@ -47,6 +50,9 @@ class OATHUser {
|
|||
$this->isValidated = $isValidated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $reset bool
|
||||
*/
|
||||
public function regenerateScratchTokens( $reset ) {
|
||||
$scratchTokens = array();
|
||||
for ( $i = 0; $i < 5; $i++ ) {
|
||||
|
@ -109,6 +115,8 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $token
|
||||
* @param $reset bool
|
||||
* @return Boolean
|
||||
*/
|
||||
public function verifyToken( $token, $reset = false ) {
|
||||
|
@ -139,7 +147,7 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $name string
|
||||
* @param $user User
|
||||
* @return OATHUser|null
|
||||
*/
|
||||
public static function newFromUser( $user ) {
|
||||
|
@ -180,7 +188,7 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $name string
|
||||
* @param $username string
|
||||
* @return OATHUser|null
|
||||
*/
|
||||
public static function newFromUsername( $username ) {
|
||||
|
@ -236,7 +244,6 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $token string
|
||||
* @return bool
|
||||
*/
|
||||
public function validate() {
|
||||
|
@ -263,7 +270,6 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $id int
|
||||
* @return bool
|
||||
*/
|
||||
public function disable() {
|
||||
|
@ -276,11 +282,11 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @param $template
|
||||
* @return bool
|
||||
*/
|
||||
static function ModifyUITemplate( &$template ) {
|
||||
// FIXME: First assignment of $input unused
|
||||
$input = array( 'msg' => 'oathauth-token', 'type' => 'text', 'name' => 'token', 'value' => '', 'helptext' => 'oathauth-tokenhelp' );
|
||||
$input = '<td class="mw-label"><label for="wpOATHToken">' . wfMsgHtml( 'oathauth-token' ) . '</label></td><td class="mw-input">' . Html::input( 'wpOATHToken', null, 'password', array( 'class' => 'loginPassword', 'id' => 'wpOATHToken', 'tabindex' => '2', 'size' => '20' ) ) . '</td>';
|
||||
$template->set( 'extrafields', $input );
|
||||
|
@ -289,7 +295,6 @@ class OATHUser {
|
|||
}
|
||||
|
||||
/**
|
||||
* @static
|
||||
* @param $username string
|
||||
* @param $password string
|
||||
* @param $result bool
|
||||
|
|
|
@ -76,6 +76,9 @@ class SpecialOATH extends SpecialPage {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $reset bool
|
||||
*/
|
||||
function displaySecret( $reset = false ) {
|
||||
$this->getOutput()->addModules( 'ext.oathauth' );
|
||||
if ( $reset ) {
|
||||
|
@ -198,6 +201,10 @@ class SpecialOATH extends SpecialPage {
|
|||
$this->getOutput()->addHTML( $this->createResourceList( $resources ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $resources array
|
||||
* @return string
|
||||
*/
|
||||
function createResourceList( $resources ) {
|
||||
$resourceList = '';
|
||||
foreach ( $resources as $resource ) {
|
||||
|
@ -207,8 +214,8 @@ class SpecialOATH extends SpecialPage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $formData
|
||||
* @param string $entryPoint
|
||||
* @param $formData array
|
||||
* @param $entryPoint string
|
||||
* @return bool
|
||||
*/
|
||||
function tryValidateSubmit( $formData, $entryPoint = 'internal' ) {
|
||||
|
@ -246,8 +253,8 @@ class SpecialOATH extends SpecialPage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $formData
|
||||
* @param string $entryPoint
|
||||
* @param $formData array
|
||||
* @param $entryPoint string
|
||||
* @return bool
|
||||
*/
|
||||
function tryDisableSubmit( $formData, $entryPoint = 'internal' ) {
|
||||
|
@ -268,8 +275,8 @@ class SpecialOATH extends SpecialPage {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param $formData
|
||||
* @param string $entryPoint
|
||||
* @param $formData array
|
||||
* @param $entryPoint string
|
||||
* @return bool
|
||||
*/
|
||||
function tryResetSubmit( $formData, $entryPoint = 'internal' ) {
|
||||
|
|
Loading…
Reference in a new issue