48 return $this->
tryReset( $user, $reqs );
52 return $this->
tryReset( $user, $reqs );
56 return $this->
tryReset( $user, $reqs );
60 return $this->
tryReset( $user, $reqs );
70 $data = $this->manager->getAuthenticationSessionData(
'reset-pass' );
75 if ( is_array( $data ) ) {
76 $data = (object)$data;
78 if ( !is_object( $data ) ) {
79 throw new \UnexpectedValueException(
'reset-pass is not valid' );
82 if ( !isset( $data->msg ) ) {
83 throw new \UnexpectedValueException(
'reset-pass msg is missing' );
84 } elseif ( !$data->msg instanceof
Message ) {
85 throw new \UnexpectedValueException(
'reset-pass msg is not valid' );
86 } elseif ( !isset( $data->hard ) ) {
87 throw new \UnexpectedValueException(
'reset-pass hard is missing' );
88 } elseif ( isset( $data->req ) && (
90 !array_key_exists(
'retype', $data->req->getFieldInfo() )
92 throw new \UnexpectedValueException(
'reset-pass req is not valid' );
98 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
105 '@phan-var PasswordAuthenticationRequest $needReq';
106 if ( !$needReq->action ) {
111 $needReqs = [ $needReq ];
112 if ( !$data->hard ) {
115 wfMessage(
'authprovider-resetpass-skip-label' ),
116 wfMessage(
'authprovider-resetpass-skip-help' )
122 '@phan-var PasswordAuthenticationRequest $req';
123 if ( !$req || !array_key_exists(
'retype', $req->getFieldInfo() ) ) {
127 if ( $req->password !== $req->retype ) {
131 $req->username = $user->
getName();
132 $status = $this->manager->allowsAuthenticationDataChange( $req );
133 if ( !$status->isGood() ) {
136 $scope = LoggerFactory::getContext()->addScoped( [
137 'context.passwordResetOnLogin' => $data->hard ?
'forced' :
'suggested',
139 $this->manager->changeAuthenticationData( $req );
141 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.