If you are using the current version of MediaWiki (at the time of publication 1.32, but this applies to 1.18), most of the hooks in Karsten Schmitz's accepted answer are now outdated or even deleted, so I will post a similar solution with the currently available hooks (which work with AuthManager )
As usual, add the following lines to LocalSettings.php :
This will remove the password reset links and help log in to the login page. If you want to add another link, just replace false valid HTML link, for example <a href="https://urltopasswordchangesite">I forgot my password</a> :
$wgHooks['AuthChangeFormFields'][] = function ( $requests, $fieldInfo, &$formDescriptor, $action ) { if ($action === "login") { // Removes the "Help for logging in" link $formDescriptor["linkcontainer"]["default"] = false; // Removes the actual password reset link $formDescriptor["passwordReset"]["default"] = false; } return true; };
This hook will remove the password reset button in the user settings panel:
$wgHooks['GetPreferences'][] = function ( $user, &$preferences ) { unset( $preferences['password'] ); return true; };
Finally, the easiest way to disable password and credential changes is to disable the corresponding special pages:
$wgHooks['SpecialPage_initList'][] = function ( &$list ) { unset( $list['ChangeCredentials'] ); unset( $list['PasswordReset'] ); return true; };
source share