| Welcome to the Zimbra - Forums! | |
Welcome, if you would like to post a comment please register.
We also encourage you to explore all things Zimbra with our team and members of the community.
|  | | 
09-06-2007, 12:38 AM
| | | how can i set both attribute and parameters at a time to a function call in PHP:
Above in this post way to set attribute or param are discussed but not both at a time.
i need this:
<SearchRequest limit="10" offset="20">
<query>is:unread</query>
</SearchRequest>
Thanks | 
06-27-2008, 06:21 AM
| | | License? Corey Scott,
First of all, thank you for sharing this, it was very useful to me!
I don't see any license information in the files. Do you plan to release it in a free license like the GPL ?
In the meantime, is it possible for me to redistribute it ?
I started building some functionality around your base class, and I would like to release my code with an open source license, and include your class for better ease of use.
Thanks in advance,
Nicolas.
Last edited by skanx : 06-27-2008 at 06:23 AM.
| 
11-05-2008, 09:31 AM
| | | Were you ever able to create a way to mass subscribe people in your company to your company Calendar? I'm looking to do a similar thing for our student calendar. Any help would be greatly appreciated! Quote:
Originally Posted by gettyless Thanks for sharing your code - I can verify that it works in my test environment! Using your code, I can create a user programmatically through PHP and SOAP. For my test machine, I have win32 apache running - so I had to enable these extensions in my php.ini: Code: extension=php_openssl.dll
extension=php_soap.dll
extension=php_curl.dll I'd like to be able to quickly crank out scripts to do what I an across multiple account, for whatever features that aren't officially implemented yet .. if I really need that feature. For example, I'd like to auto-subscribe all employees to the company calendar.
So, I will probably reuse the authentication code. I've rewritten it into an OO way not sure if it's the best way, design-wise, but it's a start: Code:
<form method="POST" action="soap.php">
username<br>
<input type="text" name="username"><br>
password<br>
<input type="text" name="password"><br>
<input type="submit" name="submit" value="submit"><br>
</form>
<?php
if (count($_POST))
{
$password = $_POST['password'];
$username = $_POST['username'];
$ZimbraAuth = new ZimbraAuth($username, $password);
echo $ZimbraAuth->exec();
}
class ZimbraAuth
{
private $client;
private $params;
function __construct($username, $password)
{
$this->client = new SoapClient(null,
array(
'location' => "https://zimbra.microsoft.com:7071/service/admin/soap/",
'uri' => "urn:zimbraAdmin",
'trace' => 1,
'exceptions' => 1,
'soap_version' => SOAP_1_1,
'style' => SOAP_RPC,
'use' => SOAP_LITERAL
)
);
$this->params = array( new SoapParam($username, "name"), new SoapParam($password, "password") );
}
function exec()
{
try
{
//echo "creating header...<br>";
$soapHeader = new SoapHeader('urn:zimbra','context');
//echo "trying...<br>";
$result = $this->client->__soapCall("AuthRequest", $this->params, null,$soapHeader);
//echo "executed...<br>";
}
catch (SoapFault $exception)
{
echo "exception caught!...<br><br>EXCEPTION START <<<<<<<<<<< <p>";
echo $exception . "<br><br>";
echo ">>>>>>>>>>>> EXCEPTION END<p>";
echo htmlentities($client->__getLastRequest()) . "<br><br>";
echo htmlentities($client->__getLastRequestHeaders()) . "<br><br>";
echo htmlentities($client->__getLastResponseHeaders()) . "<br><br>";
echo htmlentities($client->__getLastResponse()) . "<br><br>";
}
//echo "authToken says: ".$result['authToken'] . "<br>";
//echo "logged in, continuing<br>";
return $result['authToken'];
}
}
?> I'm guessing it would make sense to have a separate ZimbraAuth class, like how people often have a separate database authentication class. Then I use the token for something like $ZimbraUser->create($authToken) or $ZimbraUser->ChangePassword($old, $new, $authToken). | | 
11-10-2008, 11:57 PM
| | | Access appointment in zimbra calendar I access the zimbra calendar and got the appointment. But it only returns the standard calendar appointment details. Not from other created calendars. SOAP:
<SearchRequest xmlns="urn:zimbraMail" types="appointment" calExpandInstStart="'.$datestart.'000" calExpandInstEnd="'.$dateend.'000">
<query>in:calendar</query>
</SearchRequest> | | Thread Tools | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |