|
@@ -194,7 +194,7 @@ function zimbraSingle_ClientArea($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not gather informations for ' . $params['username'],
|
|
'Error: could not gather informations for ' . $params['username'],
|
|
|
- $accountInfo->getMessage()
|
|
|
|
|
|
|
+ $accountInfo
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -243,7 +243,7 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error : could not find quota for ' . $product['username'],
|
|
'Error : could not find quota for ' . $product['username'],
|
|
|
- $accountQuota->getMessage()
|
|
|
|
|
|
|
+ $accountQuota
|
|
|
);
|
|
);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -254,7 +254,7 @@ function zimbraSingle_UsageUpdate($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not fetch mailbox info for ' . $product['username'],
|
|
'Error: could not fetch mailbox info for ' . $product['username'],
|
|
|
- $mboxObj->getMessage()
|
|
|
|
|
|
|
+ $mboxObj
|
|
|
);
|
|
);
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
@@ -323,7 +323,7 @@ function zimbraSingle_ChangePassword($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: password could not be set for ' . $params['username'],
|
|
'Error: password could not be set for ' . $params['username'],
|
|
|
- $response->getMessage()
|
|
|
|
|
|
|
+ $response
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -368,7 +368,7 @@ function zimbraSingle_CreateAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not verify ' . $params['username'],
|
|
'Error: could not verify ' . $params['username'],
|
|
|
- $accountExists->getMessage()
|
|
|
|
|
|
|
+ $accountExists
|
|
|
);
|
|
);
|
|
|
return 'Error: could not verify '. $params['username'];
|
|
return 'Error: could not verify '. $params['username'];
|
|
|
}
|
|
}
|
|
@@ -399,7 +399,7 @@ function zimbraSingle_CreateAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not find serviceclass ' . $params['configoption1'],
|
|
'Error: could not find serviceclass ' . $params['configoption1'],
|
|
|
- $cosID->getMessage()
|
|
|
|
|
|
|
+ $cosID
|
|
|
);
|
|
);
|
|
|
return 'Error: could not find serviceclass ' . $params['configoption1'];
|
|
return 'Error: could not find serviceclass ' . $params['configoption1'];
|
|
|
}
|
|
}
|
|
@@ -411,7 +411,7 @@ function zimbraSingle_CreateAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not create account ' . $params['username'],
|
|
'Error: could not create account ' . $params['username'],
|
|
|
- $zimbraID->getMessage()
|
|
|
|
|
|
|
+ $zimbraID
|
|
|
);
|
|
);
|
|
|
return 'Error: could not create account ' . $params['username'];
|
|
return 'Error: could not create account ' . $params['username'];
|
|
|
}
|
|
}
|
|
@@ -471,7 +471,7 @@ function zimbraSingle_SuspendAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not lock account ' . $params['username'],
|
|
'Error: could not lock account ' . $params['username'],
|
|
|
- $response->getMessage()
|
|
|
|
|
|
|
+ $response
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -512,7 +512,7 @@ function zimbraSingle_UnsuspendAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not unlock account ' . $params['username'],
|
|
'Error: could not unlock account ' . $params['username'],
|
|
|
- $response->getMessage()
|
|
|
|
|
|
|
+ $response
|
|
|
);
|
|
);
|
|
|
return 'Error: could not unlock account ' . $params['username'];
|
|
return 'Error: could not unlock account ' . $params['username'];
|
|
|
}
|
|
}
|
|
@@ -552,7 +552,7 @@ function zimbraSingle_TerminateAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not verify account '. $params['username'],
|
|
'Error: could not verify account '. $params['username'],
|
|
|
- $accountStatus->getMessage()
|
|
|
|
|
|
|
+ $accountStatus
|
|
|
);
|
|
);
|
|
|
return 'Error : account ' . $params['username'] . ' Name could not verified';
|
|
return 'Error : account ' . $params['username'] . ' Name could not verified';
|
|
|
}
|
|
}
|
|
@@ -566,7 +566,7 @@ function zimbraSingle_TerminateAccount($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not remove account '. $params['username'],
|
|
'Error: could not remove account '. $params['username'],
|
|
|
- $response->getMessage()
|
|
|
|
|
|
|
+ $response
|
|
|
);
|
|
);
|
|
|
return 'Error: could not remove account '. $params['username'];
|
|
return 'Error: could not remove account '. $params['username'];
|
|
|
}
|
|
}
|
|
@@ -610,7 +610,7 @@ function zimbraSingle_ChangePackage($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not set class of service for '. $params['username'],
|
|
'Error: could not set class of service for '. $params['username'],
|
|
|
- $response->getMessage()
|
|
|
|
|
|
|
+ $response
|
|
|
);
|
|
);
|
|
|
return 'Error: could not set class of service for '. $params['username'];
|
|
return 'Error: could not set class of service for '. $params['username'];
|
|
|
}
|
|
}
|
|
@@ -621,7 +621,7 @@ function zimbraSingle_ChangePackage($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error : could not find quota for ' . $params['username'],
|
|
'Error : could not find quota for ' . $params['username'],
|
|
|
- $accountQuota->getMessage()
|
|
|
|
|
|
|
+ $accountQuota
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
try {
|
|
try {
|
|
@@ -704,7 +704,7 @@ function zimbraSingle_ConfigOptions($params) {
|
|
|
__FUNCTION__,
|
|
__FUNCTION__,
|
|
|
$params,
|
|
$params,
|
|
|
'Error: could not fetch classes of service',
|
|
'Error: could not fetch classes of service',
|
|
|
- $cosIDs->getMessage()
|
|
|
|
|
|
|
+ $cosIDs
|
|
|
);
|
|
);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
@@ -757,18 +757,24 @@ function zimbraSingle_ServiceSingleSignOn($params) {
|
|
|
);
|
|
);
|
|
|
return $domainOptions->getMessage();
|
|
return $domainOptions->getMessage();
|
|
|
}
|
|
}
|
|
|
- $preAuthKey = $domainOptions['zimbraPreAuthKey'];
|
|
|
|
|
- $userAuth = new Zm_Auth($params['serverhostname'], $params['username'], $preAuthKey, 'user');
|
|
|
|
|
- $authToken = $userAuth->login();
|
|
|
|
|
- logModuleCall(
|
|
|
|
|
- 'zimbrasingle',
|
|
|
|
|
- __FUNCTION__,
|
|
|
|
|
- $params,
|
|
|
|
|
- 'Debug',
|
|
|
|
|
- $authToken
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ $preAuthKey = $domainOptions['zimbraPreAuthKey']; $apiAccountManager = new Zm_Account($api);
|
|
|
|
|
+ $accountInfo = $apiAccountManager->getAccountInfo($params['username']);
|
|
|
|
|
+ if(is_a($accountInfo, 'Exception')) {
|
|
|
|
|
+ logModuleCall(
|
|
|
|
|
+ 'zimbrasingle',
|
|
|
|
|
+ __FUNCTION__,
|
|
|
|
|
+ $params,
|
|
|
|
|
+ 'Error: could not gather informations for ' . $params['username'],
|
|
|
|
|
+ $accountInfo
|
|
|
|
|
+ );
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ $webmailUrl = zimbraSingleFindAll($accountInfo, 'PUBLICMAILURL');
|
|
|
|
|
+ $timestamp=time()*1000;
|
|
|
|
|
+ $preauthToken=hash_hmac("sha1",$username."|name|0|".$timestamp,$preAuthKey);
|
|
|
|
|
+ $preauthURL = $webmailUrl[0]['DATA']."?account=".$username."&by=name×tamp=".$timestamp."&expires=0&preauth=".$preauthToken;
|
|
|
return array(
|
|
return array(
|
|
|
'success' => true,
|
|
'success' => true,
|
|
|
- 'redirectTo' => 'https://testserver.test.local/' . $authToken,
|
|
|
|
|
|
|
+ 'redirectTo' => $preauthURL,
|
|
|
);
|
|
);
|
|
|
-}
|
|
|
|
|
|
|
+}
|