46 return $this->
tryReset( $user, $reqs );
50 return $this->
tryReset( $user, $reqs );
54 return $this->
tryReset( $user, $reqs );
58 return $this->
tryReset( $user, $reqs );
68 $data = $this->manager->getAuthenticationSessionData(
'reset-pass' );
73 if ( is_array( $data ) ) {
74 $data = (object)$data;
76 if ( !is_object( $data ) ) {
77 throw new \UnexpectedValueException(
'reset-pass is not valid' );
80 if ( !isset( $data->msg ) ) {
81 throw new \UnexpectedValueException(
'reset-pass msg is missing' );
82 } elseif ( !$data->msg instanceof \
Message ) {
83 throw new \UnexpectedValueException(
'reset-pass msg is not valid' );
84 } elseif ( !isset( $data->hard ) ) {
85 throw new \UnexpectedValueException(
'reset-pass hard is missing' );
86 } elseif ( isset( $data->req ) && (
88 !array_key_exists(
'retype', $data->req->getFieldInfo() )
90 throw new \UnexpectedValueException(
'reset-pass req is not valid' );
96 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
103 '@phan-var PasswordAuthenticationRequest $needReq';
104 if ( !$needReq->action ) {
109 $needReqs = [ $needReq ];
110 if ( !$data->hard ) {
113 wfMessage(
'authprovider-resetpass-skip-label' ),
114 wfMessage(
'authprovider-resetpass-skip-help' )
120 '@phan-var PasswordAuthenticationRequest $req';
121 if ( !$req || !array_key_exists(
'retype', $req->getFieldInfo() ) ) {
125 if ( $req->password !== $req->retype ) {
129 $req->username = $user->
getName();
130 $status = $this->manager->allowsAuthenticationDataChange( $req );
131 if ( !$status->isGood() ) {
134 $this->manager->changeAuthenticationData( $req );
136 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.