[Web] fix bug on mailbox login
This commit is contained in:
@@ -2146,7 +2146,7 @@ function identity_provider($_action, $_data = null, $_extra = null) {
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// get mapped template, if not set return false
|
||||
// also return false if no mappers were defined
|
||||
$provider = identity_provider('get');
|
||||
@@ -2160,9 +2160,10 @@ function identity_provider($_action, $_data = null, $_extra = null) {
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// check if matching attribute exist
|
||||
if (array_search($user_template, $provider['mappers']) === false) {
|
||||
$mapper_key = array_search($user_template, $provider['mappers']);
|
||||
if ($mapper_key === false) {
|
||||
clear_session();
|
||||
$_SESSION['return'][] = array(
|
||||
'type' => 'danger',
|
||||
@@ -2171,13 +2172,13 @@ function identity_provider($_action, $_data = null, $_extra = null) {
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// create mailbox
|
||||
$create_res = mailbox('add', 'mailbox_from_template', array(
|
||||
'domain' => explode('@', $info['email'])[1],
|
||||
'local_part' => explode('@', $info['email'])[0],
|
||||
'authsource' => identity_provider('get')['authsource'],
|
||||
'template' => $user_template
|
||||
'template' => $provider['templates'][$mapper_key]
|
||||
));
|
||||
if (!$create_res){
|
||||
clear_session();
|
||||
|
Reference in New Issue
Block a user