flarum-ext-auth-ldap
flarum-ext-auth-ldap copied to clipboard
Make `mail` attribute optional
Currently, mail attribute seems to be required. Would it be possible to make it optional and let the user enter an email when creating the account ?
I just made a test by not providing the email address in the Controller. The LDAP connection modal asked me to type an Email address that later need to be verified, which is what I would expect in this case.
--- LDAPAuthController.php 2022-11-20 14:11:25.000000000 +0100
+++ "LDAPAuthController copy.php" 2022-11-20 14:11:10.000000000 +0100
@@ -77,7 +77,7 @@
function (Registration $registration) use ($user, $userLdapUsername, $userLdapMail) {
$registration
->provide('username', $user[strtolower($userLdapUsername)][0])
- ->provideTrustedEmail($user[strtolower($userLdapMail)][0])
+ // ->provideTrustedEmail($user[strtolower($userLdapMail)][0])
//->provideAvatar($user->getJpegPhoto())
->setPayload((array)$user['dn']);
}
I have little time to test it out myself, could you try the mentioned PR above?