Commit 2ddda5c8 authored by skummer's avatar skummer

ZP-581 #comment before processing a meeting request confirmation or...

ZP-581 #comment before processing a meeting request confirmation or cancellation, check if the current user is not the sender and only process it then. Should fix the auto-cancellation when cancelling one attendee.

git-svn-id: https://z-push.org/svn/z-push/trunk@1936 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 90b2c3b4
...@@ -648,12 +648,16 @@ class MAPIProvider { ...@@ -648,12 +648,16 @@ class MAPIProvider {
// if a meeting request response hasn't been processed yet, // if a meeting request response hasn't been processed yet,
// do it so that the attendee status is updated on the mobile // do it so that the attendee status is updated on the mobile
if(!isset($messageprops[$emailproperties["processed"]])) { if(!isset($messageprops[$emailproperties["processed"]])) {
$req = new Meetingrequest($this->store, $mapimessage, $this->session); // check if we are not sending the MR so we can process it - ZP-581
if ($req->isMeetingRequestResponse()) { $cuser = ZPush::GetBackend()->GetUserDetails(ZPush::GetBackend()->GetCurrentUsername());
$req->processMeetingRequestResponse(); if(isset($cuser["emailaddress"]) && $cuser["emailaddress"] != $fromaddr) {
} $req = new Meetingrequest($this->store, $mapimessage, $this->session);
if ($req->isMeetingCancellation()) { if ($req->isMeetingRequestResponse()) {
$req->processMeetingCancellation(); $req->processMeetingRequestResponse();
}
if ($req->isMeetingCancellation()) {
$req->processMeetingCancellation();
}
} }
} }
$message->contentclass = DEFAULT_CALENDAR_CONTENTCLASS; $message->contentclass = DEFAULT_CALENDAR_CONTENTCLASS;
......
...@@ -1195,12 +1195,21 @@ class BackendZarafa implements IBackend, ISearchProvider { ...@@ -1195,12 +1195,21 @@ class BackendZarafa implements IBackend, ISearchProvider {
*/ */
public function GetUserDetails($username) { public function GetUserDetails($username) {
ZLog::Write(LOGLEVEL_WBXML, sprintf("ZarafaBackend->GetUserDetails for '%s'.", $username)); ZLog::Write(LOGLEVEL_WBXML, sprintf("ZarafaBackend->GetUserDetails for '%s'.", $username));
$zarafauserinfo = @mapi_zarafa_getuser_by_name($this->defaultstore, $username); $zarafauserinfo = @mapi_zarafa_getuser_by_name($this->store, $username);
$userDetails['emailaddress'] = (isset($zarafauserinfo['emailaddress']) && $zarafauserinfo['emailaddress']) ? $zarafauserinfo['emailaddress'] : false; $userDetails['emailaddress'] = (isset($zarafauserinfo['emailaddress']) && $zarafauserinfo['emailaddress']) ? $zarafauserinfo['emailaddress'] : false;
$userDetails['fullname'] = (isset($zarafauserinfo['fullname']) && $zarafauserinfo['fullname']) ? $zarafauserinfo['fullname'] : false; $userDetails['fullname'] = (isset($zarafauserinfo['fullname']) && $zarafauserinfo['fullname']) ? $zarafauserinfo['fullname'] : false;
return $userDetails; return $userDetails;
} }
/**
* Returns the username of the currently active user
*
* @access public
* @return String
*/
public function GetCurrentUsername() {
return $this->storeName;
}
/**---------------------------------------------------------------------------------------------------------- /**----------------------------------------------------------------------------------------------------------
* Private methods * Private methods
......
...@@ -215,6 +215,16 @@ abstract class Backend implements IBackend { ...@@ -215,6 +215,16 @@ abstract class Backend implements IBackend {
return array('emailaddress' => $username, 'fullname' => $username); return array('emailaddress' => $username, 'fullname' => $username);
} }
/**
* Returns the username and store of the currently active user
*
* @access public
* @return Array
*/
public function GetCurrentUsername() {
return $this->GetUserDetails(Request::GetAuthUser());
}
/**---------------------------------------------------------------------------------------------------------- /**----------------------------------------------------------------------------------------------------------
* Protected methods for BackendStorage * Protected methods for BackendStorage
* *
......
...@@ -299,6 +299,14 @@ interface IBackend { ...@@ -299,6 +299,14 @@ interface IBackend {
* @return Array * @return Array
*/ */
public function GetUserDetails($username); public function GetUserDetails($username);
/**
* Returns the username of the currently active user
*
* @access public
* @return Array
*/
public function GetCurrentUsername();
} }
?> ?>
\ No newline at end of file
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