$items[$R_item['id']] = $R_item;
}
*/
// Getting sync-data
/*
$sync = array();
$Q = mysql_query("select * from `sync` where `user` = '".$login['username']."'");
echo mysql_error();
while($R_sync = mysql_fetch_assoc($Q))
{
	$sync[$R_sync['item_id']] = $R_sync;
}
*/
$wsdl = dirname(__FILE__) . '/Services.wsdl';
$client = new NTLMSoapClient($wsdl, array('login' => $login['username'], 'password' => $login['password'], 'trace' => true, 'exceptions' => true));
$cal = new ExchangePHP($client);
// $user_id => $primary_emailaddress
$users = array('*****@*****.**', '*****@*****.**');
$calendaritems = array();
$items_new = array();
foreach ($users as $user_id => $user_email) {
    try {
        printout('New user: '******'Y-m-d') . 'T00:00:00', date('Y-m-d', time() + 61171200) . 'T00:00:00Z', $user_email);
    } catch (Exception $e) {
        printout('Exception - getCalendarItems: ' . $e->getMessage());
        if ($cal->client->getError() == '401') {
            // Unauthorized
            printout('Wrong username and password.');
        }
        exit;
Example #2
0
$items = array();
$Q = mysql_query("select * from `items`");
echo mysql_error();
while ($R_item = mysql_fetch_assoc($Q)) {
    $items[$R_item['id']] = $R_item;
}
// Getting sync-data
$sync = array();
$Q = mysql_query("select * from `sync` where `user` = '" . $login['username'] . "'");
echo mysql_error();
while ($R_sync = mysql_fetch_assoc($Q)) {
    $sync[$R_sync['item_id']] = $R_sync;
}
$wsdl = dirname(__FILE__) . '/Services.wsdl';
$client = new NTLMSoapClient($wsdl, array('login' => $login['username'], 'password' => $login['password'], 'trace' => true, 'exceptions' => true));
$cal = new ExchangePHP($client);
try {
    $calendaritems = $cal->getCalendarItems(date('Y-m-d') . 'T00:00:00', date('Y-m-d', time() + 61171200) . 'T00:00:00Z');
} catch (Exception $e) {
    printout('Exception - getCalendarItems: ' . $e->getMessage());
    if ($cal->client->getError() == '401') {
        // Unauthorized
        printout('Wrong username and password.');
    }
    exit;
}
$cal_ids = array();
// Id => ChangeKey
if (is_null($calendaritems)) {
    printout('getCalendarItems failed: ' . $cal->getError());
} else {