Quellcode durchsuchen

Merge branch 'singelsignon' of andre/whmcsZimbraSingle into master

andre vor 4 Jahren
Ursprung
Commit
10250ec307
9 geänderte Dateien mit 367 neuen und 46 gelöschten Zeilen
  1. 67 7
      Doc/files/zimbrasingle.html
  2. 67 7
      Doc/index.html
  3. 5 0
      Doc/js/searchIndex.js
  4. 67 7
      Doc/namespaces/default.html
  5. 67 7
      Doc/packages/Default.html
  6. 0 1
      api/Zm/Auth.php
  7. 8 1
      clientarea.tpl
  8. BIN
      logo.png
  9. 86 16
      zimbraSingle.php

+ 67 - 7
Doc/files/zimbrasingle.html

@@ -177,6 +177,13 @@
 </dt>
 <dd>Define Zimbra product configuration options.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn">zimbraSingle_ServiceSingleSignOn()</a>
+    <span>
+                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
+</dt>
+<dd>Perform single sign-on for a given instance of a product/service.</dd>
+
     </dl>
 
 
@@ -501,7 +508,7 @@ Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestat
     <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">299</span>
+    <span class="phpdocumentor-element-found-in__line">301</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -557,7 +564,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">347</span>
+    <span class="phpdocumentor-element-found-in__line">349</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -616,7 +623,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">451</span>
+    <span class="phpdocumentor-element-found-in__line">453</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -670,7 +677,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">492</span>
+    <span class="phpdocumentor-element-found-in__line">494</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -724,7 +731,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">532</span>
+    <span class="phpdocumentor-element-found-in__line">534</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -777,7 +784,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">590</span>
+    <span class="phpdocumentor-element-found-in__line">592</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -833,7 +840,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">656</span>
+    <span class="phpdocumentor-element-found-in__line">658</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>
@@ -875,6 +882,59 @@ Calls a function to create all necessary customfields for the order form using t
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ServiceSingleSignOn">
+        zimbraSingle_ServiceSingleSignOn()
+        <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn" 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">735</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Perform single sign-on for a given instance of a product/service.</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_ServiceSingleSignOn</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">array&lt;string|int, mixed&gt;</span></code>
+
+        <section class="phpdocumentor-description"><p>Called when single sign-on is requested for an instance of a product/service.</p>
+<p>When successful, returns an URL to which the user should be redirected.</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/module-parameters/"><abbr title="https://developers.whmcs.com/provisioning-modules/module-parameters/">https://developers.whmcs.com/provisioning-modules/module-parameters/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
             </section>
 

+ 67 - 7
Doc/index.html

@@ -173,6 +173,13 @@
 </dt>
 <dd>Define Zimbra product configuration options.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn">zimbraSingle_ServiceSingleSignOn()</a>
+    <span>
+                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
+</dt>
+<dd>Perform single sign-on for a given instance of a product/service.</dd>
+
     </dl>
 
     
@@ -496,7 +503,7 @@ Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestat
     <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">299</span>
+    <span class="phpdocumentor-element-found-in__line">301</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -552,7 +559,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">347</span>
+    <span class="phpdocumentor-element-found-in__line">349</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -611,7 +618,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">451</span>
+    <span class="phpdocumentor-element-found-in__line">453</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -665,7 +672,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">492</span>
+    <span class="phpdocumentor-element-found-in__line">494</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -719,7 +726,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">532</span>
+    <span class="phpdocumentor-element-found-in__line">534</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -772,7 +779,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">590</span>
+    <span class="phpdocumentor-element-found-in__line">592</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -828,7 +835,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">656</span>
+    <span class="phpdocumentor-element-found-in__line">658</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>
@@ -870,6 +877,59 @@ Calls a function to create all necessary customfields for the order form using t
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ServiceSingleSignOn">
+        zimbraSingle_ServiceSingleSignOn()
+        <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn" 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">735</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Perform single sign-on for a given instance of a product/service.</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_ServiceSingleSignOn</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">array&lt;string|int, mixed&gt;</span></code>
+
+        <section class="phpdocumentor-description"><p>Called when single sign-on is requested for an instance of a product/service.</p>
+<p>When successful, returns an URL to which the user should be redirected.</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/module-parameters/"><abbr title="https://developers.whmcs.com/provisioning-modules/module-parameters/">https://developers.whmcs.com/provisioning-modules/module-parameters/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
             </section>
 

+ 5 - 0
Doc/js/searchIndex.js

@@ -65,6 +65,11 @@ Search.appendIndex(
             "name": "zimbraSingle_ConfigOptions",
             "summary": "Define\u0020Zimbra\u0020product\u0020configuration\u0020options.",
             "url": "namespaces/default.html#function_zimbraSingle_ConfigOptions"
+        },                {
+            "fqsen": "\\zimbraSingle_ServiceSingleSignOn\u0028\u0029",
+            "name": "zimbraSingle_ServiceSingleSignOn",
+            "summary": "Perform\u0020single\u0020sign\u002Don\u0020for\u0020a\u0020given\u0020instance\u0020of\u0020a\u0020product\/service.",
+            "url": "namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn"
         },                {
             "fqsen": "\\",
             "name": "\\",

+ 67 - 7
Doc/namespaces/default.html

@@ -176,6 +176,13 @@
 </dt>
 <dd>Define Zimbra product configuration options.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn">zimbraSingle_ServiceSingleSignOn()</a>
+    <span>
+                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
+</dt>
+<dd>Perform single sign-on for a given instance of a product/service.</dd>
+
     </dl>
 
         
@@ -499,7 +506,7 @@ Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestat
     <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">299</span>
+    <span class="phpdocumentor-element-found-in__line">301</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -555,7 +562,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">347</span>
+    <span class="phpdocumentor-element-found-in__line">349</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -614,7 +621,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">451</span>
+    <span class="phpdocumentor-element-found-in__line">453</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -668,7 +675,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">492</span>
+    <span class="phpdocumentor-element-found-in__line">494</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -722,7 +729,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">532</span>
+    <span class="phpdocumentor-element-found-in__line">534</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -775,7 +782,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">590</span>
+    <span class="phpdocumentor-element-found-in__line">592</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -831,7 +838,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">656</span>
+    <span class="phpdocumentor-element-found-in__line">658</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>
@@ -873,6 +880,59 @@ Calls a function to create all necessary customfields for the order form using t
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ServiceSingleSignOn">
+        zimbraSingle_ServiceSingleSignOn()
+        <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn" 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">735</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Perform single sign-on for a given instance of a product/service.</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_ServiceSingleSignOn</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">array&lt;string|int, mixed&gt;</span></code>
+
+        <section class="phpdocumentor-description"><p>Called when single sign-on is requested for an instance of a product/service.</p>
+<p>When successful, returns an URL to which the user should be redirected.</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/module-parameters/"><abbr title="https://developers.whmcs.com/provisioning-modules/module-parameters/">https://developers.whmcs.com/provisioning-modules/module-parameters/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
             </section>
 

+ 67 - 7
Doc/packages/Default.html

@@ -176,6 +176,13 @@
 </dt>
 <dd>Define Zimbra product configuration options.</dd>
 
+            <dt class="phpdocumentor-table-of-contents__entry -function -">
+    <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn">zimbraSingle_ServiceSingleSignOn()</a>
+    <span>
+                        &nbsp;: array&lt;string|int, mixed&gt;    </span>
+</dt>
+<dd>Perform single sign-on for a given instance of a product/service.</dd>
+
     </dl>
 
         
@@ -499,7 +506,7 @@ Run Manually: /admin/reports.php?report=disk_usage_summary&amp;action=updatestat
     <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">299</span>
+    <span class="phpdocumentor-element-found-in__line">301</span>
 </aside>
 
         <p class="phpdocumentor-summary">Change the password for a Zimbra account.</p>
@@ -555,7 +562,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">347</span>
+    <span class="phpdocumentor-element-found-in__line">349</span>
 </aside>
 
         <p class="phpdocumentor-summary">Provision a new instance of a Zimbra account.</p>
@@ -614,7 +621,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">451</span>
+    <span class="phpdocumentor-element-found-in__line">453</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status locked.</p>
@@ -668,7 +675,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">492</span>
+    <span class="phpdocumentor-element-found-in__line">494</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a Zimbra account to status active.</p>
@@ -722,7 +729,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">532</span>
+    <span class="phpdocumentor-element-found-in__line">534</span>
 </aside>
 
         <p class="phpdocumentor-summary">Removes a Zimbra account.</p>
@@ -775,7 +782,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">590</span>
+    <span class="phpdocumentor-element-found-in__line">592</span>
 </aside>
 
         <p class="phpdocumentor-summary">Set a new class of service for a Zimbra account.</p>
@@ -831,7 +838,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">656</span>
+    <span class="phpdocumentor-element-found-in__line">658</span>
 </aside>
 
         <p class="phpdocumentor-summary">Define Zimbra product configuration options.</p>
@@ -873,6 +880,59 @@ Calls a function to create all necessary customfields for the order form using t
                         </dl>
 
     
+</article>
+                    <article class="phpdocumentor-element -function - ">
+    <h4 class="phpdocumentor-element__name" id="function_zimbraSingle_ServiceSingleSignOn">
+        zimbraSingle_ServiceSingleSignOn()
+        <a href="namespaces/default.html#function_zimbraSingle_ServiceSingleSignOn" 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">735</span>
+</aside>
+
+        <p class="phpdocumentor-summary">Perform single sign-on for a given instance of a product/service.</p>
+
+    <code class="phpdocumentor-code phpdocumentor-signature ">
+    <span class="phpdocumentor-signature__visibility"></span>
+                <span class="phpdocumentor-signature__name">zimbraSingle_ServiceSingleSignOn</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">array&lt;string|int, mixed&gt;</span></code>
+
+        <section class="phpdocumentor-description"><p>Called when single sign-on is requested for an instance of a product/service.</p>
+<p>When successful, returns an URL to which the user should be redirected.</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/module-parameters/"><abbr title="https://developers.whmcs.com/provisioning-modules/module-parameters/">https://developers.whmcs.com/provisioning-modules/module-parameters/</abbr></a></span>
+                                        
+                                                 <section class="phpdocumentor-description"></section>
+
+                                    </dd>
+                        </dl>
+
+    
 </article>
             </section>
 

+ 0 - 1
api/Zm/Auth.php

@@ -276,7 +276,6 @@ class Zm_Auth
 				}
 			}
 		}
-
 		return $result;
 	}
 }

+ 8 - 1
clientarea.tpl

@@ -6,7 +6,14 @@
           <td align='left'>Webmail</td>
           <td align="left"><a href="{$webmailurl}" target="_blank">{$webmailurl}</a></td>
         </tr>
+        <tr>
+          <td colspan=2>
+              <a href="/whmcs/clientarea.php?action=productdetails&id={$serviceid}&dosinglesignon=1" class="btn btn-primary" target=_blank color="white">
+                <i class="fas fa-sign-in fa-fw"></i> Login to Zimbra
+              </a>
+          </td>
+        </tr>
       </table>
     </td>
   </tr>
-</table>
+</table>

BIN
logo.png


+ 86 - 16
zimbraSingle.php

@@ -194,7 +194,7 @@ function zimbraSingle_ClientArea($params) {
             __FUNCTION__,
             $params,
             'Error: could not gather informations for ' . $params['username'],
-            $accountInfo->getMessage()
+            $accountInfo
         );
         return false;
     }
@@ -243,9 +243,9 @@ function zimbraSingle_UsageUpdate($params) {
                 __FUNCTION__,
                 $params,
                 'Error : could not find quota for ' . $product['username'],
-                $accountQuota->getMessage()
+                $accountQuota
             );
-            break;
+            continue;
         }
         $mboxObj = $apiAccountManager->getMailbox($product['username']);
         if(is_a($mboxObj, 'Exception')) {
@@ -254,9 +254,9 @@ function zimbraSingle_UsageUpdate($params) {
                 __FUNCTION__,
                 $params,
                 'Error: could not fetch mailbox info for ' . $product['username'],
-                $mboxObj->getMessage()
+                $mboxObj
             );
-            break;
+            continue;
         }
         $mboxVars = get_object_vars($mboxObj);
         $mboxSize = $mboxVars['S'];
@@ -323,7 +323,7 @@ function zimbraSingle_ChangePassword($params) {
             __FUNCTION__,
             $params,
             'Error: password could not be set for ' . $params['username'],
-            $response->getMessage()
+            $response
         );
         return false;
     }
@@ -368,7 +368,7 @@ function zimbraSingle_CreateAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not verify ' . $params['username'],
-            $accountExists->getMessage()
+            $accountExists
         );
         return 'Error: could not verify '. $params['username'];
     }
@@ -399,7 +399,7 @@ function zimbraSingle_CreateAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not find serviceclass ' . $params['configoption1'],
-            $cosID->getMessage()
+            $cosID
         );
         return 'Error: could not find serviceclass ' . $params['configoption1'];
     }
@@ -411,7 +411,7 @@ function zimbraSingle_CreateAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not create account ' . $params['username'],
-            $zimbraID->getMessage()
+            $zimbraID
         );
         return 'Error: could not create account ' . $params['username'];
     }
@@ -471,7 +471,7 @@ function zimbraSingle_SuspendAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not lock account ' . $params['username'],
-            $response->getMessage()
+            $response
         );
         return false;
     }
@@ -512,7 +512,7 @@ function zimbraSingle_UnsuspendAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not unlock account ' . $params['username'],
-            $response->getMessage()
+            $response
             );
         return 'Error: could not unlock account ' . $params['username'];
     }
@@ -552,7 +552,7 @@ function zimbraSingle_TerminateAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not verify account '. $params['username'],
-            $accountStatus->getMessage()
+            $accountStatus
         );
         return 'Error : account ' . $params['username'] . ' Name could not verified';
     }
@@ -566,7 +566,7 @@ function zimbraSingle_TerminateAccount($params) {
             __FUNCTION__,
             $params,
             'Error: could not remove account '. $params['username'],
-            $response->getMessage()
+            $response
         );
         return 'Error: could not remove account '. $params['username'];
     }
@@ -610,7 +610,7 @@ function zimbraSingle_ChangePackage($params) {
             __FUNCTION__,
             $params,
             'Error: could not set class of service for '. $params['username'],
-            $response->getMessage()
+            $response
         );
         return 'Error: could not set class of service for '. $params['username'];
     }
@@ -621,7 +621,7 @@ function zimbraSingle_ChangePackage($params) {
             __FUNCTION__,
             $params,
             'Error : could not find quota for ' . $params['username'],
-            $accountQuota->getMessage()
+            $accountQuota
         );
     }
     try {
@@ -704,7 +704,7 @@ function zimbraSingle_ConfigOptions($params) {
             __FUNCTION__,
             $params,
             'Error: could not fetch classes of service',
-            $cosIDs->getMessage()
+            $cosIDs
         );
         return false;
     }
@@ -718,3 +718,73 @@ function zimbraSingle_ConfigOptions($params) {
     );
     return $configOptions;
 }
+
+/**
+ * Perform single sign-on for a given instance of a product/service.
+ *
+ * Called when single sign-on is requested for an instance of a product/service.
+ *
+ * When successful, returns an URL to which the user should be redirected.
+ *
+ * @param array $params common module parameters
+ *
+ * @see https://developers.whmcs.com/provisioning-modules/module-parameters/
+ *
+ * @return array
+ */
+function zimbraSingle_ServiceSingleSignOn($params) {
+    $api = new Zm_Auth($params['serverhostname'], $params['serverusername'], $params['serverpassword'], 'admin');
+    $login = $api->login();
+    if(is_a($login, 'Exception')) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            'Error: cannot login to ' . $params['serverhostname'],
+            $login->getMessage()
+        );
+        return array(
+            'success' => false,
+            'redirectTo' => '',
+        );
+    }
+    $apiDomainManager = new Zm_Domain($api);
+    $domainOptions = $apiDomainManager->getDomainOptions($params['customfields']['maildomain']);
+    if(is_a($domainOptions, 'Exception')) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            'Error : could not fetch options for ' . $params['customfields']['maildomain'],
+            $domainOptions->getMessage()
+        );
+        return array(
+            'success' => false,
+            'redirectTo' => '',
+        );
+    }
+    $preAuthKey = $domainOptions['zimbraPreAuthKey'];
+    $apiAccountManager = new Zm_Account($api);
+    $accountInfo = $apiAccountManager->getAccountInfo($params['username']);
+    if(is_a($accountInfo, 'Exception')) {
+        logModuleCall(
+            'zimbrasingle',
+            __FUNCTION__,
+            $params,
+            'Error: could not gather informations for ' . $params['username'],
+            $accountInfo
+        );
+        return array(
+            'success' => false,
+            'redirectTo' => '',
+        );
+    }
+    $webmailUrl = zimbraSingleFindAll($accountInfo, 'PUBLICMAILURL');
+    $timestamp=time()*1000;
+    $preauthToken=hash_hmac('sha1', $params['username'] . '|name|0|' . $timestamp, $preAuthKey);
+    $preauthURL = $webmailUrl[0]['DATA'] . '/service/preauth?account=' . $params['username'] . '&by=name&timestamp=' . $timestamp .'&expires=0&preauth='. $preauthToken;
+    return array(
+        'success' => true,
+        'redirectTo' => $preauthURL,
+    );
+}