1 | <?php |
||
38 | class AuthPlugin { |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $domain; |
||
43 | |||
44 | /** |
||
45 | * Check whether there exists a user account with the given name. |
||
46 | * The name will be normalized to MediaWiki's requirements, so |
||
47 | * you might need to munge it (for instance, for lowercase initial |
||
48 | * letters). |
||
49 | * |
||
50 | * @param string $username Username. |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function userExists( $username ) { |
||
57 | |||
58 | /** |
||
59 | * Check if a username+password pair is a valid login. |
||
60 | * The name will be normalized to MediaWiki's requirements, so |
||
61 | * you might need to munge it (for instance, for lowercase initial |
||
62 | * letters). |
||
63 | * |
||
64 | * @param string $username Username. |
||
65 | * @param string $password User password. |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function authenticate( $username, $password ) { |
||
72 | |||
73 | /** |
||
74 | * Modify options in the login template. |
||
75 | * |
||
76 | * @param UserLoginTemplate $template |
||
77 | * @param string $type 'signup' or 'login'. Added in 1.16. |
||
78 | */ |
||
79 | public function modifyUITemplate( &$template, &$type ) { |
||
83 | |||
84 | /** |
||
85 | * Set the domain this plugin is supposed to use when authenticating. |
||
86 | * |
||
87 | * @param string $domain Authentication domain. |
||
88 | */ |
||
89 | public function setDomain( $domain ) { |
||
92 | |||
93 | /** |
||
94 | * Get the user's domain |
||
95 | * |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getDomain() { |
||
105 | |||
106 | /** |
||
107 | * Check to see if the specific domain is a valid domain. |
||
108 | * |
||
109 | * @param string $domain Authentication domain. |
||
110 | * @return bool |
||
111 | */ |
||
112 | public function validDomain( $domain ) { |
||
116 | |||
117 | /** |
||
118 | * When a user logs in, optionally fill in preferences and such. |
||
119 | * For instance, you might pull the email address or real name from the |
||
120 | * external user database. |
||
121 | * |
||
122 | * The User object is passed by reference so it can be modified; don't |
||
123 | * forget the & on your function declaration. |
||
124 | * |
||
125 | * @deprecated since 1.26, use the UserLoggedIn hook instead. And assigning |
||
126 | * a different User object to $user is no longer supported. |
||
127 | * @param User $user |
||
128 | * @return bool |
||
129 | */ |
||
130 | public function updateUser( &$user ) { |
||
134 | |||
135 | /** |
||
136 | * Return true if the wiki should create a new local account automatically |
||
137 | * when asked to login a user who doesn't exist locally but does in the |
||
138 | * external auth database. |
||
139 | * |
||
140 | * If you don't automatically create accounts, you must still create |
||
141 | * accounts in some way. It's not possible to authenticate without |
||
142 | * a local account. |
||
143 | * |
||
144 | * This is just a question, and shouldn't perform any actions. |
||
145 | * |
||
146 | * @return bool |
||
147 | */ |
||
148 | public function autoCreate() { |
||
151 | |||
152 | /** |
||
153 | * Allow a property change? Properties are the same as preferences |
||
154 | * and use the same keys. 'Realname' 'Emailaddress' and 'Nickname' |
||
155 | * all reference this. |
||
156 | * |
||
157 | * @param string $prop |
||
158 | * |
||
159 | * @return bool |
||
160 | */ |
||
161 | public function allowPropChange( $prop = '' ) { |
||
172 | |||
173 | /** |
||
174 | * Can users change their passwords? |
||
175 | * |
||
176 | * @return bool |
||
177 | */ |
||
178 | public function allowPasswordChange() { |
||
181 | |||
182 | /** |
||
183 | * Should MediaWiki store passwords in its local database? |
||
184 | * |
||
185 | * @return bool |
||
186 | */ |
||
187 | public function allowSetLocalPassword() { |
||
190 | |||
191 | /** |
||
192 | * Set the given password in the authentication database. |
||
193 | * As a special case, the password may be set to null to request |
||
194 | * locking the password to an unusable value, with the expectation |
||
195 | * that it will be set later through a mail reset or other method. |
||
196 | * |
||
197 | * Return true if successful. |
||
198 | * |
||
199 | * @param User $user |
||
200 | * @param string $password Password. |
||
201 | * @return bool |
||
202 | */ |
||
203 | public function setPassword( $user, $password ) { |
||
206 | |||
207 | /** |
||
208 | * Update user information in the external authentication database. |
||
209 | * Return true if successful. |
||
210 | * |
||
211 | * @deprecated since 1.26, use the UserSaveSettings hook instead. |
||
212 | * @param User $user |
||
213 | * @return bool |
||
214 | */ |
||
215 | public function updateExternalDB( $user ) { |
||
218 | |||
219 | /** |
||
220 | * Update user groups in the external authentication database. |
||
221 | * Return true if successful. |
||
222 | * |
||
223 | * @deprecated since 1.26, use the UserGroupsChanged hook instead. |
||
224 | * @param User $user |
||
225 | * @param array $addgroups Groups to add. |
||
226 | * @param array $delgroups Groups to remove. |
||
227 | * @return bool |
||
228 | */ |
||
229 | public function updateExternalDBGroups( $user, $addgroups, $delgroups = [] ) { |
||
232 | |||
233 | /** |
||
234 | * Check to see if external accounts can be created. |
||
235 | * Return true if external accounts can be created. |
||
236 | * @return bool |
||
237 | */ |
||
238 | public function canCreateAccounts() { |
||
241 | |||
242 | /** |
||
243 | * Add a user to the external authentication database. |
||
244 | * Return true if successful. |
||
245 | * |
||
246 | * @param User $user Only the name should be assumed valid at this point |
||
247 | * @param string $password |
||
248 | * @param string $email |
||
249 | * @param string $realname |
||
250 | * @return bool |
||
251 | */ |
||
252 | public function addUser( $user, $password, $email = '', $realname = '' ) { |
||
255 | |||
256 | /** |
||
257 | * Return true to prevent logins that don't authenticate here from being |
||
258 | * checked against the local database's password fields. |
||
259 | * |
||
260 | * This is just a question, and shouldn't perform any actions. |
||
261 | * |
||
262 | * @return bool |
||
263 | */ |
||
264 | public function strict() { |
||
267 | |||
268 | /** |
||
269 | * Check if a user should authenticate locally if the global authentication fails. |
||
270 | * If either this or strict() returns true, local authentication is not used. |
||
271 | * |
||
272 | * @param string $username Username. |
||
273 | * @return bool |
||
274 | */ |
||
275 | public function strictUserAuth( $username ) { |
||
278 | |||
279 | /** |
||
280 | * When creating a user account, optionally fill in preferences and such. |
||
281 | * For instance, you might pull the email address or real name from the |
||
282 | * external user database. |
||
283 | * |
||
284 | * The User object is passed by reference so it can be modified; don't |
||
285 | * forget the & on your function declaration. |
||
286 | * |
||
287 | * @deprecated since 1.26, use the UserLoggedIn hook instead. And assigning |
||
288 | * a different User object to $user is no longer supported. |
||
289 | * @param User $user |
||
290 | * @param bool $autocreate True if user is being autocreated on login |
||
291 | */ |
||
292 | public function initUser( &$user, $autocreate = false ) { |
||
295 | |||
296 | /** |
||
297 | * If you want to munge the case of an account name before the final |
||
298 | * check, now is your chance. |
||
299 | * @param string $username |
||
300 | * @return string |
||
301 | */ |
||
302 | public function getCanonicalName( $username ) { |
||
305 | |||
306 | /** |
||
307 | * Get an instance of a User object |
||
308 | * |
||
309 | * @param User $user |
||
310 | * |
||
311 | * @return AuthPluginUser |
||
312 | */ |
||
313 | public function getUserInstance( User &$user ) { |
||
316 | |||
317 | /** |
||
318 | * Get a list of domains (in HTMLForm options format) used. |
||
319 | * |
||
320 | * @return array |
||
321 | */ |
||
322 | public function domainList() { |
||
325 | } |
||
326 | |||
368 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.