andre před 5 roky
rodič
revize
d729e731a7
2 změnil soubory, kde provedl 14 přidání a 2 odebrání
  1. 2 1
      api/Zm/Account.php
  2. 12 1
      zimbraSingle.php

+ 2 - 1
api/Zm/Account.php

@@ -257,9 +257,10 @@ class Zm_Account
 		catch (SoapFault $exception)
 		{
 			$result = $exception;
+			return false;
 		}
 
-		return (!is_a($result, "Exception"));
+		return true;
 	}
 
 	/**

+ 12 - 1
zimbraSingle.php

@@ -505,7 +505,18 @@ function zimbraSingle_CreateAccount($params)
         return $login->getMessage();
     }
     $apiAccountManager = new Zm_Account($api);
-    if($apiAccountManager->accountExists($account_name)) {
+    $accountExists = $apiAccountManager->accountExists($account_name);
+    if(is_a($accountExists, "Exception")) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            "Error: could not check account availibility",
+            $account_name
+        );
+        return false;
+    }
+    if($accountExists === true) {
         return 'Account already exist';
     }
     $attrs = array();