Zm_Auth
Zm_Auth is a class which allows to connect to the Zimbra admin or user space via SOAP
Use this class to connect and login to a Zimbra server
Example:
// either authenticate as admin:
$auth = new Zm_Auth($zimbraServer, $zimbraAdminEmail, $zimbraAdminPassword, "admin");
// or authenticate as user:
$auth = new Zm_Auth($zimbraServer, $userEmail, $userPassword, "user");
// then login
$l = $auth->login();
if(is_a($l, "Exception")) {
echo "Error : cannot login to $zimbraServer\n";
echo $l->getMessage()."\n";
exit();
}
Table of Contents
- $authToken : mixed
- $client : Zm_Auth
- $auth
- $context : mixed
- $params : mixed
- $retryAttempts : mixed
- $soapHeader : mixed
- __construct() : mixed
- Constructor
- getRetryAttempts() : int
- getRetryAttempts
- login() : mixed
- login
- setRetryAttempts() : mixed
- setRetryAttempts
Properties
$authToken
private
mixed
$authToken
$client
$auth
private
Zm_Auth
$client
$context
private
mixed
$context
$params
private
mixed
$params
$retryAttempts
private
mixed
$retryAttempts
$soapHeader
private
mixed
$soapHeader
Methods
__construct()
Constructor
public
__construct(string $server, string $username, string $password[, string $authas = "admin" ][, int $attempts = 3 ]) : mixed
Parameters
- $server : string
-
server name (example: zimbra.yourdomain.com)
- $username : string
-
admin/user account's username
- $password : string
-
admin/user account's password
- $authas : string = "admin"
-
authenticate as admin or user (default admin)
- $attempts : int = 3
-
how many times we retry to invoke a soapCall (default 3)
Return values
mixed —getRetryAttempts()
getRetryAttempts
public
getRetryAttempts() : int
Return values
int —attempts how many times we retry to invoke a soapCall
login()
login
public
login() : mixed
Use this method to login to a Zimbra server after you create an instance of this class
Login parameters must be specified when calling the constructor
Return values
mixed —setRetryAttempts()
setRetryAttempts
public
setRetryAttempts(int $attempts) : mixed
Parameters
- $attempts : int
-
how many times we retry to invoke a soapCall the wait time between attempts is progressively increased using an exponential backoff algorithm