|
|
@@ -327,21 +327,46 @@ function zimbraSingleClientArea($userData)
|
|
|
""
|
|
|
);
|
|
|
return false;
|
|
|
+ } else {
|
|
|
+ $apiAccountManager = new Zm_Account($api);
|
|
|
+ $response = $apiAccountManager->getAccountInfo($account_name);
|
|
|
+ if(is_a($response, "Exception")) {
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ "Error : could not gather informations for $account_name",
|
|
|
+ ""
|
|
|
+ );
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ $webMailURL = recursiveFindAll( $response, 'PUBLICMAILURL');
|
|
|
+ logModuleCall(
|
|
|
+ 'zimbrasingle',
|
|
|
+ __FUNCTION__,
|
|
|
+ $params,
|
|
|
+ "debug",
|
|
|
+ $webMailURL
|
|
|
+ );
|
|
|
+ return $webMailURL;
|
|
|
+ }
|
|
|
}
|
|
|
- $apiAccountManager = new Zm_Account($api);
|
|
|
- $response = $apiAccountManager->getAccountInfo($account_name);
|
|
|
- if(is_a($response, "Exception")) {
|
|
|
- logModuleCall(
|
|
|
- 'zimbrasingle',
|
|
|
- __FUNCTION__,
|
|
|
- $params,
|
|
|
- "Error : could not gather informations for $account_name",
|
|
|
- ""
|
|
|
- );
|
|
|
- return false;
|
|
|
+}
|
|
|
+
|
|
|
+function recursiveFindAll($haystack, $needle)
|
|
|
+{
|
|
|
+ $values = array();
|
|
|
+ $iterator = new RecursiveArrayIterator($haystack);
|
|
|
+ $recursive = new RecursiveIteratorIterator(
|
|
|
+ $iterator,
|
|
|
+ RecursiveIteratorIterator::SELF_FIRST
|
|
|
+ );
|
|
|
+ foreach ($recursive as $key => $value) {
|
|
|
+ if ($key === $needle) {
|
|
|
+ array_push($values, $value);
|
|
|
+ }
|
|
|
}
|
|
|
- $webMailURL = recursiveFindAll( $response, 'PUBLICMAILURL');
|
|
|
- return $webMailURL[0]['DATA'];
|
|
|
+ return $values;
|
|
|
}
|
|
|
|
|
|
function zimbraSingleConfigOptions() {
|
|
|
@@ -415,23 +440,8 @@ function zimbraSingleCheckPassword($pwd)
|
|
|
return $message;
|
|
|
}
|
|
|
|
|
|
-function recursiveFindAll($haystack, $needle)
|
|
|
-{
|
|
|
- $values = array();
|
|
|
- $iterator = new RecursiveArrayIterator($haystack);
|
|
|
- $recursive = new RecursiveIteratorIterator(
|
|
|
- $iterator,
|
|
|
- RecursiveIteratorIterator::SELF_FIRST
|
|
|
- );
|
|
|
- foreach ($recursive as $key => $value) {
|
|
|
- if ($key === $needle) {
|
|
|
- array_push($values, $value);
|
|
|
- }
|
|
|
- }
|
|
|
- return $values;
|
|
|
-}
|
|
|
-
|
|
|
function zimbraSingleTestFunction()
|
|
|
{
|
|
|
return 'blubb';
|
|
|
}
|
|
|
+
|