35 return $this->
tryReset( $user, $reqs );
40 return $this->
tryReset( $user, $reqs );
45 return $this->
tryReset( $user, $reqs );
50 return $this->
tryReset( $user, $reqs );
60 $data = $this->manager->getAuthenticationSessionData(
'reset-pass' );
65 if ( is_array( $data ) ) {
66 $data = (object)$data;
68 if ( !is_object( $data ) ) {
69 throw new \UnexpectedValueException(
'reset-pass is not valid' );
72 if ( !isset( $data->msg ) ) {
73 throw new \UnexpectedValueException(
'reset-pass msg is missing' );
74 } elseif ( !$data->msg instanceof
Message ) {
75 throw new \UnexpectedValueException(
'reset-pass msg is not valid' );
76 } elseif ( !isset( $data->hard ) ) {
77 throw new \UnexpectedValueException(
'reset-pass hard is missing' );
78 } elseif ( isset( $data->req ) && (
80 !array_key_exists(
'retype', $data->req->getFieldInfo() )
82 throw new \UnexpectedValueException(
'reset-pass req is not valid' );
88 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
95 '@phan-var PasswordAuthenticationRequest $needReq';
96 if ( !$needReq->action ) {
101 $needReqs = [ $needReq ];
102 if ( !$data->hard ) {
105 wfMessage(
'authprovider-resetpass-skip-label' ),
106 wfMessage(
'authprovider-resetpass-skip-help' )
112 '@phan-var PasswordAuthenticationRequest $req';
113 if ( !$req || !array_key_exists(
'retype', $req->getFieldInfo() ) ) {
117 if ( $req->password !== $req->retype ) {
121 $req->username = $user->
getName();
122 $status = $this->manager->allowsAuthenticationDataChange( $req );
123 if ( !$status->isGood() ) {
126 $scope = LoggerFactory::getContext()->addScoped( [
127 'context.passwordResetOnLogin' => $data->hard ?
'forced' :
'suggested',
129 $this->manager->changeAuthenticationData( $req );
131 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.