50 return $this->
tryReset( $user, $reqs );
55 return $this->
tryReset( $user, $reqs );
60 return $this->
tryReset( $user, $reqs );
65 return $this->
tryReset( $user, $reqs );
75 $data = $this->manager->getAuthenticationSessionData(
'reset-pass' );
80 if ( is_array( $data ) ) {
81 $data = (object)$data;
83 if ( !is_object( $data ) ) {
84 throw new \UnexpectedValueException(
'reset-pass is not valid' );
87 if ( !isset( $data->msg ) ) {
88 throw new \UnexpectedValueException(
'reset-pass msg is missing' );
89 } elseif ( !$data->msg instanceof
Message ) {
90 throw new \UnexpectedValueException(
'reset-pass msg is not valid' );
91 } elseif ( !isset( $data->hard ) ) {
92 throw new \UnexpectedValueException(
'reset-pass hard is missing' );
93 } elseif ( isset( $data->req ) && (
95 !array_key_exists(
'retype', $data->req->getFieldInfo() )
97 throw new \UnexpectedValueException(
'reset-pass req is not valid' );
100 if ( !$data->hard ) {
103 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
110 '@phan-var PasswordAuthenticationRequest $needReq';
111 if ( !$needReq->action ) {
116 $needReqs = [ $needReq ];
117 if ( !$data->hard ) {
120 wfMessage(
'authprovider-resetpass-skip-label' ),
121 wfMessage(
'authprovider-resetpass-skip-help' )
127 '@phan-var PasswordAuthenticationRequest $req';
128 if ( !$req || !array_key_exists(
'retype', $req->getFieldInfo() ) ) {
132 if ( $req->password !== $req->retype ) {
136 $req->username = $user->
getName();
137 $status = $this->manager->allowsAuthenticationDataChange( $req );
138 if ( !$status->isGood() ) {
141 $scope = LoggerFactory::getContext()->addScoped( [
142 'context.passwordResetOnLogin' => $data->hard ?
'forced' :
'suggested',
144 $this->manager->changeAuthenticationData( $req );
146 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.