Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue #15610: RemoteControl cpd_importParticipants does not bla…
…cklist participants
  • Loading branch information
mbischof authored and c-schmitz committed Nov 26, 2019
1 parent f47fee3 commit 23deb95
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions application/helpers/remotecontrol/remotecontrol_handle.php
Expand Up @@ -307,7 +307,7 @@ public function copy_survey($sSessionKey, $iSurveyID_org, $sNewname)

/**
* Get survey properties (RPC function)
*
*
* Get properties of a survey
* All internal properties of a survey are available.
* @see \Survey for the list of available properties
Expand Down Expand Up @@ -583,7 +583,7 @@ public function export_statistics($sSessionKey, $iSurveyID, $docType = 'pdf', $s

/**
* Export submission timeline (RPC function)
*
*
* Returns an array of values (count and period)
*
* @access public
Expand Down Expand Up @@ -975,7 +975,7 @@ public function set_language_properties($sSessionKey, $iSurveyID, $aSurveyLocale

/**
* Add empty page with minimum details (RPC function)
*
*
* Used as a placeholder for importing questions.
* Returns the groupid of the created page.
*
Expand Down Expand Up @@ -1021,7 +1021,7 @@ public function add_group($sSessionKey, $iSurveyID, $sGroupTitle, $sGroupDescrip

/**
* Delete a page from a chosen survey (RPC function)
*
*
* Returns the id of the deleted group.
*
* @access public
Expand Down Expand Up @@ -1155,7 +1155,7 @@ public function import_group($sSessionKey, $iSurveyID, $sImportData, $sImportDat

/**
* Find response IDs given a survey ID and a token (RPC function)
*
*
* @param string $sSessionKey
* @param int $iSurveyID
* @param string $sToken
Expand Down Expand Up @@ -1300,7 +1300,7 @@ public function set_group_properties($sSessionKey, $iGroupID, $aGroupData)

/**
* Delete question from a survey (RPC function)
*
*
* Returns the id of the deleted question.
*
* @access public
Expand Down Expand Up @@ -1364,7 +1364,7 @@ public function delete_question($sSessionKey, $iQuestionID)

/**
* Import question (RPC function)
*
*
* Import a question from lsq file
*
* @access public
Expand Down Expand Up @@ -1776,7 +1776,7 @@ public function add_participants($sSessionKey, $iSurveyID, $aParticipantData, $b

/**
* Delete multiple participants from the survey participants table (RPC function)
*
*
* Returns the id of the deleted token
*
* @access public
Expand Down Expand Up @@ -1823,7 +1823,7 @@ public function delete_participants($sSessionKey, $iSurveyID, $aTokenIDs)

/**
* Get settings of a survey participant (RPC function)
*
*
* Allow to request for a specific participant. If more than one participant is returned with specified attribute(s) an error is returned.
*
* @access public
Expand Down Expand Up @@ -1950,7 +1950,7 @@ public function set_participant_properties($sSessionKey, $iSurveyID, $aTokenQuer

/**
* Get survey pages (RPC function)
*
*
* Returns the ids and all attributes of all survey pages
*
* @access public
Expand Down Expand Up @@ -2072,7 +2072,7 @@ public function list_participants($sSessionKey, $iSurveyID, $iStart = 0, $iLimit

/**
* Return the ids and info of (sub-)questions of a survey/group (RPC function)
*
*
* Returns array of ids and info.
*
* @access public
Expand Down Expand Up @@ -2133,7 +2133,7 @@ public function list_questions($sSessionKey, $iSurveyID, $iGroupID = null, $sLan

/**
* Set quota attributes (RPC function)
*
*
* Retuns an array containing the boolean 'success' and 'message' with either errors or Quota attributes (on success)
* @access public
* @param string $sSessionKey Auth credentials
Expand Down Expand Up @@ -2283,7 +2283,7 @@ public function list_users($sSessionKey = null, $uid = null)

/**
* Activate survey participants (RPC function)
*
*
* Initialise the survey participant table of a survey where new participant tokens may be later added.
*
* @access public
Expand Down Expand Up @@ -2481,8 +2481,8 @@ public function invite_participants($sSessionKey, $iSurveyID, $aTokenIds = null,


/**
* Send a reminder to participants in a survey (RPC function)
*
* Send a reminder to participants in a survey (RPC function)
*
* Returns array of results of sending
*
* @access public
Expand Down Expand Up @@ -2556,7 +2556,7 @@ public function remind_participants($sSessionKey, $iSurveyID, $iMinDaysBetween =

/**
* Add a response to the survey responses collection.
*
*
* Returns the id of the inserted survey response
*
* @access public
Expand Down Expand Up @@ -2648,7 +2648,7 @@ public function add_response($sSessionKey, $iSurveyID, $aResponseData)

/**
* Update a response in a given survey.
*
*
* Routine supports only single response updates.
* Response to update will be identified either by the response id, or the token if response id is missing.
* Routine is only applicable for active surveys with alloweditaftercompletion = Y.
Expand Down Expand Up @@ -2729,7 +2729,7 @@ public function update_response($sSessionKey, $iSurveyID, $aResponseData)

/**
* Uploads one file to be used later.
*
*
* Returns the metadata on success.
*
* @access public
Expand Down Expand Up @@ -2896,7 +2896,7 @@ public function export_responses($sSessionKey, $iSurveyID, $sDocumentType, $sLan

/**
* Export token response in a survey.
*
*
* Returns the requested file as base64 encoded string
*
* @access public
Expand Down Expand Up @@ -2999,7 +2999,7 @@ public function get_uploaded_files($sSessionKey, $iSurveyID, $sToken)
if (!($oResponse instanceof Response)) {
return array('status' => 'Could not find response for given token');
}

foreach ($oResponse->getFiles() as $aFile) {
$sFileRealName = Yii::app()->getConfig('uploaddir')."/surveys/".$iSurveyID."/files/".$aFile['filename'];

Expand Down Expand Up @@ -3103,8 +3103,8 @@ protected function _checkSessionKey($sSessionKey)


/**
* Import a participant into the LimeSurvey CPDB
*
* Import a participant into the LimeSurvey CPDB
*
* It stores attributes as well, if they are registered before within ui
*
* Call the function with $response = $myJSONRPCClient->cpd_importParticipants( $sessionKey, $aParticipants);
Expand Down Expand Up @@ -3142,6 +3142,7 @@ public function cpd_importParticipants($sSessionKey, $aParticipants)
'lastname' => $aParticipantData['lastname'],
'email' => $aParticipantData['email'],
'owner_uid' => Yii::app()->session['loginID'], // ToDo is this working?
'blacklisted' => (isset($aParticipantData['blacklisted']) && $aParticipantData['blacklisted'] === 'Y') ? 'Y' : 'N'
);

//Check for duplicate participants
Expand Down

0 comments on commit 23deb95

Please sign in to comment.