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' )
117 if ( !$req || !array_key_exists(
'retype', $req->getFieldInfo() ) ) {
121 if ( $req->password !== $req->retype ) {
125 $req->username = $user->
getName();
126 $status = $this->manager->allowsAuthenticationDataChange( $req );
127 if ( !$status->isGood() ) {
130 $this->manager->changeAuthenticationData( $req );
132 $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.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
getName()
Get the user name, or the IP of an anonymous user.