Zm_Auth.html 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
  5. <meta charset="utf-8"/>
  6. <title> ZimbraSoapPhp &raquo; \Zm_Auth
  7. </title>
  8. <meta name="author" content=""/>
  9. <meta name="description" content=""/>
  10. <link href="../css/template.css" rel="stylesheet" media="all"/>
  11. <!--[if lt IE 9]>
  12. <script src="https://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
  13. <![endif]-->
  14. <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script>
  15. <script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>
  16. <script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script>
  17. <script src="../js/bootstrap.js" type="text/javascript"></script>
  18. <script src="../js/template.js" type="text/javascript"></script>
  19. <script src="../js/prettify/prettify.min.js" type="text/javascript"></script>
  20. <link rel="shortcut icon" href="../img/favicon.ico"/>
  21. <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"/>
  22. <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"/>
  23. <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"/>
  24. </head>
  25. <body>
  26. <div class="navbar navbar-fixed-top">
  27. <div class="navbar-inner">
  28. <div class="container">
  29. <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  30. <span class="icon-bar"></span> <span class="icon-bar"></span>
  31. <span class="icon-bar"></span> </a>
  32. <a class="brand" href="../index.html">ZimbraSoapPhp</a>
  33. <div class="nav-collapse">
  34. <ul class="nav">
  35. <li class="dropdown">
  36. <a href="#api" class="dropdown-toggle" data-toggle="dropdown">
  37. API Documentation <b class="caret"></b>
  38. </a>
  39. <ul class="dropdown-menu">
  40. </ul>
  41. </li>
  42. <li class="dropdown" id="charts-menu">
  43. <a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
  44. Charts <b class="caret"></b>
  45. </a>
  46. <ul class="dropdown-menu">
  47. <li>
  48. <a href="../graph_class.html">
  49. <i class="icon-list-alt"></i>&#160;Class hierarchy diagram
  50. </a>
  51. </li>
  52. </ul>
  53. </li>
  54. <li class="dropdown" id="reports-menu">
  55. <a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
  56. Reports <b class="caret"></b>
  57. </a>
  58. <ul class="dropdown-menu">
  59. <li>
  60. <a href="../errors.html">
  61. <i class="icon-list-alt"></i>&#160;Errors
  62. </a>
  63. </li>
  64. <li>
  65. <a href="../markers.html">
  66. <i class="icon-list-alt"></i>&#160;Markers
  67. </a>
  68. </li>
  69. <li>
  70. <a href="../deprecated.html">
  71. <i class="icon-list-alt"></i>&#160;Deprecated
  72. </a>
  73. </li>
  74. </ul>
  75. </li>
  76. </ul>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="go_to_top">
  81. <a href="#___" style="color: inherit">Back to top&#160;&#160;<i class="icon-upload icon-white"></i></a>
  82. </div>
  83. </div>
  84. <div id="___" class="container">
  85. <noscript>
  86. <div class="alert alert-warning">
  87. Javascript is disabled; several features are only available if Javascript is enabled.
  88. </div>
  89. </noscript>
  90. <style>
  91. .deprecated h2 {
  92. text-decoration: line-through;
  93. }
  94. </style>
  95. <div class="row">
  96. <div class="span4">
  97. <div class="btn-group view pull-right" data-toggle="buttons-radio">
  98. <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button>
  99. <button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
  100. </div>
  101. <div class="btn-group visibility" data-toggle="buttons-checkbox">
  102. <button class="btn public active" title="Show public elements">Public</button>
  103. <button class="btn protected" title="Show protected elements">Protected</button>
  104. <button class="btn private" title="Show private elements">Private</button>
  105. <button class="btn inherited active" title="Show inherited elements">Inherited</button>
  106. </div>
  107. <ul class="side-nav nav nav-list">
  108. <li class="nav-header">
  109. <i class="icon-custom icon-method"></i> Methods
  110. <ul>
  111. <li class="method public">
  112. <a href="#method___construct" title="__construct :: Constructor">
  113. <span class="description">Constructor</span><pre>__construct</pre>
  114. </a>
  115. </li>
  116. <li class="method public">
  117. <a href="#method_getRetryAttempts" title="getRetryAttempts :: getRetryAttempts">
  118. <span class="description">getRetryAttempts</span><pre>getRetryAttempts</pre>
  119. </a>
  120. </li>
  121. <li class="method public">
  122. <a href="#method_login" title="login :: login">
  123. <span class="description">login</span><pre>login</pre>
  124. </a>
  125. </li>
  126. <li class="method public">
  127. <a href="#method_setRetryAttempts" title="setRetryAttempts :: setRetryAttempts">
  128. <span class="description">setRetryAttempts</span><pre>setRetryAttempts</pre>
  129. </a>
  130. </li>
  131. </ul>
  132. </li>
  133. <li class="nav-header protected">» Protected
  134. <ul>
  135. </ul>
  136. </li>
  137. <li class="nav-header private">» Private
  138. <ul>
  139. </ul>
  140. </li>
  141. <li class="nav-header">
  142. <i class="icon-custom icon-constant"></i> Constants
  143. <ul>
  144. </ul>
  145. </li>
  146. </ul>
  147. </div>
  148. <div class="span8">
  149. <div class="element class">
  150. <h1>Zm_Auth</h1>
  151. <small style="display: block; text-align: right">
  152. </small>
  153. <p class="short_description">Zm_Auth is a class which allows to connect to the Zimbra admin or user space via SOAP</p>
  154. <div class="details">
  155. <div class="long_description">
  156. <p>Use this class to connect and login to a Zimbra server</p>
  157. <p>Example:</p>
  158. <pre><code>// either authenticate as admin:
  159. $auth = new Zm_Auth($zimbraServer, $zimbraAdminEmail, $zimbraAdminPassword, "admin");
  160. // or authenticate as user:
  161. $auth = new Zm_Auth($zimbraServer, $userEmail, $userPassword, "user");
  162. // then login
  163. $l = $auth-&gt;login();
  164. if(is_a($l, "Exception")) {
  165. echo "Error : cannot login to $zimbraServer\n";
  166. echo $l-&gt;getMessage()."\n";
  167. exit();
  168. }</code></pre>
  169. </div>
  170. <table class="table table-bordered">
  171. <tr>
  172. <th>
  173. package
  174. </th>
  175. <td>
  176. <p>ZimbraSoapPhp</p>
  177. </td>
  178. </tr>
  179. </table>
  180. <h3><i class="icon-custom icon-method"></i> Methods</h3>
  181. <a id="method___construct"></a>
  182. <div class="element clickable method public method___construct" data-toggle="collapse" data-target=".method___construct .collapse">
  183. <h2>Constructor</h2>
  184. <pre>__construct(string $server, string $username, string $password, string $authas = &quot;admin&quot;, integer $attempts = 3) </pre>
  185. <div class="labels">
  186. </div>
  187. <div class="row collapse">
  188. <div class="detail-description">
  189. <div class="long_description"></div>
  190. <table class="table">
  191. <tr>
  192. <th>
  193. </th>
  194. <td>
  195. </td>
  196. </tr>
  197. </table>
  198. <h3>Arguments</h3>
  199. <div class="subelement argument">
  200. <h4>$server</h4>
  201. <code>string</code><p><p>server name (example: zimbra.yourdomain.com)</p></p>
  202. </div>
  203. <div class="subelement argument">
  204. <h4>$username</h4>
  205. <code>string</code><p><p>admin/user account's username</p></p>
  206. </div>
  207. <div class="subelement argument">
  208. <h4>$password</h4>
  209. <code>string</code><p><p>admin/user account's password</p></p>
  210. </div>
  211. <div class="subelement argument">
  212. <h4>$authas</h4>
  213. <code>string</code><p><p>authenticate as admin or user (default admin)</p></p>
  214. </div>
  215. <div class="subelement argument">
  216. <h4>$attempts</h4>
  217. <code>integer</code><p><p>how many times we retry to invoke a soapCall (default 3)</p></p>
  218. </div>
  219. </div>
  220. </div>
  221. </div>
  222. <a id="method_getRetryAttempts"></a>
  223. <div class="element clickable method public method_getRetryAttempts" data-toggle="collapse" data-target=".method_getRetryAttempts .collapse">
  224. <h2>getRetryAttempts</h2>
  225. <pre>getRetryAttempts() : integer</pre>
  226. <div class="labels">
  227. </div>
  228. <div class="row collapse">
  229. <div class="detail-description">
  230. <div class="long_description"></div>
  231. <table class="table">
  232. <tr>
  233. <th>
  234. </th>
  235. <td>
  236. </td>
  237. </tr>
  238. </table>
  239. <h3>Response</h3>
  240. <code>integer</code><p><p>attempts how many times we retry to invoke a soapCall</p></p>
  241. </div>
  242. </div>
  243. </div>
  244. <a id="method_login"></a>
  245. <div class="element clickable method public method_login" data-toggle="collapse" data-target=".method_login .collapse">
  246. <h2>login</h2>
  247. <pre>login() </pre>
  248. <div class="labels">
  249. </div>
  250. <div class="row collapse">
  251. <div class="detail-description">
  252. <div class="long_description"><p>Use this method to login to a Zimbra server after you create an instance of this class</p>
  253. <p>Login parameters must be specified when calling the constructor</p></div>
  254. <table class="table">
  255. <tr>
  256. <th>
  257. </th>
  258. <td>
  259. </td>
  260. </tr>
  261. <tr>
  262. <th>
  263. </th>
  264. <td>
  265. </td>
  266. </tr>
  267. </table>
  268. </div>
  269. </div>
  270. </div>
  271. <a id="method_setRetryAttempts"></a>
  272. <div class="element clickable method public method_setRetryAttempts" data-toggle="collapse" data-target=".method_setRetryAttempts .collapse">
  273. <h2>setRetryAttempts</h2>
  274. <pre>setRetryAttempts(integer $attempts) </pre>
  275. <div class="labels">
  276. </div>
  277. <div class="row collapse">
  278. <div class="detail-description">
  279. <div class="long_description"></div>
  280. <table class="table">
  281. <tr>
  282. <th>
  283. </th>
  284. <td>
  285. </td>
  286. </tr>
  287. </table>
  288. <h3>Arguments</h3>
  289. <div class="subelement argument">
  290. <h4>$attempts</h4>
  291. <code>integer</code><p><p>how many times we retry to invoke a soapCall
  292. the wait time between attempts is progressively increased using an exponential backoff algorithm</p></p>
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. <h3><i class="icon-custom icon-property"></i> Properties</h3>
  298. <a id="property_client"> </a>
  299. <div class="element clickable property private property_client" data-toggle="collapse" data-target=".property_client .collapse">
  300. <h2>$auth</h2>
  301. <pre>client : \Zm_Auth</pre>
  302. <div class="labels">
  303. </div>
  304. <div class="row collapse">
  305. <div class="detail-description">
  306. <div class="long_description"></div>
  307. <table class="table">
  308. <tr>
  309. <th>
  310. var
  311. </th>
  312. <td>
  313. <p>soap authentication</p>
  314. </td>
  315. </tr>
  316. </table>
  317. <h3>Type(s)</h3>
  318. <code><a href="../classes/Zm_Auth.html">\Zm_Auth</a></code>
  319. </div>
  320. </div>
  321. </div>
  322. <a id="property_soapHeader"> </a>
  323. <div class="element clickable property private property_soapHeader" data-toggle="collapse" data-target=".property_soapHeader .collapse">
  324. <h2>soapHeader</h2>
  325. <pre>soapHeader : </pre>
  326. <div class="labels">
  327. </div>
  328. <div class="row collapse">
  329. <div class="detail-description">
  330. <div class="long_description"></div>
  331. <table class="table">
  332. <tr>
  333. <th>
  334. </th>
  335. <td>
  336. </td>
  337. </tr>
  338. </table>
  339. <h3>Type(s)</h3>
  340. <code></code>
  341. </div>
  342. </div>
  343. </div>
  344. <a id="property_params"> </a>
  345. <div class="element clickable property private property_params" data-toggle="collapse" data-target=".property_params .collapse">
  346. <h2>params</h2>
  347. <pre>params : </pre>
  348. <div class="labels">
  349. </div>
  350. <div class="row collapse">
  351. <div class="detail-description">
  352. <div class="long_description"></div>
  353. <table class="table">
  354. <tr>
  355. <th>
  356. </th>
  357. <td>
  358. </td>
  359. </tr>
  360. </table>
  361. <h3>Type(s)</h3>
  362. <code></code>
  363. </div>
  364. </div>
  365. </div>
  366. <a id="property_authToken"> </a>
  367. <div class="element clickable property private property_authToken" data-toggle="collapse" data-target=".property_authToken .collapse">
  368. <h2>authToken</h2>
  369. <pre>authToken : </pre>
  370. <div class="labels">
  371. </div>
  372. <div class="row collapse">
  373. <div class="detail-description">
  374. <div class="long_description"></div>
  375. <table class="table">
  376. <tr>
  377. <th>
  378. </th>
  379. <td>
  380. </td>
  381. </tr>
  382. </table>
  383. <h3>Type(s)</h3>
  384. <code></code>
  385. </div>
  386. </div>
  387. </div>
  388. <a id="property_context"> </a>
  389. <div class="element clickable property private property_context" data-toggle="collapse" data-target=".property_context .collapse">
  390. <h2>context</h2>
  391. <pre>context : </pre>
  392. <div class="labels">
  393. </div>
  394. <div class="row collapse">
  395. <div class="detail-description">
  396. <div class="long_description"></div>
  397. <table class="table">
  398. <tr>
  399. <th>
  400. </th>
  401. <td>
  402. </td>
  403. </tr>
  404. </table>
  405. <h3>Type(s)</h3>
  406. <code></code>
  407. </div>
  408. </div>
  409. </div>
  410. <a id="property_retryAttempts"> </a>
  411. <div class="element clickable property private property_retryAttempts" data-toggle="collapse" data-target=".property_retryAttempts .collapse">
  412. <h2>retryAttempts</h2>
  413. <pre>retryAttempts : </pre>
  414. <div class="labels">
  415. </div>
  416. <div class="row collapse">
  417. <div class="detail-description">
  418. <div class="long_description"></div>
  419. <table class="table">
  420. <tr>
  421. <th>
  422. </th>
  423. <td>
  424. </td>
  425. </tr>
  426. </table>
  427. <h3>Type(s)</h3>
  428. <code></code>
  429. </div>
  430. </div>
  431. </div>
  432. </div>
  433. </div>
  434. <a id="\Zm_Auth"></a>
  435. <ul class="breadcrumb">
  436. <li><a href="../index.html"><i class="icon-custom icon-class"></i></a></li>
  437. <li><span class="divider">\</span><a href="../namespaces/default.html">\</a></li>
  438. <li class="active"><span class="divider">\</span><a href="../classes/Zm_Auth.html">Zm_Auth</a></li>
  439. </ul>
  440. </div>
  441. </div>
  442. </div>
  443. <footer class="span12">
  444. Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by
  445. <a href="http://glyphicons.com/">Glyphicons</a>.<br/>
  446. Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor </a> and<br/>
  447. generated on Tue, 26 Sep 2017 11:01:05 +0200.<br/>
  448. </footer>
  449. </body>
  450. </html>