<?php
+/** Constructor */
function wfSpecialResetpass( $par ) {
$form = new PasswordResetForm();
$form->execute( $par );
}
+/**
+ * Let users recover their password.
+ * @addtogroup SpecialPage
+ */
class PasswordResetForm extends SpecialPage {
function __construct( $name=null, $reset=null ) {
if( $name !== null ) {
/**
* Main execution point
*/
- function execute( $par='' ) {
+ function execute( $par ) {
global $wgUser, $wgAuth, $wgOut, $wgRequest;
if( !$wgAuth->allowPasswordChange() ) {
$retype = $wgRequest->getVal( 'wpRetype' );
try {
$this->attemptReset( $newpass, $retype );
- $wgOut->addWikiText( wfMsg( 'resetpass_success' ) );
+ $wgOut->addWikiMsg( 'resetpass_success' );
$data = array(
'action' => 'submitlogin',
function showForm() {
global $wgOut, $wgUser, $wgRequest;
+
+ $wgOut->disallowUserJs();
$self = SpecialPage::getTitleFor( 'Resetpass' );
$form =
}
/**
- * @throws PasswordError
+ * @throws PasswordError when cannot set the new password because requirements not met.
*/
function attemptReset( $newpass, $retype ) {
$user = User::newFromName( $this->mName );
}
}
-?>
+