Commit 0c92d12e authored by Manfred Kutas's avatar Manfred Kutas

Merge pull request #636 in ZP/z-push from develop to master

* commit 'e6898bad':
  ZP-1339 Replace removed PHP-MAPI functions.
parent 0039ee36
......@@ -431,10 +431,10 @@ class ImportChangesICS implements IImportChanges {
if(mapi_importcontentschanges_importmessagechange($this->importer, $props, $flags, $mapimessage)) {
$this->mapiprovider->SetMessage($mapimessage, $message);
mapi_message_savechanges($mapimessage);
mapi_savechanges($mapimessage);
if (mapi_last_hresult())
throw new StatusException(sprintf("ImportChangesICS->ImportMessageChange('%s','%s'): Error, mapi_message_savechanges() failed: 0x%X", $id, get_class($message), mapi_last_hresult()), SYNC_STATUS_SYNCCANNOTBECOMPLETED);
throw new StatusException(sprintf("ImportChangesICS->ImportMessageChange('%s','%s'): Error, mapi_savechanges() failed: 0x%X", $id, get_class($message), mapi_last_hresult()), SYNC_STATUS_SYNCCANNOTBECOMPLETED);
$sourcekeyprops = mapi_getprops($mapimessage, array (PR_SOURCE_KEY));
......
......@@ -668,7 +668,7 @@ class BackendKopano implements IBackend, ISearchProvider {
}
mapi_setprops($mapimessage, $mapiprops);
mapi_message_savechanges($mapimessage);
mapi_savechanges($mapimessage);
mapi_message_submitmessage($mapimessage);
$hr = mapi_last_hresult();
......@@ -1873,13 +1873,13 @@ class BackendKopano implements IBackend, ISearchProvider {
ZLog::Write(LOGLEVEL_ERROR, "The store or user are not available for getting user information");
return false;
}
$user = mapi_zarafa_getuser($this->defaultstore, $this->mainUser);
$user = mapi_zarafa_getuser_by_name($this->defaultstore, $this->mainUser);
if ($user != false) {
$userinformation->Status = SYNC_SETTINGSSTATUS_USERINFO_SUCCESS;
$userinformation->emailaddresses[] = $user["emailaddress"];
return true;
}
ZLog::Write(LOGLEVEL_ERROR, sprintf("Getting user information failed: mapi_zarafa_getuser(%X)", mapi_last_hresult()));
ZLog::Write(LOGLEVEL_ERROR, sprintf("Getting user information failed: mapi_zarafa_getuser_by_name(%X)", mapi_last_hresult()));
return false;
}
......
......@@ -379,7 +379,7 @@ class Meetingrequest {
$recurr->createException($exception_props, $basedate, false, $recips);
}
mapi_message_savechanges($calendaritem);
mapi_savechanges($calendaritem);
$attach = $recurr->getExceptionAttachment($basedate);
if ($attach) {
......@@ -469,13 +469,13 @@ If it is the first time this attendee has proposed a new date/time, increment th
$props[$this->proptags['counter_proposal']] = false;
}
mapi_message_setprops($calendaritem, $props);
mapi_setprops($calendaritem, $props);
}
mapi_message_savechanges($calendaritem);
mapi_savechanges($calendaritem);
if (isset($attach)) {
mapi_message_savechanges($attach);
mapi_message_savechanges($recurringItem);
mapi_savechanges($attach);
mapi_savechanges($recurringItem);
}
return $data;
......@@ -559,7 +559,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
foreach($calendaritems as $entryid) {
// Open each calendar item and set the properties of the cancellation object
$calendaritem = mapi_msgstore_openentry($store, $entryid);
mapi_message_setprops($calendaritem, $messageprops);
mapi_setprops($calendaritem, $messageprops);
mapi_savechanges($calendaritem);
}
}
......@@ -639,7 +639,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
return false;
} else {
mapi_setprops($this->message, Array(PR_PROCESSED => true));
mapi_message_savechanges($this->message);
mapi_savechanges($this->message);
}
}
......@@ -881,7 +881,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
mapi_message_modifyrecipients($calmsg, MODRECIP_ADD, $recips);
}
mapi_message_savechanges($calmsg);
mapi_savechanges($calmsg);
// Move the message to the wastebasket
$wastebasket = $this->openDefaultWastebasket();
......@@ -942,7 +942,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
} else {
mapi_message_modifyrecipients($new, MODRECIP_ADD, $recips);
}
mapi_message_savechanges($new);
mapi_savechanges($new);
$props = mapi_getprops($new, array(PR_ENTRYID));
$entryid = $props[PR_ENTRYID];
......@@ -1757,7 +1757,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
$message = mapi_folder_createmessage($outbox);
mapi_setprops($message, $props);
mapi_message_modifyrecipients($message, MODRECIP_ADD, Array($recip));
mapi_message_savechanges($message);
mapi_savechanges($message);
mapi_message_submitmessage($message);
}
......@@ -2385,7 +2385,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
// Publish updated free/busy information
if(!$this->errorSetResource){
for($i = 0, $len = count($resourceRecipData); $i < $len; $i++){
$storeProps = mapi_msgstore_getprops($resourceRecipData[$i]['store'], array(PR_MAILBOX_OWNER_ENTRYID));
$storeProps = mapi_getprops($resourceRecipData[$i]['store'], array(PR_MAILBOX_OWNER_ENTRYID));
if (isset($storeProps[PR_MAILBOX_OWNER_ENTRYID])){
$pub = new FreeBusyPublish($this->session, $resourceRecipData[$i]['store'], $resourceRecipData[$i]['folder'], $storeProps[PR_MAILBOX_OWNER_ENTRYID]);
$pub->publishFB(time() - (7 * 24 * 60 * 60), 6 * 30 * 24 * 60 * 60); // publish from one week ago, 6 months ahead
......@@ -2672,7 +2672,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
}
mapi_setprops($new, $newmessageprops);
mapi_message_savechanges($new);
mapi_savechanges($new);
// Submit message to non-resource recipients
mapi_message_submitmessage($new);
......@@ -2693,7 +2693,7 @@ If it is the first time this attendee has proposed a new date/time, increment th
}
mapi_setprops($new, $newmessageprops);
mapi_message_savechanges($new);
mapi_savechanges($new);
// Submit message to non-resource recipients
mapi_message_submitmessage($new);
......
......@@ -706,7 +706,7 @@
$props[PR_DISPLAY_NAME] = "Exception";
$props[PR_EXCEPTION_STARTTIME] = $this->fromGMT($this->tz, $exception_props[$this->proptags["startdate"]]);
$props[PR_EXCEPTION_ENDTIME] = $this->fromGMT($this->tz, $exception_props[$this->proptags["duedate"]]);
mapi_message_setprops($attachment, $props);
mapi_setprops($attachment, $props);
$imessage = mapi_attach_openobj($attachment, MAPI_CREATE | MAPI_MODIFY);
......@@ -736,12 +736,12 @@
}
}
mapi_message_setprops($imessage, $props);
mapi_setprops($imessage, $props);
$this->setExceptionRecipients($imessage, $exception_recips, true);
mapi_message_savechanges($imessage);
mapi_message_savechanges($attachment);
mapi_savechanges($imessage);
mapi_savechanges($attachment);
}
/**
......
......@@ -298,7 +298,7 @@
mapi_savechanges($newMessage);
// Update body of original message
$msgbody = mapi_message_openproperty($this->message, PR_BODY);
$msgbody = mapi_openproperty($this->message, PR_BODY);
$msgbody = trim($this->windows1252_to_utf8($msgbody), "\0");
$separator = "------------\r\n";
......
......@@ -930,7 +930,7 @@
if (isset($msgProps[$this->props['mileage']])) $body .= "\n" . _("Mileage") . ":\t". $msgProps[$this->props['mileage']];
$body .="\n";
$content = mapi_message_openproperty($this->message, PR_BODY);
$content = mapi_openproperty($this->message, PR_BODY);
$body .= "\n". trim($content, "\0");
return $body;
......
......@@ -1686,7 +1686,7 @@ class MAPIProvider {
$p = array( $taskprops["owner"]);
$owner = $this->getProps($mapimessage, $p);
if (!isset($owner[$taskprops["owner"]])) {
$userinfo = mapi_zarafa_getuser($this->store, Request::GetAuthUser());
$userinfo = mapi_zarafa_getuser_by_name($this->store, Request::GetAuthUser());
if(mapi_last_hresult() == NOERROR && isset($userinfo["fullname"])) {
$props[$taskprops["owner"]] = $userinfo["fullname"];
}
......
......@@ -262,7 +262,7 @@ class Kopano extends ContactWorker {
// save the hash in the message as well
mapi_setprops($mapimessage, array($this->mapiprops['hash'] => $contact->GetHash()));
$mapiprovider->SetMessage($mapimessage, $contact);
mapi_message_savechanges($mapimessage);
mapi_savechanges($mapimessage);
unset($existingByAccount[$contact->accountname]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment