mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-20 01:44:15 +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;
|
$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(
|
$principal->Create( array(
|
||||||
'username' => $username,
|
'username' => $username,
|
||||||
'user_active' => true,
|
'user_active' => true,
|
||||||
'email' => $username . "@" . $c->authenticate_hook['config']['email_base'],
|
'email' => $email_address,
|
||||||
'modified' => date('c'),
|
'modified' => date('c'),
|
||||||
'fullname' => $fullname
|
'fullname' => $fullname
|
||||||
));
|
));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user