110 : Form {
111 $items = [];
112 if ($this->password_manager->allowPasswordChange($this->user)) {
113 $pw_info_set = false;
115 $cpass = $this->ui_factory->input()->field()->password(
116 $this->
lng->txt(self::CURRENT_PASSWORD),
118 );
119
120 $pw_info_set = true;
121 if ($this->
user->getPasswd()) {
122 $cpass = $cpass->withRequired(true);
123 }
124 $cpass = $cpass->withRevelation(true);
126 if ($cpass_error !== []) {
127 $cpass = $cpass->withError(implode('<br>', $cpass_error));
128 }
129 $cpass = $cpass->withAdditionalTransformation(
131 return
133 LocalUserPasswordManager::getInstance()->verifyPassword(
134 $this->user,
136 );
137 }, $this->
lng->txt(
'passwd_wrong'))
138 );
139
141 }
142
143
144 $ipass = $this->ui_factory->input()->field()->password(
145 $this->
lng->txt(
'desired_password'),
146 );
147 if ($pw_info_set === false) {
149 }
150 $ipass = $ipass->withRequired(true);
151 $ipass = $ipass->withRevelation(true);
153 if ($ipass_error !== []) {
154 $ipass = $ipass->withError(implode('<br>', $ipass_error));
155 }
156 $ipass = $ipass->withAdditionalTransformation(
160 $custom_error = '';
162 if ($custom_error !== '' && $custom_error !== null) {
163 return $custom_error;
164 }
165
166 return $this->
lng->txt(
'passwd_invalid');
167 })
168 );
169 $ipass = $ipass->withAdditionalTransformation(
170 $this->
refinery->custom()->constraint(
174 $this->user,
175 $error_lng_var
176 );
177 },
178 function (Closure $cls,
Password $value):
string {
181 $this->user,
182 $error_lng_var
183 );
184
185 return $this->
lng->txt($error_lng_var ??
'');
186 }
187 )
188 );
190
191 switch ($this->
user->getAuthMode(
true)) {
193 $title = $this->
lng->txt(
'chg_password');
194
195 break;
197 default:
198 $title = $this->
lng->txt(
'chg_ilias_password');
199
200 break;
201 }
202 $section = $this->ui_factory->input()->field()->section($items, $title);
203 $items = ['password' => $section];
204 }
205
206 return $this->ui_factory->input()->container()->form()->standard(
207 $this->
ctrl->getLinkTarget($this,
'savePassword'),
208 $items
209 )->withSubmitLabel($this->
lng->txt(
'save'));
210 }
A password is used as part of credentials for authentication.
const int AUTH_SHIBBOLETH
const string CURRENT_PASSWORD
const string NEW_PASSWORD
static isPassword(string $a_passwd, ?string &$customError=null)
static isPasswordValidForUserContext(string $clear_text_password, $user, ?string &$error_language_variable=null)
static getPasswordRequirementsInfo()
infotext for ilPasswordInputGUI setInfo()