Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
forgot_username
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
forgot_username
Commits
1a76b2e4
Commit
1a76b2e4
authored
4 months ago
by
Tolga Özses
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3470008
by nikathone, yospyn: 'username_reset' is not a supported key
parent
44c0fcc0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
forgot_username.install
+21
-0
21 additions, 0 deletions
forgot_username.install
forgot_username.module
+14
-0
14 additions, 0 deletions
forgot_username.module
with
35 additions
and
0 deletions
forgot_username.install
0 → 100644
+
21
−
0
View file @
1a76b2e4
<?php
/**
* @file
* Contains install, update and uninstall functions for forgot_username.
*/
/**
* Implements hook_uninstall().
*/
function
forgot_username_uninstall
(
$is_syncing
)
{
$config
=
\Drupal
::
configFactory
()
->
getEditable
(
'user.settings'
);
$mail_config
=
\Drupal
::
configFactory
()
->
getEditable
(
'user.mail'
);
// Remove the unwanted configuration lines.
$config
->
clear
(
'notify.username_reset'
);
$mail_config
->
clear
(
'username_reset'
);
$config
->
save
();
$mail_config
->
save
();
}
This diff is collapsed.
Click to expand it.
forgot_username.module
+
14
−
0
View file @
1a76b2e4
...
...
@@ -27,6 +27,20 @@ function forgot_username_help($route_name, RouteMatchInterface $route_match) {
}
}
/**
* Implements hook_config_schema_info_alter().
*/
function
forgot_username_config_schema_info_alter
(
array
&
$definitions
)
{
$definitions
[
'user.settings'
][
'mapping'
][
'notify'
][
'mapping'
][
'username_reset'
]
=
[
'type'
=>
'boolean'
,
'label'
=>
'Notify of forgotten username'
,
];
$definitions
[
'user.mail'
][
'mapping'
][
'username_reset'
]
=
[
'type'
=>
'mail'
,
'label'
=>
'Username reset'
,
];
}
/**
* Implements hook_mail().
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment