|
|
@@ -745,26 +745,23 @@ function zimbraSingle_ServiceSingleSignOn($params) {
|
|
|
);
|
|
|
return $login->getMessage();
|
|
|
}
|
|
|
- $apiAccountManager = new Zm_Domain($api);
|
|
|
- $accountOptions = $apiAccountManager->getDomainOptions($params['customfields']['maildomain']);
|
|
|
- if(is_a($accountOptions, 'Exception')) {
|
|
|
+ $apiDomainManager = new Zm_Domain($api);
|
|
|
+ $domainOptions = $apiDomainManager->getDomainOptions($params['customfields']['maildomain']);
|
|
|
+ if(is_a($domainOptions, 'Exception')) {
|
|
|
logModuleCall(
|
|
|
'zimbrasingle',
|
|
|
__FUNCTION__,
|
|
|
$params,
|
|
|
- 'Error : could not find quota for ' . $params['username'],
|
|
|
- $accountOptions->getMessage()
|
|
|
+ 'Error : could not fetch options for ' . $params['customfields']['maildomain'],
|
|
|
+ $domainOptions->getMessage()
|
|
|
);
|
|
|
+ return $domainOptions->getMessage();
|
|
|
}
|
|
|
- logModuleCall(
|
|
|
- 'zimbrasingle',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- 'Debug',
|
|
|
- $accountOptions
|
|
|
- );
|
|
|
+ $preAuthKey = $domainOptions['zimbraPreAuthKey'];
|
|
|
+ $apiAccountManager= new Zm_Account($api);
|
|
|
+ $authToken = $apiAccountManager->getAccountToken($params['username'], $preAuthKey, '1000');
|
|
|
return array(
|
|
|
'success' => true,
|
|
|
- 'redirectTo' => 'https://testserver.test.local/',
|
|
|
+ 'redirectTo' => 'https://testserver.test.local/' . $authToken,
|
|
|
);
|
|
|
}
|