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();
}
| package |
ZimbraSoapPhp |
|---|
__construct(string $server, string $username, string $password, string $authas = "admin", integer $attempts = 3)
stringserver name (example: zimbra.yourdomain.com)
stringadmin/user account's username
stringadmin/user account's password
stringauthenticate as admin or user (default admin)
integerhow many times we retry to invoke a soapCall (default 3)
getRetryAttempts() : integer
integerattempts how many times we retry to invoke a soapCall
login()
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
setRetryAttempts(integer $attempts)
integerhow many times we retry to invoke a soapCall the wait time between attempts is progressively increased using an exponential backoff algorithm
soapHeader :
params :
authToken :
context :
retryAttempts :