mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-04-19 14:10:14 +00:00
Added check to ensure email field does not get a double extension.
This commit is contained in:
parent
5e76ca785f
commit
a391d4e2a5
@ -84,10 +84,19 @@ function IMAP_PAM_check($username, $password ){
|
||||
$fullname = $username;
|
||||
}
|
||||
|
||||
// ensure email domain is not doubled in email field
|
||||
@list($tmp_user, $tmp_domain) = explode('@', $username);
|
||||
if( empty($tmp_domain) ) {
|
||||
$email_address = $username . "@" . $c->authenticate_hook['config']['email_base'];
|
||||
}
|
||||
else {
|
||||
$email_address = $username;
|
||||
}
|
||||
|
||||
$principal->Create( array(
|
||||
'username' => $username,
|
||||
'user_active' => true,
|
||||
'email' => $username . "@" . $c->authenticate_hook['config']['email_base'],
|
||||
'email' => $email_address,
|
||||
'modified' => date('c'),
|
||||
'fullname' => $fullname
|
||||
));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user