Просмотр исходного кода

Merge branch 'rc1' of andre/whmcsZimbraSingle into master

andre 5 лет назад
Родитель
Сommit
1e7f747770
5 измененных файлов с 254 добавлено и 121 удалено
  1. 97 0
      api/Zm/Account.php
  2. 16 0
      clientarea.tpl
  3. 0 7
      templates/clientarea.tpl
  4. 137 104
      zimbraSingle.inc
  5. 4 10
      zimbraSingle.php

+ 97 - 0
api/Zm/Account.php

@@ -134,6 +134,66 @@ class Zm_Account
 		return $result;
 		return $result;
 	}
 	}
 
 
+	/**
+	 * getAccount
+	 * @param string $name account name
+	 * @return string account informations
+	 */
+	function getAccount($name)
+	{
+		$result = null;
+
+		$params = array(
+			new SoapVar('<ns1:account by="name">' . $name . '</ns1:account>', XSD_ANYXML),
+		);
+
+		try
+		{
+			$result = $this->auth->execSoapCall(
+				"GetAccountRequest",
+				$params
+			);
+
+			$result = $result['SOAP:ENVELOPE']['SOAP:BODY']['GETACCOUNTRESPONSE']['ACCOUNT'];
+		}
+		catch (SoapFault $exception)
+		{
+			$result = $exception;
+		}
+
+		return $result;
+	}
+
+	/**
+	 * getQuota
+	 * @param string $name account name
+	 * @return string account informations
+	 */
+	function getQuota($name)
+	{
+		$result = null;
+
+		$params = array(
+			new SoapVar('<ns1:account by="name">' . $name . '</ns1:account>', XSD_ANYXML),
+		);
+
+		try
+		{
+			$result = $this->auth->execSoapCall(
+				"GetAccountRequest",
+				$params
+			);
+
+			$result = getSoapAttribute($result['SOAP:ENVELOPE']['SOAP:BODY']['GETACCOUNTRESPONSE']['ACCOUNT']['A'], "zimbraMailQuota");
+		}
+		catch (SoapFault $exception)
+		{
+			$result = $exception;
+		}
+
+		return $result;
+	}
+
 	/**
 	/**
 	 * getAccountId
 	 * getAccountId
 	 * @param string $name account name
 	 * @param string $name account name
@@ -236,6 +296,43 @@ class Zm_Account
 		return $result;
 		return $result;
 	}
 	}
 
 
+	/**
+	 * getMailbox
+	 * @param string $idOrNameAccount account id or account name
+	 * @return array informations
+	 */
+	function getMailbox($idOrNameAccount, $type="auto")
+	{
+		if($type == "auto")
+			$realType = getAccountType($idOrNameAccount);
+		else
+			$realType = $type;
+		if($realTyp = 'name')
+			$id = $this->getAccountId($idOrNameAccount);
+
+		$result = null;
+		
+		$params = array(
+			new SoapVar('<ns1:mbox id="' . $id . '" />', XSD_ANYXML),
+		);
+
+		try
+		{
+			$result = $this->auth->execSoapCall(
+				"GetMailboxRequest",
+				$params
+			);
+
+			$result = $result['SOAP:ENVELOPE']['SOAP:BODY'];
+		}
+		catch (SoapFault $exception)
+		{
+			$result = $exception;
+		}
+
+		return $result;
+	}
+
 	/**
 	/**
 	 * getAccountOption
 	 * getAccountOption
 	 * @param string $idOrNameAccount account id or account name
 	 * @param string $idOrNameAccount account id or account name

+ 16 - 0
clientarea.tpl

@@ -0,0 +1,16 @@
+<table width="100%" cellspacing="0" cellpadding="0" class="frame">
+  <tr>
+    <td>
+      <table width="100%" border="0" cellpadding="10" cellspacing="0" class="table table-striped table-framed">
+        <tr>
+          <td align='left'>Webmail</td>
+          <td align="left"><a href="{$webmailurl}" target="_blank">{$webmailurl}</a></td>
+        </tr>
+        <tr>
+          <td align='left'>Mailbox</td>
+          <td align="left">{$usage} Prozent ( {$size} ) von {$quota} benutzt</td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table>

+ 0 - 7
templates/clientarea.tpl

@@ -1,7 +0,0 @@
-<table width="100%" cellspacing="0" cellpadding="0" class="frame">
-    <tr>
-      <td><table width="100%" border="0" cellpadding="10" cellspacing="0" class="table table-striped table-framed">
-          <tr><td align='left'>Webmail</td>
-            <td align="left"><a href="{$webmailURL}" target="_blank">{$webmailURL}</a></td>
-     </table>
-</td></tr></table>

+ 137 - 104
zimbraSingle.inc

@@ -22,21 +22,47 @@ function zimbraSingle_MetaData()
  */
  */
 function zimbraSingleGetAccess()
 function zimbraSingleGetAccess()
 {
 {
+    global $packageid;
     $accessData = array('zimbraServer' => '', 'adminUser' => '', 'adminPass' => '');
     $accessData = array('zimbraServer' => '', 'adminUser' => '', 'adminPass' => '');
     $whmcs = App::self();
     $whmcs = App::self();
+    $productID = $whmcs->get_req_var('id');
     $serverGroupID = $whmcs->get_req_var('servergroup');
     $serverGroupID = $whmcs->get_req_var('servergroup');
-    $serverID = Capsule::table('tblservergroupsrel')
-        ->select('serverid')
-        ->where('groupid', '=', $serverGroupID)
-        ->get();
-    $servers = Capsule::table('tblservers')
+    if($productID) {
+        $serverIDObj = Capsule::table('tblhosting')
+            ->select('server')
+            ->where('id', '=', $productID)
+            ->get();
+            $serverID = $serverIDObj[0]->server;
+    } elseif($serverGroupID) {
+        $serverIDObj = Capsule::table('tblservergroupsrel')
+            ->select('serverid')
+            ->where('groupid', '=', $serverGroupID)
+            ->get();
+        $serverID = $serverIDObj[0]->serverid;
+    } elseif($packageid) {
+        $serverIDObj = Capsule::table('tblhosting')
+            ->select('server')
+            ->where('packageid', '=', $packageid)
+            ->get();
+            $serverID = $serverIDObj[0]->server;
+    } else {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error: could not get accessdata 3",
+            ""
+        );
+        return false;
+    }
+    $server = Capsule::table('tblservers')
         ->select('ipaddress', 'username', 'password')
         ->select('ipaddress', 'username', 'password')
-        ->where('id', '=', $serverID[0]->serverid)
+        ->where('id', '=', $serverID)
         ->where('active', '=', 1)
         ->where('active', '=', 1)
         ->get();
         ->get();
-    $accessData['zimbraServer'] = $servers[0]->ipaddress;
-    $accessData['adminUser'] = $servers[0]->username;
-    $adminPassCrypt = $servers[0]->password;
+    $accessData['zimbraServer'] = $server[0]->ipaddress;
+    $accessData['adminUser'] = $server[0]->username;
+    $adminPassCrypt = $server[0]->password;
     $adminPassDecrypt = localAPI('DecryptPassword', array('password2' => $adminPassCrypt));
     $adminPassDecrypt = localAPI('DecryptPassword', array('password2' => $adminPassCrypt));
     if ($adminPassDecrypt['result'] == 'success') {
     if ($adminPassDecrypt['result'] == 'success') {
         $accessData['adminPass'] = $adminPassDecrypt['password'];
         $accessData['adminPass'] = $adminPassDecrypt['password'];
@@ -55,7 +81,6 @@ function zimbraSingleDoesEMailExist($emailNameOnly, $domainName)
 {
 {
     $account_name = $emailNameOnly . "@" . $domainName;
     $account_name = $emailNameOnly . "@" . $domainName;
     $accessData = zimbraSingleGetAccess();
     $accessData = zimbraSingleGetAccess();
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -91,7 +116,6 @@ function zimbraSingleCreateAccount($userData)
         $userData['password'] = $passDecrypt['password'];
         $userData['password'] = $passDecrypt['password'];
     }
     }
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -113,7 +137,7 @@ function zimbraSingleCreateAccount($userData)
         __FUNCTION__,
         __FUNCTION__,
         $params,
         $params,
         "Error : serviceclass $cosName not available",
         "Error : serviceclass $cosName not available",
-        ""
+        $userData
         );
         );
         return false;
         return false;
     }
     }
@@ -125,7 +149,7 @@ function zimbraSingleCreateAccount($userData)
         __FUNCTION__,
         __FUNCTION__,
         $params,
         $params,
         "Error : account $account_name not created",
         "Error : account $account_name not created",
-        ""
+        $id
         );
         );
         return false;
         return false;
     }
     }
@@ -170,7 +194,6 @@ function zimbraSingleUnsuspendAccount($userData)
 {
 {
     $accessData = zimbraSingleGetAccess();
     $accessData = zimbraSingleGetAccess();
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -203,8 +226,7 @@ function zimbraSingleUnsuspendAccount($userData)
 function zimbraSingleDeleteAccount($userData)
 function zimbraSingleDeleteAccount($userData)
 {
 {
     $accessData = zimbraSingleGetAccess();
     $accessData = zimbraSingleGetAccess();
-    $account_name = $userData['username'] . '@' . $userData['maildomain'];
-
+    $accountName = $userData['username'] . '@' . $userData['maildomain'];
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -216,35 +238,34 @@ function zimbraSingleDeleteAccount($userData)
             ""
             ""
         );
         );
         return false;
         return false;
-    } else {
-        $apiAccountManager = new Zm_Account($api);
-        $response = $apiAccountManager->getAccountStatus($account_name);
-        if(is_a($response, "Exception")) {
-            logModuleCall(
-                'zimbrasingle',
-                __FUNCTION__,
-                $params,
-                "Error : account $account_name could not verified",
-                ""
-            );
-            return false;
-        }
-        if ($response != 'locked') {
-            return "Account $account_name active, suspend account first";
-        }
-        $response = $apiAccountManager->deleteAccount($account_name);
-        if(is_a($response, "Exception")) {
-            logModuleCall(
-                'zimbrasingle',
-                __FUNCTION__,
-                $params,
-                "Error : account $account_name could not removed",
-                ""
-            );
-            return false;
-        }
-        return 'success';
     }
     }
+    $apiAccountManager = new Zm_Account($api);
+    $response = $apiAccountManager->getAccountStatus($accountName);
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : account $accountName could not verified",
+            ""
+        );
+        return false;
+    }
+    if ($response != 'locked') {
+        return "Account $accountName active, suspend account first";
+    }
+    $response = $apiAccountManager->deleteAccount($accountName);
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+        'zimbrasingle',
+        __FUNCTION__,
+        $params,
+        "Error : account $accountName could not removed",
+        ""
+        );
+        return false;
+    }
+    return 'success';
 }
 }
 
 
 function zimbraSingleChangePassword($userData) {
 function zimbraSingleChangePassword($userData) {
@@ -257,7 +278,6 @@ function zimbraSingleChangePassword($userData) {
         return $checkPW;
         return $checkPW;
     }
     }
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -269,28 +289,25 @@ function zimbraSingleChangePassword($userData) {
             ""
             ""
         );
         );
         return false;
         return false;
-    } else {
-        $apiAccountManager = new Zm_Account($api);
-        $response = $apiAccountManager->setAccountPassword($account_name, $userData['password']);
-        if(is_a($response, "Exception")) {
-            logModuleCall(
-                'zimbrasingle',
-                __FUNCTION__,
-                $params,
-                "Error : password for $account_name could not be set",
-                ""
-            );
-            return false;
-        } else {
-            return $response;
-        }
     }
     }
+    $apiAccountManager = new Zm_Account($api);
+    $response = $apiAccountManager->setAccountPassword($account_name, $userData['password']);
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : password for $account_name could not be set",
+            ""
+        );
+        return false;
+    }
+    return 'success';
 }
 }
 
 
 function zimbraSingleChangePackage($userData) {
 function zimbraSingleChangePackage($userData) {
     $accessData = zimbraSingleGetAccess();
     $accessData = zimbraSingleGetAccess();
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -321,8 +338,8 @@ function zimbraSingleChangePackage($userData) {
 function zimbraSingleClientArea($userData)
 function zimbraSingleClientArea($userData)
 {
 {
     $accessData = zimbraSingleGetAccess();
     $accessData = zimbraSingleGetAccess();
+    $clientInfo = array();
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
     $account_name = $userData['username'] . '@' . $userData['maildomain'];
-
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
     $login = $api->login();
     $login = $api->login();
     if(is_a($login, "Exception")) {
     if(is_a($login, "Exception")) {
@@ -334,30 +351,49 @@ function zimbraSingleClientArea($userData)
             ""
             ""
         );
         );
         return false;
         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);
+    $quota = $apiAccountManager->getQuota($account_name);
+    if(is_a($quota, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : could not find $account_name",
+            ""
+        );
+        return false;
+    }
+    $response = $apiAccountManager->getMailbox($account_name);
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : could not fetch mailbox info for $account_name",
+            ""
+        );
+        return false;
+    }
+    $mboxSize = $response['S'];
+    $usagePercent = $mboxSize * 100 / $quota;
+    $clientInfo['quota'] = bytesToHuman($quota);
+    $clientInfo['size'] = bytesToHuman($mboxSize);
+    $clientInfo['usage'] = round($usagePercent, 2);
+    $response = $apiAccountManager->getAccountInfo($account_name);
+    if(is_a($response, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error : could not gather informations for  $account_name",
+            ""
+        );
+        return false;
+    }
+    $webmailUrl = recursiveFindAll( $response, 'PUBLICMAILURL');
+    $clientInfo['webmailurl'] = $webmailUrl[0]['DATA'];
+    return $clientInfo;
 }
 }
 
 
 function zimbraSingleConfigOptions($params) {
 function zimbraSingleConfigOptions($params) {
@@ -435,7 +471,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
                 'showorder' => 'on',
                 'showorder' => 'on',
                 'sortorder' => '0'
                 'sortorder' => '0'
             )
             )
-        );
+    );
     Capsule::table('tblcustomfields')
     Capsule::table('tblcustomfields')
         ->insert(
         ->insert(
             array(
             array(
@@ -447,7 +483,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
                 'showorder' => 'on',
                 'showorder' => 'on',
                 'sortorder' => '1'
                 'sortorder' => '1'
             )
             )
-        );
+    );
     Capsule::table('tblcustomfields')
     Capsule::table('tblcustomfields')
         ->insert(
         ->insert(
             array(
             array(
@@ -459,7 +495,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
                 'showorder' => 'on',
                 'showorder' => 'on',
                 'sortorder' => '2'
                 'sortorder' => '2'
             )
             )
-        );
+    );
     Capsule::table('tblcustomfields')
     Capsule::table('tblcustomfields')
         ->insert(
         ->insert(
             array(
             array(
@@ -472,7 +508,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
                 'showorder' => 'on',
                 'showorder' => 'on',
                 'sortorder' => '3'
                 'sortorder' => '3'
             )
             )
-        );
+    );
     Capsule::table('tblcustomfields')
     Capsule::table('tblcustomfields')
         ->insert(
         ->insert(
             array(
             array(
@@ -484,7 +520,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
                 'showorder' => 'on',
                 'showorder' => 'on',
                 'sortorder' => '4'
                 'sortorder' => '4'
             )
             )
-        );
+    );
     Capsule::table('tblcustomfields')
     Capsule::table('tblcustomfields')
         ->insert(
         ->insert(
             array(
             array(
@@ -497,7 +533,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
                 'required' => 'on',
                 'required' => 'on',
                 'sortorder' => '5'
                 'sortorder' => '5'
             )
             )
-        );
+    );
 }
 }
 
 
 function recursiveFindAll($haystack, $needle)
 function recursiveFindAll($haystack, $needle)
@@ -520,29 +556,26 @@ function zimbraSingleCheckPassword($pwd)
 {
 {
     $message = '';
     $message = '';
     if (strlen($pwd) < 9) {
     if (strlen($pwd) < 9) {
-        $message .= "Das das Passwort ist zu kurz. Es werden mind. 9 Zeichen benötigt<br>";
+        $message .= "Das das Passwort ist zu kurz. Es werden mind. 9 Zeichen benötigt" . PHP_EOL;
     }
     }
-
     if (!preg_match("#[0-9]+#", $pwd)) {
     if (!preg_match("#[0-9]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens eine Zahl enthalten<br>";
+        $message .= "Das Passwort muss mindestens eine Zahl enthalten" . PHP_EOL;
     }
     }
-
     if (!preg_match("#[A-Z]+#", $pwd)) {
     if (!preg_match("#[A-Z]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens einen Grossbuchstaben (A-Z) enthalten<br>";
+        $message .= "Das Passwort muss mindestens einen Grossbuchstaben (A-Z) enthalten" . PHP_EOL;
     }
     }
-
     if (!preg_match("#[a-z]+#", $pwd)) {
     if (!preg_match("#[a-z]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens einen Kleinbuchstaben (a-z) enthalten<br>";
+        $message .= "Das Passwort muss mindestens einen Kleinbuchstaben (a-z) enthalten" . PHP_EOL;
     }
     }
-
     if (!preg_match("#[^\w]+#", $pwd)) {
     if (!preg_match("#[^\w]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens ein Sonderzeichen (.,-:=) enthalten<br>";
+        $message .= "Das Passwort muss mindestens ein Sonderzeichen (.,-:=) enthalten" . PHP_EOL;
     }
     }
     return $message;
     return $message;
 }
 }
 
 
-function zimbraSingleTestFunction()
+function bytesToHuman($bytes)
 {
 {
-    return 'blubb';
-}
-
+    $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
+    for ($i = 0; $bytes > 1024; $i++) $bytes /= 1024;
+    return round($bytes, 2) . ' ' . $units[$i];
+}

+ 4 - 10
zimbraSingle.php

@@ -39,25 +39,19 @@ function zimbraSingle_TestConnection($params)
     }
     }
 }
 }
 
 
-function zimbraSingle_UsageUpdate($params)
-{
-}
-
 function zimbraSingle_ClientArea($params)
 function zimbraSingle_ClientArea($params)
 {
 {
     $response = zimbraSingleClientArea($params['customfields']);
     $response = zimbraSingleClientArea($params['customfields']);
     return array(
     return array(
         'templatefile' => 'clientarea',
         'templatefile' => 'clientarea',
-        'vars' => array(
-            'webmailURL' => $response[0]['DATA'],
-        ),
+        'vars' => $response,
     );
     );
 }
 }
 
 
 function zimbraSingle_ChangePassword($params)
 function zimbraSingle_ChangePassword($params)
 {
 {
     $response = zimbraSingleChangePassword($params['customfields']);
     $response = zimbraSingleChangePassword($params['customfields']);
-    if($response) {
+    if($response == 'success') {
         return 'success';
         return 'success';
     }
     }
     return $response;
     return $response;
@@ -93,10 +87,10 @@ function zimbraSingle_UnsuspendAccount($params)
 function zimbraSingle_TerminateAccount($params)
 function zimbraSingle_TerminateAccount($params)
 {
 {
     $response = zimbraSingleDeleteAccount($params['customfields']);
     $response = zimbraSingleDeleteAccount($params['customfields']);
-    if($response) {
+    if($response == 'success') {
         return 'success';
         return 'success';
     }
     }
-    return 'Error deleting account';
+    return $response;
 }
 }
 
 
 function zimbraSingle_ChangePackage($params)
 function zimbraSingle_ChangePackage($params)