44 return $this->
tryReset( $user, $reqs );
48 return $this->
tryReset( $user, $reqs );
52 return $this->
tryReset( $user, $reqs );
56 return $this->
tryReset( $user, $reqs );
66 $data = $this->manager->getAuthenticationSessionData(
'reset-pass' );
71 if ( is_array( $data ) ) {
72 $data = (object)$data;
74 if ( !is_object( $data ) ) {
75 throw new \UnexpectedValueException(
'reset-pass is not valid' );
78 if ( !isset( $data->msg ) ) {
79 throw new \UnexpectedValueException(
'reset-pass msg is missing' );
80 } elseif ( !$data->msg instanceof \
Message ) {
81 throw new \UnexpectedValueException(
'reset-pass msg is not valid' );
82 } elseif ( !isset( $data->hard ) ) {
83 throw new \UnexpectedValueException(
'reset-pass hard is missing' );
84 } elseif ( isset( $data->req ) && (
86 !array_key_exists(
'retype', $data->req->getFieldInfo() )
88 throw new \UnexpectedValueException(
'reset-pass req is not valid' );
94 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
101 '@phan-var PasswordAuthenticationRequest $needReq';
102 if ( !$needReq->action ) {
107 $needReqs = [ $needReq ];
108 if ( !$data->hard ) {
111 wfMessage(
'authprovider-resetpass-skip-label' ),
112 wfMessage(
'authprovider-resetpass-skip-help' )
118 '@phan-var PasswordAuthenticationRequest $req';
119 if ( !$req || !array_key_exists(
'retype', $req->getFieldInfo() ) ) {
123 if ( $req->password !== $req->retype ) {
127 $req->username = $user->
getName();
128 $status = $this->manager->allowsAuthenticationDataChange( $req );
129 if ( !$status->isGood() ) {
132 $this->manager->changeAuthenticationData( $req );
134 $this->manager->removeAuthenticationSessionData(
'reset-pass' );
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
The Message class deals with fetching and processing of interface message into a variety of formats.
getName()
Get the user name, or the IP of an anonymous user.