ソースを参照

add mailboxinfo

andre 5 年 前
コミット
9824fcca26
2 ファイル変更42 行追加0 行削除
  1. 30 0
      api/Zm/Account.php
  2. 12 0
      zimbraSingle.inc

+ 30 - 0
api/Zm/Account.php

@@ -296,6 +296,36 @@ class Zm_Account
 		return $result;
 	}
 
+	/**
+	 * getMailboxInfo
+	 * @param string $name account name
+	 * @return string account informations
+	 */
+	function getMailboxInfo($name)
+	{
+		$result = null;
+
+		$params = array(
+			new SoapVar('<ns1:account by="name">' . $name . '</ns1:account>', XSD_ANYXML),
+		);
+
+		try
+		{
+			$result = $this->auth->execSoapCall(
+				"GetMailboxInfoRequest",
+				$params
+			);
+
+			$result = $result['SOAP:ENVELOPE']['SOAP:BODY'];
+		}
+		catch (SoapFault $exception)
+		{
+			$result = $exception;
+		}
+
+		return $result;
+	}
+
 	/**
 	 * getAccountOption
 	 * @param string $idOrNameAccount account id or account name

+ 12 - 0
zimbraSingle.inc

@@ -365,6 +365,18 @@ function zimbraSingleClientArea($userData)
         return false;
     }
 
+    $response = $apiAccountManager->getMailboxInfo($account_name);
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : could not fetch mailbox info for $account_name",
+            ""
+        );
+        return false;
+    }
+
 //    $clientInfo['quota'] = bytesToHuman($bytes);
     logModuleCall(
         'zimbrasingle',