Kaynağa Gözat

Merge branch 'cleanup' of andre/whmcsZimbraSingle into master

andre 5 yıl önce
ebeveyn
işleme
22b1ed172d

+ 73 - 177
Doc/files/zimbrasingle.html

@@ -87,39 +87,11 @@
 
 <dl class="phpdocumentor-table-of-contents">
                         <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleGetAccess">zimbraSingleGetAccess()</a>
-    <span>
-                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
-</dt>
-<dd>Helper function to get the zimbra server access data from whmcs database</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields">zimbraSingleCreateCustomFields()</a>
-    <span>
-                        &nbsp;: bool    </span>
-</dt>
-<dd>Helper function creates all necessary custom fields depending on selected configuration options</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_recursiveFindAll">recursiveFindAll()</a>
     <span>
                         &nbsp;: array&lt;string|int, mixed&gt;    </span>
 </dt>
-<dd>Helper function to find values of a named key in a multidimensional array or object</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCheckPassword">zimbraSingleCheckPassword()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Helper function to check a password strength</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_bytesToHuman">bytesToHuman()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Convert raw byte value to human readable</dd>
+<dd>Helper function to find values of a named key in a multidimensional arrays or objects</dd>
 
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_MetaData">zimbraSingle_MetaData()</a>
@@ -142,6 +114,13 @@
 </dt>
 <dd>Client area output logic handling.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate">zimbraSingle_UsageUpdate()</a>
+    <span>
+                        &nbsp;: mixed    </span>
+</dt>
+<dd>Usage Update</dd>
+
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_ChangePassword">zimbraSingle_ChangePassword()</a>
     <span>
@@ -202,69 +181,6 @@
             <a href="files/zimbrasingle.html#functions" class="headerlink"><i class="fas fa-link"></i></a>
         </h3>
                     <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleGetAccess">
-        zimbraSingleGetAccess()
-        <a href="namespaces/default.html#function_zimbraSingleGetAccess" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">37</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to get the zimbra server access data from whmcs database</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleGetAccess</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-    
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCreateCustomFields">
-        zimbraSingleCreateCustomFields()
-        <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">96</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function creates all necessary custom fields depending on selected configuration options</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCreateCustomFields</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$packageconfigoption</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$packageconfigoption</span>
-                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>{
-@type string 1 class of service
-@type string 2 comma seperated list of maildomains
-}</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_recursiveFindAll">
         recursiveFindAll()
         <a href="namespaces/default.html#function_recursiveFindAll" class="headerlink"><i class="fas fa-link"></i></a>
@@ -272,10 +188,10 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">210</span>
+    <span class="phpdocumentor-element-found-in__line">35</span>
 </aside>
 
-        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional array or object</p>
+        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional arrays or objects</p>
 
     <code class="phpdocumentor-code phpdocumentor-signature ">
     <span class="phpdocumentor-signature__visibility"></span>
@@ -308,79 +224,6 @@
     
 
     
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCheckPassword">
-        zimbraSingleCheckPassword()
-        <a href="namespaces/default.html#function_zimbraSingleCheckPassword" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">232</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to check a password strength</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCheckPassword</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$pwd</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$pwd</span>
-                : <span class="phpdocumentor-signature__argument__return-type">string</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>password to check</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_bytesToHuman">
-        bytesToHuman()
-        <a href="namespaces/default.html#function_bytesToHuman" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">261</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Convert raw byte value to human readable</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">bytesToHuman</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"><p>Helper function to convert byte in huam readable format</p>
-</section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$bytes</span>
-                : <span class="phpdocumentor-signature__argument__return-type">int</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>value in bytes</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_MetaData">
@@ -390,7 +233,7 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">278</span>
+    <span class="phpdocumentor-element-found-in__line">61</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define module related meta data.</p>
@@ -431,7 +274,7 @@ settings.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">308</span>
+    <span class="phpdocumentor-element-found-in__line">91</span>
 </aside>
 
         <p class="phpdocumentor-summary">Test connection to a Zimbra server with the given server parameters.</p>
@@ -488,7 +331,7 @@ existing server.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">362</span>
+    <span class="phpdocumentor-element-found-in__line">144</span>
 </aside>
 
         <p class="phpdocumentor-summary">Client area output logic handling.</p>
@@ -551,6 +394,59 @@ template or they will not be visible to the end user.</p>
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_UsageUpdate">
+        zimbraSingle_UsageUpdate()
+        <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate" class="headerlink"><i class="fas fa-link"></i></a>
+    </h4>
+    <aside class="phpdocumentor-element-found-in">
+    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
+    :
+    <span class="phpdocumentor-element-found-in__line">188</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Usage Update</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_UsageUpdate</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$params</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
+
+        <section class="phpdocumentor-description"><p>Important: Runs daily per server not per product
+Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestats</p>
+</section>
+
+        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
+    <dl class="phpdocumentor-argument-list">
+                    <dt class="phpdocumentor-argument-list__entry">
+                <span class="phpdocumentor-signature__argument__name">$params</span>
+                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
+                            </dt>
+            <dd class="phpdocumentor-argument-list__definition">
+                    <section class="phpdocumentor-description"><p>common module parameters</p>
+</section>
+
+            </dd>
+            </dl>
+
+    
+    <h5 class="phpdocumentor-tag-list__heading" id="tags">
+        Tags
+        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
+    </h5>
+    <dl class="phpdocumentor-tag-list">
+                                    <dt class="phpdocumentor-tag-list__entry">
+                    <span class="phpdocumentor-tag__name">see</span>
+                </dt>
+                <dd class="phpdocumentor-tag-list__definition">
+                                                                                    <span class="phpdocumentor-tag-link"><a href="https://developers.whmcs.com/provisioning-modules/usage-update/"><abbr title="https://developers.whmcs.com/provisioning-modules/usage-update/">https://developers.whmcs.com/provisioning-modules/usage-update/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ChangePassword">
@@ -560,7 +456,7 @@ template or they will not be visible to the end user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">442</span>
+    <span class="phpdocumentor-element-found-in__line">269</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -616,7 +512,7 @@ active status.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">492</span>
+    <span class="phpdocumentor-element-found-in__line">314</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -675,7 +571,7 @@ configuration, this can be any of:</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">579</span>
+    <span class="phpdocumentor-element-found-in__line">419</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -729,7 +625,7 @@ user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">623</span>
+    <span class="phpdocumentor-element-found-in__line">461</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -783,7 +679,7 @@ can be called manually by admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">666</span>
+    <span class="phpdocumentor-element-found-in__line">502</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -836,7 +732,7 @@ overdue products if enabled, or requested manually by an admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">727</span>
+    <span class="phpdocumentor-element-found-in__line">561</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -892,7 +788,7 @@ products and configurable options.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">768</span>
+    <span class="phpdocumentor-element-found-in__line">600</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>

+ 73 - 177
Doc/index.html

@@ -83,39 +83,11 @@
 
 <dl class="phpdocumentor-table-of-contents">
                         <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleGetAccess">zimbraSingleGetAccess()</a>
-    <span>
-                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
-</dt>
-<dd>Helper function to get the zimbra server access data from whmcs database</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields">zimbraSingleCreateCustomFields()</a>
-    <span>
-                        &nbsp;: bool    </span>
-</dt>
-<dd>Helper function creates all necessary custom fields depending on selected configuration options</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_recursiveFindAll">recursiveFindAll()</a>
     <span>
                         &nbsp;: array&lt;string|int, mixed&gt;    </span>
 </dt>
-<dd>Helper function to find values of a named key in a multidimensional array or object</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCheckPassword">zimbraSingleCheckPassword()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Helper function to check a password strength</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_bytesToHuman">bytesToHuman()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Convert raw byte value to human readable</dd>
+<dd>Helper function to find values of a named key in a multidimensional arrays or objects</dd>
 
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_MetaData">zimbraSingle_MetaData()</a>
@@ -138,6 +110,13 @@
 </dt>
 <dd>Client area output logic handling.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate">zimbraSingle_UsageUpdate()</a>
+    <span>
+                        &nbsp;: mixed    </span>
+</dt>
+<dd>Usage Update</dd>
+
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_ChangePassword">zimbraSingle_ChangePassword()</a>
     <span>
@@ -197,69 +176,6 @@
             <a href="namespaces/default.html#functions" class="headerlink"><i class="fas fa-link"></i></a>
         </h3>
                     <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleGetAccess">
-        zimbraSingleGetAccess()
-        <a href="namespaces/default.html#function_zimbraSingleGetAccess" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">37</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to get the zimbra server access data from whmcs database</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleGetAccess</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-    
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCreateCustomFields">
-        zimbraSingleCreateCustomFields()
-        <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">96</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function creates all necessary custom fields depending on selected configuration options</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCreateCustomFields</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$packageconfigoption</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$packageconfigoption</span>
-                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>{
-@type string 1 class of service
-@type string 2 comma seperated list of maildomains
-}</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_recursiveFindAll">
         recursiveFindAll()
         <a href="namespaces/default.html#function_recursiveFindAll" class="headerlink"><i class="fas fa-link"></i></a>
@@ -267,10 +183,10 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">210</span>
+    <span class="phpdocumentor-element-found-in__line">35</span>
 </aside>
 
-        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional array or object</p>
+        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional arrays or objects</p>
 
     <code class="phpdocumentor-code phpdocumentor-signature ">
     <span class="phpdocumentor-signature__visibility"></span>
@@ -303,79 +219,6 @@
     
 
     
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCheckPassword">
-        zimbraSingleCheckPassword()
-        <a href="namespaces/default.html#function_zimbraSingleCheckPassword" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">232</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to check a password strength</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCheckPassword</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$pwd</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$pwd</span>
-                : <span class="phpdocumentor-signature__argument__return-type">string</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>password to check</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_bytesToHuman">
-        bytesToHuman()
-        <a href="namespaces/default.html#function_bytesToHuman" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">261</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Convert raw byte value to human readable</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">bytesToHuman</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"><p>Helper function to convert byte in huam readable format</p>
-</section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$bytes</span>
-                : <span class="phpdocumentor-signature__argument__return-type">int</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>value in bytes</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_MetaData">
@@ -385,7 +228,7 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">278</span>
+    <span class="phpdocumentor-element-found-in__line">61</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define module related meta data.</p>
@@ -426,7 +269,7 @@ settings.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">308</span>
+    <span class="phpdocumentor-element-found-in__line">91</span>
 </aside>
 
         <p class="phpdocumentor-summary">Test connection to a Zimbra server with the given server parameters.</p>
@@ -483,7 +326,7 @@ existing server.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">362</span>
+    <span class="phpdocumentor-element-found-in__line">144</span>
 </aside>
 
         <p class="phpdocumentor-summary">Client area output logic handling.</p>
@@ -546,6 +389,59 @@ template or they will not be visible to the end user.</p>
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_UsageUpdate">
+        zimbraSingle_UsageUpdate()
+        <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate" class="headerlink"><i class="fas fa-link"></i></a>
+    </h4>
+    <aside class="phpdocumentor-element-found-in">
+    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
+    :
+    <span class="phpdocumentor-element-found-in__line">188</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Usage Update</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_UsageUpdate</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$params</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
+
+        <section class="phpdocumentor-description"><p>Important: Runs daily per server not per product
+Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestats</p>
+</section>
+
+        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
+    <dl class="phpdocumentor-argument-list">
+                    <dt class="phpdocumentor-argument-list__entry">
+                <span class="phpdocumentor-signature__argument__name">$params</span>
+                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
+                            </dt>
+            <dd class="phpdocumentor-argument-list__definition">
+                    <section class="phpdocumentor-description"><p>common module parameters</p>
+</section>
+
+            </dd>
+            </dl>
+
+    
+    <h5 class="phpdocumentor-tag-list__heading" id="tags">
+        Tags
+        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
+    </h5>
+    <dl class="phpdocumentor-tag-list">
+                                    <dt class="phpdocumentor-tag-list__entry">
+                    <span class="phpdocumentor-tag__name">see</span>
+                </dt>
+                <dd class="phpdocumentor-tag-list__definition">
+                                                                                    <span class="phpdocumentor-tag-link"><a href="https://developers.whmcs.com/provisioning-modules/usage-update/"><abbr title="https://developers.whmcs.com/provisioning-modules/usage-update/">https://developers.whmcs.com/provisioning-modules/usage-update/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ChangePassword">
@@ -555,7 +451,7 @@ template or they will not be visible to the end user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">442</span>
+    <span class="phpdocumentor-element-found-in__line">269</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -611,7 +507,7 @@ active status.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">492</span>
+    <span class="phpdocumentor-element-found-in__line">314</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -670,7 +566,7 @@ configuration, this can be any of:</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">579</span>
+    <span class="phpdocumentor-element-found-in__line">419</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -724,7 +620,7 @@ user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">623</span>
+    <span class="phpdocumentor-element-found-in__line">461</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -778,7 +674,7 @@ can be called manually by admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">666</span>
+    <span class="phpdocumentor-element-found-in__line">502</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -831,7 +727,7 @@ overdue products if enabled, or requested manually by an admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">727</span>
+    <span class="phpdocumentor-element-found-in__line">561</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -887,7 +783,7 @@ products and configurable options.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">768</span>
+    <span class="phpdocumentor-element-found-in__line">600</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>

+ 6 - 21
Doc/js/searchIndex.js

@@ -1,30 +1,10 @@
 Search.appendIndex(
     [
                 {
-            "fqsen": "\\zimbraSingleGetAccess\u0028\u0029",
-            "name": "zimbraSingleGetAccess",
-            "summary": "Helper\u0020function\u0020to\u0020get\u0020the\u0020zimbra\u0020server\u0020access\u0020data\u0020from\u0020whmcs\u0020database",
-            "url": "namespaces/default.html#function_zimbraSingleGetAccess"
-        },                {
-            "fqsen": "\\zimbraSingleCreateCustomFields\u0028\u0029",
-            "name": "zimbraSingleCreateCustomFields",
-            "summary": "Helper\u0020function\u0020creates\u0020all\u0020necessary\u0020custom\u0020fields\u0020depending\u0020on\u0020selected\u0020configuration\u0020options",
-            "url": "namespaces/default.html#function_zimbraSingleCreateCustomFields"
-        },                {
             "fqsen": "\\recursiveFindAll\u0028\u0029",
             "name": "recursiveFindAll",
-            "summary": "Helper\u0020function\u0020to\u0020find\u0020values\u0020of\u0020a\u0020named\u0020key\u0020in\u0020a\u0020multidimensional\u0020array\u0020or\u0020object",
+            "summary": "Helper\u0020function\u0020to\u0020find\u0020values\u0020of\u0020a\u0020named\u0020key\u0020in\u0020a\u0020multidimensional\u0020arrays\u0020or\u0020objects",
             "url": "namespaces/default.html#function_recursiveFindAll"
-        },                {
-            "fqsen": "\\zimbraSingleCheckPassword\u0028\u0029",
-            "name": "zimbraSingleCheckPassword",
-            "summary": "Helper\u0020function\u0020to\u0020check\u0020a\u0020password\u0020strength",
-            "url": "namespaces/default.html#function_zimbraSingleCheckPassword"
-        },                {
-            "fqsen": "\\bytesToHuman\u0028\u0029",
-            "name": "bytesToHuman",
-            "summary": "Convert\u0020raw\u0020byte\u0020value\u0020to\u0020human\u0020readable",
-            "url": "namespaces/default.html#function_bytesToHuman"
         },                {
             "fqsen": "\\zimbraSingle_MetaData\u0028\u0029",
             "name": "zimbraSingle_MetaData",
@@ -40,6 +20,11 @@ Search.appendIndex(
             "name": "zimbraSingle_ClientArea",
             "summary": "Client\u0020area\u0020output\u0020logic\u0020handling.",
             "url": "namespaces/default.html#function_zimbraSingle_ClientArea"
+        },                {
+            "fqsen": "\\zimbraSingle_UsageUpdate\u0028\u0029",
+            "name": "zimbraSingle_UsageUpdate",
+            "summary": "Usage\u0020Update",
+            "url": "namespaces/default.html#function_zimbraSingle_UsageUpdate"
         },                {
             "fqsen": "\\zimbraSingle_ChangePassword\u0028\u0029",
             "name": "zimbraSingle_ChangePassword",

+ 73 - 177
Doc/namespaces/default.html

@@ -86,39 +86,11 @@
 
 <dl class="phpdocumentor-table-of-contents">
                         <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleGetAccess">zimbraSingleGetAccess()</a>
-    <span>
-                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
-</dt>
-<dd>Helper function to get the zimbra server access data from whmcs database</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields">zimbraSingleCreateCustomFields()</a>
-    <span>
-                        &nbsp;: bool    </span>
-</dt>
-<dd>Helper function creates all necessary custom fields depending on selected configuration options</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_recursiveFindAll">recursiveFindAll()</a>
     <span>
                         &nbsp;: array&lt;string|int, mixed&gt;    </span>
 </dt>
-<dd>Helper function to find values of a named key in a multidimensional array or object</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCheckPassword">zimbraSingleCheckPassword()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Helper function to check a password strength</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_bytesToHuman">bytesToHuman()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Convert raw byte value to human readable</dd>
+<dd>Helper function to find values of a named key in a multidimensional arrays or objects</dd>
 
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_MetaData">zimbraSingle_MetaData()</a>
@@ -141,6 +113,13 @@
 </dt>
 <dd>Client area output logic handling.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate">zimbraSingle_UsageUpdate()</a>
+    <span>
+                        &nbsp;: mixed    </span>
+</dt>
+<dd>Usage Update</dd>
+
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_ChangePassword">zimbraSingle_ChangePassword()</a>
     <span>
@@ -200,69 +179,6 @@
             <a href="namespaces/default.html#functions" class="headerlink"><i class="fas fa-link"></i></a>
         </h3>
                     <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleGetAccess">
-        zimbraSingleGetAccess()
-        <a href="namespaces/default.html#function_zimbraSingleGetAccess" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">37</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to get the zimbra server access data from whmcs database</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleGetAccess</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-    
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCreateCustomFields">
-        zimbraSingleCreateCustomFields()
-        <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">96</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function creates all necessary custom fields depending on selected configuration options</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCreateCustomFields</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$packageconfigoption</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$packageconfigoption</span>
-                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>{
-@type string 1 class of service
-@type string 2 comma seperated list of maildomains
-}</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_recursiveFindAll">
         recursiveFindAll()
         <a href="namespaces/default.html#function_recursiveFindAll" class="headerlink"><i class="fas fa-link"></i></a>
@@ -270,10 +186,10 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">210</span>
+    <span class="phpdocumentor-element-found-in__line">35</span>
 </aside>
 
-        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional array or object</p>
+        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional arrays or objects</p>
 
     <code class="phpdocumentor-code phpdocumentor-signature ">
     <span class="phpdocumentor-signature__visibility"></span>
@@ -306,79 +222,6 @@
     
 
     
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCheckPassword">
-        zimbraSingleCheckPassword()
-        <a href="namespaces/default.html#function_zimbraSingleCheckPassword" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">232</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to check a password strength</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCheckPassword</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$pwd</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$pwd</span>
-                : <span class="phpdocumentor-signature__argument__return-type">string</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>password to check</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_bytesToHuman">
-        bytesToHuman()
-        <a href="namespaces/default.html#function_bytesToHuman" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">261</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Convert raw byte value to human readable</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">bytesToHuman</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"><p>Helper function to convert byte in huam readable format</p>
-</section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$bytes</span>
-                : <span class="phpdocumentor-signature__argument__return-type">int</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>value in bytes</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_MetaData">
@@ -388,7 +231,7 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">278</span>
+    <span class="phpdocumentor-element-found-in__line">61</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define module related meta data.</p>
@@ -429,7 +272,7 @@ settings.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">308</span>
+    <span class="phpdocumentor-element-found-in__line">91</span>
 </aside>
 
         <p class="phpdocumentor-summary">Test connection to a Zimbra server with the given server parameters.</p>
@@ -486,7 +329,7 @@ existing server.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">362</span>
+    <span class="phpdocumentor-element-found-in__line">144</span>
 </aside>
 
         <p class="phpdocumentor-summary">Client area output logic handling.</p>
@@ -549,6 +392,59 @@ template or they will not be visible to the end user.</p>
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_UsageUpdate">
+        zimbraSingle_UsageUpdate()
+        <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate" class="headerlink"><i class="fas fa-link"></i></a>
+    </h4>
+    <aside class="phpdocumentor-element-found-in">
+    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
+    :
+    <span class="phpdocumentor-element-found-in__line">188</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Usage Update</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_UsageUpdate</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$params</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
+
+        <section class="phpdocumentor-description"><p>Important: Runs daily per server not per product
+Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestats</p>
+</section>
+
+        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
+    <dl class="phpdocumentor-argument-list">
+                    <dt class="phpdocumentor-argument-list__entry">
+                <span class="phpdocumentor-signature__argument__name">$params</span>
+                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
+                            </dt>
+            <dd class="phpdocumentor-argument-list__definition">
+                    <section class="phpdocumentor-description"><p>common module parameters</p>
+</section>
+
+            </dd>
+            </dl>
+
+    
+    <h5 class="phpdocumentor-tag-list__heading" id="tags">
+        Tags
+        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
+    </h5>
+    <dl class="phpdocumentor-tag-list">
+                                    <dt class="phpdocumentor-tag-list__entry">
+                    <span class="phpdocumentor-tag__name">see</span>
+                </dt>
+                <dd class="phpdocumentor-tag-list__definition">
+                                                                                    <span class="phpdocumentor-tag-link"><a href="https://developers.whmcs.com/provisioning-modules/usage-update/"><abbr title="https://developers.whmcs.com/provisioning-modules/usage-update/">https://developers.whmcs.com/provisioning-modules/usage-update/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ChangePassword">
@@ -558,7 +454,7 @@ template or they will not be visible to the end user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">442</span>
+    <span class="phpdocumentor-element-found-in__line">269</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -614,7 +510,7 @@ active status.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">492</span>
+    <span class="phpdocumentor-element-found-in__line">314</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -673,7 +569,7 @@ configuration, this can be any of:</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">579</span>
+    <span class="phpdocumentor-element-found-in__line">419</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -727,7 +623,7 @@ user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">623</span>
+    <span class="phpdocumentor-element-found-in__line">461</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -781,7 +677,7 @@ can be called manually by admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">666</span>
+    <span class="phpdocumentor-element-found-in__line">502</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -834,7 +730,7 @@ overdue products if enabled, or requested manually by an admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">727</span>
+    <span class="phpdocumentor-element-found-in__line">561</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -890,7 +786,7 @@ products and configurable options.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">768</span>
+    <span class="phpdocumentor-element-found-in__line">600</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>

+ 73 - 177
Doc/packages/Default.html

@@ -86,39 +86,11 @@
 
 <dl class="phpdocumentor-table-of-contents">
                         <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleGetAccess">zimbraSingleGetAccess()</a>
-    <span>
-                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
-</dt>
-<dd>Helper function to get the zimbra server access data from whmcs database</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields">zimbraSingleCreateCustomFields()</a>
-    <span>
-                        &nbsp;: bool    </span>
-</dt>
-<dd>Helper function creates all necessary custom fields depending on selected configuration options</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_recursiveFindAll">recursiveFindAll()</a>
     <span>
                         &nbsp;: array&lt;string|int, mixed&gt;    </span>
 </dt>
-<dd>Helper function to find values of a named key in a multidimensional array or object</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_zimbraSingleCheckPassword">zimbraSingleCheckPassword()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Helper function to check a password strength</dd>
-
-            <dt class="phpdocumentor-table-of-contents__entry -function -">
-    <a href="namespaces/default.html#function_bytesToHuman">bytesToHuman()</a>
-    <span>
-                        &nbsp;: string    </span>
-</dt>
-<dd>Convert raw byte value to human readable</dd>
+<dd>Helper function to find values of a named key in a multidimensional arrays or objects</dd>
 
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_MetaData">zimbraSingle_MetaData()</a>
@@ -141,6 +113,13 @@
 </dt>
 <dd>Client area output logic handling.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate">zimbraSingle_UsageUpdate()</a>
+    <span>
+                        &nbsp;: mixed    </span>
+</dt>
+<dd>Usage Update</dd>
+
             <dt class="phpdocumentor-table-of-contents__entry -function -">
     <a href="namespaces/default.html#function_zimbraSingle_ChangePassword">zimbraSingle_ChangePassword()</a>
     <span>
@@ -200,69 +179,6 @@
             <a href="packages/Default.html#functions" class="headerlink"><i class="fas fa-link"></i></a>
         </h3>
                     <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleGetAccess">
-        zimbraSingleGetAccess()
-        <a href="namespaces/default.html#function_zimbraSingleGetAccess" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">37</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to get the zimbra server access data from whmcs database</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleGetAccess</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-    
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCreateCustomFields">
-        zimbraSingleCreateCustomFields()
-        <a href="namespaces/default.html#function_zimbraSingleCreateCustomFields" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">96</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function creates all necessary custom fields depending on selected configuration options</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCreateCustomFields</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$packageconfigoption</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$packageconfigoption</span>
-                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>{
-@type string 1 class of service
-@type string 2 comma seperated list of maildomains
-}</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_recursiveFindAll">
         recursiveFindAll()
         <a href="namespaces/default.html#function_recursiveFindAll" class="headerlink"><i class="fas fa-link"></i></a>
@@ -270,10 +186,10 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">210</span>
+    <span class="phpdocumentor-element-found-in__line">35</span>
 </aside>
 
-        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional array or object</p>
+        <p class="phpdocumentor-summary">Helper function to find values of a named key in a multidimensional arrays or objects</p>
 
     <code class="phpdocumentor-code phpdocumentor-signature ">
     <span class="phpdocumentor-signature__visibility"></span>
@@ -306,79 +222,6 @@
     
 
     
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_zimbraSingleCheckPassword">
-        zimbraSingleCheckPassword()
-        <a href="namespaces/default.html#function_zimbraSingleCheckPassword" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">232</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Helper function to check a password strength</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">zimbraSingleCheckPassword</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$pwd</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"></section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$pwd</span>
-                : <span class="phpdocumentor-signature__argument__return-type">string</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>password to check</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
-</article>
-                    <article class="phpdocumentor-element -function - ">
-    <h4 class="phpdocumentor-element__name" id="function_bytesToHuman">
-        bytesToHuman()
-        <a href="namespaces/default.html#function_bytesToHuman" class="headerlink"><i class="fas fa-link"></i></a>
-    </h4>
-    <aside class="phpdocumentor-element-found-in">
-    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
-    :
-    <span class="phpdocumentor-element-found-in__line">261</span>
-</aside>
-
-        <p class="phpdocumentor-summary">Convert raw byte value to human readable</p>
-
-    <code class="phpdocumentor-code phpdocumentor-signature ">
-    <span class="phpdocumentor-signature__visibility"></span>
-                <span class="phpdocumentor-signature__name">bytesToHuman</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bytes</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
-
-        <section class="phpdocumentor-description"><p>Helper function to convert byte in huam readable format</p>
-</section>
-
-        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
-    <dl class="phpdocumentor-argument-list">
-                    <dt class="phpdocumentor-argument-list__entry">
-                <span class="phpdocumentor-signature__argument__name">$bytes</span>
-                : <span class="phpdocumentor-signature__argument__return-type">int</span>
-                            </dt>
-            <dd class="phpdocumentor-argument-list__definition">
-                    <section class="phpdocumentor-description"><p>value in bytes</p>
-</section>
-
-            </dd>
-            </dl>
-
-    
-
-    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_MetaData">
@@ -388,7 +231,7 @@
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">278</span>
+    <span class="phpdocumentor-element-found-in__line">61</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define module related meta data.</p>
@@ -429,7 +272,7 @@ settings.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">308</span>
+    <span class="phpdocumentor-element-found-in__line">91</span>
 </aside>
 
         <p class="phpdocumentor-summary">Test connection to a Zimbra server with the given server parameters.</p>
@@ -486,7 +329,7 @@ existing server.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">362</span>
+    <span class="phpdocumentor-element-found-in__line">144</span>
 </aside>
 
         <p class="phpdocumentor-summary">Client area output logic handling.</p>
@@ -549,6 +392,59 @@ template or they will not be visible to the end user.</p>
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_UsageUpdate">
+        zimbraSingle_UsageUpdate()
+        <a href="namespaces/default.html#function_zimbraSingle_UsageUpdate" class="headerlink"><i class="fas fa-link"></i></a>
+    </h4>
+    <aside class="phpdocumentor-element-found-in">
+    <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
+    :
+    <span class="phpdocumentor-element-found-in__line">188</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Usage Update</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_UsageUpdate</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$params</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
+
+        <section class="phpdocumentor-description"><p>Important: Runs daily per server not per product
+Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestats</p>
+</section>
+
+        <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
+    <dl class="phpdocumentor-argument-list">
+                    <dt class="phpdocumentor-argument-list__entry">
+                <span class="phpdocumentor-signature__argument__name">$params</span>
+                : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
+                            </dt>
+            <dd class="phpdocumentor-argument-list__definition">
+                    <section class="phpdocumentor-description"><p>common module parameters</p>
+</section>
+
+            </dd>
+            </dl>
+
+    
+    <h5 class="phpdocumentor-tag-list__heading" id="tags">
+        Tags
+        <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
+    </h5>
+    <dl class="phpdocumentor-tag-list">
+                                    <dt class="phpdocumentor-tag-list__entry">
+                    <span class="phpdocumentor-tag__name">see</span>
+                </dt>
+                <dd class="phpdocumentor-tag-list__definition">
+                                                                                    <span class="phpdocumentor-tag-link"><a href="https://developers.whmcs.com/provisioning-modules/usage-update/"><abbr title="https://developers.whmcs.com/provisioning-modules/usage-update/">https://developers.whmcs.com/provisioning-modules/usage-update/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
                     <article class="phpdocumentor-element -function - ">
     <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ChangePassword">
@@ -558,7 +454,7 @@ template or they will not be visible to the end user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">442</span>
+    <span class="phpdocumentor-element-found-in__line">269</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -614,7 +510,7 @@ active status.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">492</span>
+    <span class="phpdocumentor-element-found-in__line">314</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -673,7 +569,7 @@ configuration, this can be any of:</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">579</span>
+    <span class="phpdocumentor-element-found-in__line">419</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -727,7 +623,7 @@ user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">623</span>
+    <span class="phpdocumentor-element-found-in__line">461</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -781,7 +677,7 @@ can be called manually by admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">666</span>
+    <span class="phpdocumentor-element-found-in__line">502</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -834,7 +730,7 @@ overdue products if enabled, or requested manually by an admin user.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">727</span>
+    <span class="phpdocumentor-element-found-in__line">561</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -890,7 +786,7 @@ products and configurable options.</p>
     <aside class="phpdocumentor-element-found-in">
     <abbr class="phpdocumentor-element-found-in__file" title="zimbraSingle.php"><a href="files/zimbrasingle.html"><abbr title="zimbraSingle.php">zimbraSingle.php</abbr></a></abbr>
     :
-    <span class="phpdocumentor-element-found-in__line">768</span>
+    <span class="phpdocumentor-element-found-in__line">600</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>

+ 0 - 4
clientarea.tpl

@@ -6,10 +6,6 @@
           <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>

+ 6 - 6
zimbraAddressAvailable.php

@@ -19,12 +19,12 @@ if($pos===false) {
  * Requires this PHP api to make soap calls and parse responses
  */
 require_once(__DIR__ . '/../../../init.php');
-require_once("api/Zm/Auth.php");
-require_once("api/Zm/Account.php");
+require_once('api/Zm/Auth.php');
+require_once('api/Zm/Account.php');
 use WHMCS\Database\Capsule;
 
 $whmcs = App::self();
-$accountName = $_GET['name'] . "@" .  $_GET['domain'];
+$accountName = $_GET['name'] . '@' .  $_GET['domain'];
 $productID = $_GET['pid'];
 $accessData = array('zimbraServer' => '', 'adminUser' => '', 'adminPass' => '');
 $serverGroupIDObj = Capsule::table('tblproducts')
@@ -49,14 +49,14 @@ $adminPassDecrypt = localAPI('DecryptPassword', array('password2' => $adminPassC
 if ($adminPassDecrypt['result'] == 'success') {
 	$accessData['adminPass'] = $adminPassDecrypt['password'];
 }
-$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();
-if(is_a($login, "Exception")) {
+if(is_a($login, 'Exception')) {
 	logModuleCall(
 		'zimbrasingle',
 		__FUNCTION__,
 		$accessData,
-		"Error: cannot login to " . $accessData['zimbraServer'],
+		'Error: cannot login to ' . $accessData['zimbraServer'],
 		$login->getMessage()
 	);
 	exit();

+ 211 - 455
zimbraSingle.php

@@ -10,8 +10,8 @@
  * @license GPL
  */
 
-if (!defined("WHMCS")) {
-    die("This file cannot be accessed directly");
+if (!defined('WHMCS')) {
+    die('This file cannot be accessed directly');
 }
 use WHMCS\Database\Capsule;
 
@@ -20,211 +20,13 @@ use WHMCS\Database\Capsule;
  * This is an extend version of:
  * @see https://github.com/alloylab/zimbra-admin-api-soap-php
  */
-require_once("api/Zm/Auth.php");
-require_once("api/Zm/Account.php");
-require_once("api/Zm/Domain.php");
-require_once("api/Zm/Server.php");
+require_once('api/Zm/Auth.php');
+require_once('api/Zm/Account.php');
+require_once('api/Zm/Domain.php');
+require_once('api/Zm/Server.php');
 
 /**
- * Helper function to get the zimbra server access data from whmcs database
- * 
- * @return array $accessData {
- *      @type string 'zimbraServer' zimbra server IP address
- *      @type string 'adminUser' zimbra admin username
- *      @type string 'password' zimbra admin password
- * } or false in case of error
- */
-function zimbraSingleGetAccess()
-{
-    $accessData = array('zimbraServer' => '', 'adminUser' => '', 'adminPass' => '');
-    $whmcs = App::self();
-    $serverGroupID = $whmcs->get_req_var('servergroup');
-    $action = $whmcs->get_req_var('action');
-    if(($action == 'module-settings') || ($action == 'ConfigOptions') || ($action == 'save')) {
-        $productID = $whmcs->get_req_var('id');
-        $serverGroupIDObj = Capsule::table('tblproducts')
-            ->select('servergroup')
-            ->where('id', '=', $productID)
-            ->get();
-        $serverGroupID = $serverGroupIDObj[0]->servergroup;
-        $serverIDObj = Capsule::table('tblservergroupsrel')
-            ->select('serverid')
-            ->where('groupid', '=', $serverGroupID)
-            ->get();
-        $serverID = $serverIDObj[0]->serverid;
-    } else {
-        $id = $whmcs->get_req_var('id');
-        $serverIDObj = Capsule::table('tblhosting')
-            ->select('server')
-            ->where('id', '=', $id)
-            ->get();
-            $serverID = $serverIDObj[0]->server;
-    }
-    $server = Capsule::table('tblservers')
-        ->select('ipaddress', 'username', 'password')
-        ->where('id', '=', $serverID)
-        ->where('active', '=', 1)
-        ->get();
-    $accessData['zimbraServer'] = $server[0]->ipaddress;
-    $accessData['adminUser'] = $server[0]->username;
-    $adminPassCrypt = $server[0]->password;
-    $adminPassDecrypt = localAPI('DecryptPassword', array('password2' => $adminPassCrypt));
-    if ($adminPassDecrypt['result'] == 'success') {
-        $accessData['adminPass'] = $adminPassDecrypt['password'];
-    } else {
-        logModuleCall(
-            'zimbrasingle',
-            __FUNCTION__,
-            $adminPassCrypt,
-            "Error: cloud not decrypt admin password" ,
-            $adminPassDecrypt
-        );
-        return false;
-    }
-    return $accessData;
-}
-
-/**
- * Helper function creates all necessary custom fields depending on selected configuration options
- * 
- * @param array $packageconfigoption {
- *      @type string 1 class of service
- *      @type string 2 comma seperated list of maildomains
- * }
- * @return bool true in case of success or false on any error
- */
-function zimbraSingleCreateCustomFields($packageconfigoption)
-{
-    $whmcs = App::self();
-    $productID = $whmcs->get_req_var('id');
-    try {
-        $customFieldIDsObj = Capsule::table('tblcustomfields')
-            ->where('relid', '=', $productID)
-            ->select('id')
-            ->get();
-        $customFieldIDs = recursiveFindAll((array)$customFieldIDsObj, 'id');
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[0] ? $customFieldIDs[0] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'givenname | Vorname',
-                'fieldtype' => 'text',
-                'required' => 'on',
-                'showorder' => 'on',
-                'sortorder' => '0'
-            )
-        );
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[1] ? $customFieldIDs[1] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'sn | Nachname',
-                'fieldtype' => 'text',
-                'required' => 'on',
-                'showorder' => 'on',
-                'sortorder' => '1'
-            )
-        );
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[2] ? $customFieldIDs[2] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'username | E-Mail Name',
-                'fieldtype' => 'text',
-                'required' => 'on',
-                'showorder' => 'on',
-                'sortorder' => '2'
-            )
-        );
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[3] ? $customFieldIDs[3] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'maildomain | Mail Domaine',
-                'fieldtype' => 'dropdown',
-                'fieldoptions' => implode(',', $packageconfigoption[2]),
-                'required' => 'on',
-                'showorder' => 'on',
-                'sortorder' => '3'
-            )
-        );
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[4] ? $customFieldIDs[4] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'password | Password',
-                'fieldtype' => 'password',
-                'required' => 'on',
-                'showorder' => 'on',
-                'sortorder' => '4'
-            )
-        );
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[5] ? $customFieldIDs[5] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'pwrepeat | Password wiederholen',
-                'fieldtype' => 'password',
-                'required' => 'on',
-                'showorder' => 'on',
-                'sortorder' => '5'
-            )
-        );
-        Capsule::table('tblcustomfields')
-        ->updateOrInsert(
-            array(
-                'id' => $customFieldIDs[6] ? $customFieldIDs[6] : '',
-            ),
-            array(
-                'type' => 'product',
-                'relid' => $productID,
-                'fieldname' => 'cos | Class of Service',
-                'fieldtype' => 'dropdown',
-                'fieldoptions' => $packageconfigoption[1],
-                'adminonly' => 'on',
-                'required' => 'on',
-                'sortorder' => '6'
-            )
-        );
-        return true;
-    } catch (\Exception $e) {
-        logModuleCall(
-            'zimbrasingle',
-            __FUNCTION__,
-            $params,
-            "Error: could not create custom fields",
-            $e->getMessage()
-        );
-        return false;
-    }
-}
-
-/**
- * Helper function to find values of a named key in a multidimensional arrays
+ * Helper function to find values of a named key in a multidimensional arrays or objects
  * 
  * @param array $haystack mixed data
  * @param string $needle key to search for values
@@ -233,7 +35,7 @@ function zimbraSingleCreateCustomFields($packageconfigoption)
 function recursiveFindAll($haystack, $needle)
 {
     $values = array();
-    $iterator  = new RecursiveArrayIterator($haystack);
+    $iterator  = new RecursiveArrayIterator((array)$haystack);
     $recursive = new RecursiveIteratorIterator(
         $iterator,
         RecursiveIteratorIterator::SELF_FIRST
@@ -246,48 +48,6 @@ function recursiveFindAll($haystack, $needle)
     return $values;
 }
 
-/**
- * Helper function to check a password strength
- * 
- * @param string $pwd password to check
- * @return string $message what is missing in the password (empty if it is okay)
- */
-function zimbraSingleCheckPassword($pwd)
-{
-    $message = '';
-    if (strlen($pwd) < 8) {
-        $message .= "Das das Passwort ist zu kurz. Es werden mind. 8 Zeichen benötigt" . PHP_EOL;
-    }
-    if (!preg_match("#[0-9]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens eine Zahl enthalten" . PHP_EOL;
-    }
-    if (!preg_match("#[A-Z]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens einen Grossbuchstaben (A-Z) enthalten" . PHP_EOL;
-    }
-    if (!preg_match("#[a-z]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens einen Kleinbuchstaben (a-z) enthalten" . PHP_EOL;
-    }
-    if (!preg_match("#[^\w]+#", $pwd)) {
-        $message .= "Das Passwort muss mindestens ein Sonderzeichen (.,-:=) enthalten" . PHP_EOL;
-    }
-    return $message;
-}
-
-/**
- * Convert raw byte value to human readable
- * 
- * Helper function to convert byte in huam readable format
- * 
- * @param int $bytes value in bytes
- * @return string value rounded and in human readable units
- */
-function bytesToHuman($bytes)
-{
-    $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
-    for ($i = 0; $bytes > 1024; $i++) $bytes /= 1024;
-    return round($bytes, 2) . ' ' . $units[$i];
-}
-
 /**
  * Define module related meta data.
  *
@@ -330,26 +90,25 @@ function zimbraSingle_MetaData()
  */
 function zimbraSingle_TestConnection($params)
 {
-    $auth = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
+    $auth = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $auth->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Connection test to " . $params['serverip'] . " failed: Cannot login",
+            'Connection failed, cannot login to ' . $params['serverip'],
             $login->getMessage()
         );
         return array(
             'success' => false,
-            'error' => "Connection test to " . $params['serverip'] . " failed, the error was: " . $login->getMessage(),
-        );
-    } else {
-        return array(
-            'success' => true,
-            'error' => '',
+            'error' => 'Connection failed, cannot login to ' . $params['serverip'],
         );
     }
+    return array(
+        'success' => true,
+        'error' => '',
+    );
 }
 
 /**
@@ -384,61 +143,32 @@ function zimbraSingle_TestConnection($params)
  */
 function zimbraSingle_ClientArea($params)
 {
-    $accessData = zimbraSingleGetAccess();
     $clientInfo = array();
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            'Error: cannot login to ' . $accessData['zimbraServer'],
+            $login->getMessage()
         );
         return false;
     }
     $apiAccountManager = new Zm_Account($api);
-    $quota = $apiAccountManager->getQuota($accountName);
-    if(is_a($quota, "Exception")) {
+    $accountInfo = $apiAccountManager->getAccountInfo($params['username']);
+    if(is_a($accountInfo, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error : could not find $accountName",
-            $quota
+            'Error: could not gather informations for ' . $params['username'],
+            $accountInfo->getMessage()
         );
         return false;
     }
-    $response = $apiAccountManager->getMailbox($accountName);
-    if(is_a($response, "Exception")) {
-        logModuleCall(
-            'zimbrasingle',
-            __FUNCTION__,
-            $params,
-            "Error: could not fetch mailbox info for $accountName",
-            $response
-        );
-        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($accountName);
-    if(is_a($response, "Exception")) {
-        logModuleCall(
-            'zimbrasingle',
-            __FUNCTION__,
-            $params,
-            "Error: could not gather informations for  $accountName",
-            $response
-        );
-        return false;
-    }
-    $webmailUrl = recursiveFindAll( $response, 'PUBLICMAILURL');
+    $webmailUrl = recursiveFindAll($accountInfo, 'PUBLICMAILURL');
     $clientInfo['webmailurl'] = $webmailUrl[0]['DATA'];
     return array(
         'templatefile' => 'clientarea',
@@ -446,15 +176,24 @@ function zimbraSingle_ClientArea($params)
     );
 }
 
+/**
+ * Usage Update
+ * 
+ * Important: Runs daily per server not per product
+ * Run Manually: /admin/reports.php?report=disk_usage_summary&action=updatestats
+ * @param array $params common module parameters
+ * 
+ * @see https://developers.whmcs.com/provisioning-modules/usage-update/
+ */
 function zimbraSingle_UsageUpdate($params) {
-    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $params['serverip'],
+            'Error: cannot login to ' . $params['serverip'],
             $login->getMessage()
         );
         return false;
@@ -467,37 +206,47 @@ function zimbraSingle_UsageUpdate($params) {
         ->get();
     foreach((array)$productsObj as $productObj) {
         $product = get_object_vars($productObj[0]);
-        $quota = $apiAccountManager->getQuota($product['username']);
-        if(is_a($quota, "Exception")) {
+        $accountQuota = $apiAccountManager->getQuota($product['username']);
+        if(is_a($accountQuota, 'Exception')) {
             logModuleCall(
                 'zimbrasingle',
                 __FUNCTION__,
-                $product,
-                "Error : could not find " . $product['username'],
-                $quota->getMessage()
+                $params,
+                'Error : could not find quota for ' . $product['username'],
+                $accountQuota->getMessage()
             );
         }
-        $response = $apiAccountManager->getMailbox($product['username']);
-        if(is_a($response, "Exception")) {
+        $mboxObj = $apiAccountManager->getMailbox($product['username']);
+        if(is_a($mboxObj, 'Exception')) {
             logModuleCall(
                 'zimbrasingle',
                 __FUNCTION__,
                 $params,
-                "Error: could not fetch mailbox info for " . $product['username'],
-                $response->getMessage()
+                'Error: could not fetch mailbox info for ' . $product['username'],
+                $mboxObj->getMessage()
             );
         }
-        $mbox = get_object_vars($response);
-        $mboxSize = $mbox['S'];
-        Capsule::table('tblhosting')
-            ->where('id', '=', $product['id'])
-            ->update(
-                array(
-                    'diskusage' => round($mboxSize / 1048576,2),
-                    'disklimit' => round($quota / 1048576,2),
-                    'lastupdate' => Capsule::raw('now()')
-                )
+        $mboxVars = get_object_vars($mboxObj);
+        $mboxSize = $mboxVars['S'];
+        try {
+            Capsule::table('tblhosting')
+                ->where('id', '=', $product['id'])
+                ->update(
+                    array(
+                        'diskusage' => round($mboxSize / 1048576,2),
+                        'disklimit' => round($accountQuota / 1048576,2),
+                        'lastupdate' => Capsule::raw('now()')
+                    )
+                );
+        } catch (\Exception $e) {
+            logModuleCall(
+                'zimbrasingle',
+                __FUNCTION__,
+                $params,
+                'Error: could update usage information for ' . $product['username'],
+                $e->getMessage()
             );
+        }
     }
 }
 
@@ -515,36 +264,31 @@ function zimbraSingle_UsageUpdate($params) {
  *
  * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  *
- * @return string "success" or an error message
+ * @return string 'success' or an error message
  */
 function zimbraSingle_ChangePassword($params)
 {
-    $accessData = zimbraSingleGetAccess();
-    if ($checkPW = zimbraSingleCheckPassword($params['password'])) {
-        return $checkPW;
-    }
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            'Error: cannot login to ' . $params['serverip'],
+            $login->getMessage()
         );
         return false;
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->setAccountPassword($accountName, $params['password']);
-    if(is_a($response, "Exception")) {
+    $response = $apiAccountManager->setAccountPassword($params['username'], $params['password']);
+    if(is_a($response, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: password for $accountName could not be set",
-            $response
+            'Error: password could not be set for ' . $params['username'],
+            $response->getMessage()
         );
         return false;
     }
@@ -565,78 +309,96 @@ function zimbraSingle_ChangePassword($params)
  *
  * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  *
- * @return string "success" or an error message
+ * @return string 'success' or an error message
  */
 function zimbraSingle_CreateAccount($params)
 {
-    $accessData = zimbraSingleGetAccess();
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
-            $accessData,
-            "Error: cannot login to " . $accessData['zimbraServer'],
+            $params,
+            'Error: cannot login to ' . $params['serverip'],
             $login->getMessage()
         );
-        return "Error: cannot login to " . $accessData['zimbraServer'];
+        return $login->getMessage();
     }
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
+    $params['username'] = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
     $apiAccountManager = new Zm_Account($api);
-    $accountExists = $apiAccountManager->accountExists($accountName);
-    if(is_a($accountExists, "Exception")) {
+    $accountExists = $apiAccountManager->accountExists($params['username']);
+    if(is_a($accountExists, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
-            $accessData,
-            "Error: could not verify $accountName",
-            $accountExists
+            $params,
+            'Error: could not verify ' . $params['username'],
+            $accountExists->getMessage()
         );
-        return "Error: could not verify $accountName";
+        return 'Error: could not verify '. $params['username'];
     }
     if($accountExists === true) {
-        return "Error: account $accountName already exists";
+        return 'Error: account already exists ' . $params['username'];
     }
     $attrs = array();
-    $attrs["gn"] = $params['customfields']["givenname"];
-    $attrs["sn"] = $params['customfields']["sn"];
-    $attrs["displayName"] = $attrs["gn"] . " " . $attrs["sn"];
+    $attrs['gn'] = $params['customfields']['givenname'];
+    $attrs['sn'] = $params['customfields']['sn'];
+    $attrs['displayName'] = $attrs['gn'] . ' ' . $attrs['sn'];
     $passDecrypt = localAPI('DecryptPassword', array('password2' => $params['customfields']['password']));
     if ($passDecrypt['result'] == 'success') {
-        $params['customfields']['password'] = $passDecrypt['password'];
+        $params['password'] = $passDecrypt['password'];
     } else {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
-            $params['customfields']['password'],
-            "Error: could not decrypt password",
-            $passDecrypt
+            $params,
+            'Error: could not decrypt password',
+            $passDecrypt['message']
             );
-            return "Error: could not decrypt password";
+            return 'Error: could not decrypt password';
     }
     $cosID = $apiAccountManager->getCosId($params['configoption1']);
-    if(is_a($cosID, "Exception")) {
+    if(is_a($cosID, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
-            $params['configoption1'],
-            "Error: serviceclass not available",
-            $cosID
+            $params,
+            'Error: could not find serviceclass ' . $params['configoption1'],
+            $cosID->getMessage()
         );
-        return "Error: serviceclass not available";
+        return 'Error: could not find serviceclass ' . $params['configoption1'];
     }
     $attrs['zimbraCOSId'] = $cosID;
-    $id = $apiAccountManager->createAccount($accountName, $params['customfields']['password'], $attrs);
-    if(is_a($id, "Exception")) {
+    $zimbraID = $apiAccountManager->createAccount($params['username'], $params['password'], $attrs);
+    if(is_a($zimbraID, 'Exception')) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            'Error: could not create account ' . $params['username'],
+            $zimbraID->getMessage()
+        );
+        return 'Error: could not create account ' . $params['username'];
+    }
+    try {
+        Capsule::table('tblhosting')
+            ->where('id', '=', $params['serviceid'])
+            ->update(
+                array(
+                    'username' => $params['username'],
+                    'password' => $params['customfields']['password'],
+                )
+            );
+    } catch (\Exception $e) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName not created",
-            $id
+            'Error: could save username & password in database',
+            $e->getMessage()
         );
-        return "Error: account $accountName not created";
+        return 'Error: could save username & password in database';
     }
     return 'success';
 }
@@ -652,33 +414,31 @@ function zimbraSingle_CreateAccount($params)
  *
  * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  *
- * @return string "success" or an error message
+ * @return string 'success' or an error message
  */
 function zimbraSingle_SuspendAccount($params)
 {
-    $accessData = zimbraSingleGetAccess();
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            'Error: cannot login to ' . $params['serverip'],
+            $login->getMessage()
         );
         return $login->getMessage();
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->setAccountStatus($accountName, "locked");
-    if(is_a($response, "Exception")) {
+    $response = $apiAccountManager->setAccountStatus($params['username'], 'locked');
+    if(is_a($response, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName could not locked",
-            $response
+            'Error: could not lock account ' . $params['username'],
+            $response->getMessage()
         );
         return false;
     }
@@ -696,35 +456,33 @@ function zimbraSingle_SuspendAccount($params)
  *
  * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  *
- * @return string "success" or an error message
+ * @return string 'success' or an error message
  */
 function zimbraSingle_UnsuspendAccount($params)
 {
-    $accessData = zimbraSingleGetAccess();
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            'Error: cannot login to ' . $params['serverip'],
+            $login->getMessage()
         );
         return $login->getMessage();
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->setAccountStatus($accountName, "active");
-    if(is_a($response, "Exception")) {
+    $response = $apiAccountManager->setAccountStatus($params['username'], 'active');
+    if(is_a($response, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName could not unlocked",
-            $response
+            'Error: could not unlock account ' . $params['username'],
+            $response->getMessage()
             );
-        return "Error: account $accountName could not unlocked";
+        return 'Error: could not unlock account ' . $params['username'];
     }
     return 'success';
 }
@@ -739,49 +497,47 @@ function zimbraSingle_UnsuspendAccount($params)
  *
  * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  *
- * @return string "success" or an error message
+ * @return string 'success' or an error message
  */
 function zimbraSingle_TerminateAccount($params)
 {
-    $accessData = zimbraSingleGetAccess();
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            'Error: cannot login to ' . $params['serverip'],
+            $login->getMessage()
         );
         return $login->getMessage();
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->getAccountStatus($accountName);
-    if(is_a($response, "Exception")) {
+    $accountStatus = $apiAccountManager->getAccountStatus($params['username']);
+    if(is_a($accountStatus, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName could not verified",
-            $response
+            'Error: could not verify account '. $params['username'],
+            $accountStatus->getMessage()
         );
-        return "Error : account $accountName could not verified";
+        return 'Error : account ' . $params['username'] . ' Name could not verified';
     }
-    if ($response != 'locked') {
-        return "Account $accountName active, suspend account first!";
+    if ($accountStatus != 'locked') {
+        return 'Account '. $params['username'] . ' is active, suspend account first!';
     }
-    $response = $apiAccountManager->deleteAccount($accountName);
-    if(is_a($response, "Exception")) {
+    $response = $apiAccountManager->deleteAccount($params['username']);
+    if(is_a($response, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: account $accountName could not removed",
-            $response
+            'Error: could not remove account '. $params['username'],
+            $response->getMessage()
         );
-        return "Error: account $accountName could not removed";
+        return 'Error: could not remove account '. $params['username'];
     }
     return 'success';
 }
@@ -800,35 +556,33 @@ function zimbraSingle_TerminateAccount($params)
  *
  * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
  *
- * @return string "success" or an error message
+ * @return string 'success' or an error message
  */
 function zimbraSingle_ChangePackage($params)
 {
-    $accessData = zimbraSingleGetAccess();
-    $accountName = $params['customfields']['username'] . '@' . $params['customfields']['maildomain'];
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
+    $api = new Zm_Auth($params['serverip'], $params['serverusername'], $params['serverpassword'], 'admin');
     $login = $api->login();
-    if(is_a($login, "Exception")) {
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            'Error: cannot login to ' . $params['serverip'],
+            $login->getMessage()
         );
         return $login->getMessage();
     }
     $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->setAccountCos($accountName, $params['configoption1']);
-    if(is_a($response, "Exception")) {
+    $response = $apiAccountManager->setAccountCos($params['username'], $params['configoption1']);
+    if(is_a($response, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: class of service for $accountName could not be set",
-            $response
+            'Error: could not set class of service for '. $params['username'],
+            $response->getMessage()
         );
-        return "Error: class of service for $accountName could not be set";
+        return 'Error: could not set class of service for '. $params['username'];
     }
     return 'success';
 }
@@ -845,63 +599,65 @@ function zimbraSingle_ChangePackage($params)
  */
 function zimbraSingle_ConfigOptions($params)
 {
-    if(isset($_POST['packageconfigoption'])) {
-        if(zimbraSingleCreateCustomFields($_POST['packageconfigoption']) == false) {
-            return false;
-        };
-    }
-    $accessData = zimbraSingleGetAccess();
-    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], "admin");
-    $login = $api->login();
-    if(is_a($login, "Exception")) {
+    $whmcs = App::self();
+    $serverGroupID = $whmcs->get_req_var('servergroup');
+    $serverIDObj = Capsule::table('tblservergroupsrel')
+        ->select('serverid')
+        ->where('groupid', '=', $serverGroupID)
+        ->get();
+    $serverIDArray = recursiveFindAll($serverIDObj,'serverid');
+    $server = Capsule::table('tblservers')
+        ->select('ipaddress', 'username', 'password')
+        ->where('id', $serverIDArray)
+        ->where('active', '=', 1)
+        ->get();
+    $accessData['zimbraServer'] = $server[0]->ipaddress;
+    $accessData['adminUser'] = $server[0]->username;
+    $adminPassCrypt = $server[0]->password;
+    $adminPassDecrypt = localAPI('DecryptPassword', array('password2' => $adminPassCrypt));
+    if ($adminPassDecrypt['result'] == 'success') {
+        $accessData['adminPass'] = $adminPassDecrypt['password'];
+    } else {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
-            $params,
-            "Error: cannot login to " . $accessData['zimbraServer'],
-            $login
+            $adminPassCrypt,
+            'Error: cloud not decrypt admin password' ,
+            $adminPassDecrypt['message']
         );
         return false;
     }
-    $apiAccountManager = new Zm_Account($api);
-    $response = $apiAccountManager->getAllCos();
-    if(is_a($response, "Exception")) {
+    $api = new Zm_Auth($accessData['zimbraServer'], $accessData['adminUser'], $accessData['adminPass'], 'admin');
+    $login = $api->login();
+    if(is_a($login, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: could not fetch classes of service",
-            $response
+            'Error: cannot login to ' . $accessData['zimbraServer'],
+            $login->getMessage()
         );
         return false;
     }
-    $cosNames = recursiveFindAll($response, 'NAME');
-    $configOptions = array();
-    $configOptions['cos'] = array(
-        "FriendlyName" => "Class of Service",
-        "Type" => "dropdown",
-        "Options" => implode(',', $cosNames),
-        "Description" => "Select COS",
-    );
-    $apiDomainManager = new Zm_Domain($api);
-    $response = $apiDomainManager->getAllDomains();
-    if(is_a($response, "Exception")) {
+    $apiAccountManager = new Zm_Account($api);
+    $cosIDs = $apiAccountManager->getAllCos();
+    if(is_a($cosIDs, 'Exception')) {
         logModuleCall(
             'zimbrasingle',
             __FUNCTION__,
             $params,
-            "Error: could fetch available maildomains",
-            $response
+            'Error: could not fetch classes of service',
+            $cosIDs->getMessage()
         );
         return false;
     }
-    $domainNames = recursiveFindAll($response, 'NAME');
-    $configOptions['maildomains'] = array(
-        "FriendlyName" => "Mail Domain",
-        "Type" => "dropdown",
-        "Multiple" => true,
-        "Options" => implode(',', $domainNames),
-        "Description" => "Info: Available Maildomains",
+    $cosNames = recursiveFindAll($cosIDs, 'NAME');
+    $configOptions = array();
+    $configOptions['cos'] = array(
+        'FriendlyName' => 'Class of Service',
+        'Type' => 'dropdown',
+        'Options' => implode(',', $cosNames),
+        'Description' => 'Select COS',
     );
     return $configOptions;
 }