Skip to content

Commit b3c0459

Browse files
committed
Added support to automatically convert provided usernames to lowercase to help enforce consistency for folder names based on username.
1 parent e108ac5 commit b3c0459

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

configuration.example.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
'127.0.0.1'
2323
];
2424

25+
// Force usernames to lowercase (helps enforce consistency when creating folder names automatically based on username):
26+
$convert_username_to_lowercase = true;
27+
2528
// Special functionality to strip email domains automatically from the username if provided:
2629
$domains_to_strip_automatically = [
2730
'example.com',

functions.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ function authenticateUser() {
3030
if (!empty($data)) {
3131

3232
try {
33-
global $connections, $domains_to_strip_automatically;
33+
global $connections, $domains_to_strip_automatically, $convert_username_to_lowercase;
34+
35+
if (isset($convert_username_to_lowercase) && $convert_username_to_lowercase === true) {
36+
$data['username'] = strtolower($data['username']);
37+
}
3438

3539
// Strip specific organization email domains if provided:
3640
if (isset($domains_to_strip_automatically)) {

0 commit comments

Comments
 (0)