From c23f8c37d3c1a1b237b330155808eaf925ea9723 Wed, 26 Jun 2013 23:51:24 +0300
From: Robert Munteanu <robert@lmn.ro>
Date: Wed, 26 Jun 2013 23:51:12 +0300
Subject: [PATCH] soap api: set $g_project_override for the mc_issue_note_add function


Fixes #16028: Adding note via webservice generates wrong email content
for assigned user 

diff --git a/api/soap/mc_issue_api.php b/api/soap/mc_issue_api.php
index 2dee6ce..f4409d3 100644
--- a/api/soap/mc_issue_api.php
+++ b/api/soap/mc_issue_api.php
@@ -999,6 +999,8 @@
  * @return integer The id of the added note.
  */
 function mc_issue_note_add( $p_username, $p_password, $p_issue_id, $p_note ) {
+	global $g_project_override;
+	
 	$t_user_id = mci_check_login( $p_username, $p_password );
 	if( $t_user_id === false ) {
 		return mci_soap_fault_login_failed();
@@ -1022,6 +1024,8 @@
 	if( !mci_has_readwrite_access( $t_user_id, $t_project_id ) ) {
 		return mci_soap_fault_access_denied( $t_user_id );
 	}
+	
+	$g_project_override = $t_project_id;
 
 	if( !access_has_bug_level( config_get( 'add_bugnote_threshold' ), $p_issue_id, $t_user_id ) ) {
 		return mci_soap_fault_access_denied( $t_user_id, "You do not have access rights to add notes to this issue" );