/** * @param int $prj_id * @return struct * @access protected */ public function getDeveloperList($prj_id) { $res = Project::getRemoteAssocList(); if (empty($res)) { throw new RemoteApiException('There are currently no projects setup for remote invocation'); } // check if this project allows remote invocation if (!in_array($prj_id, array_keys($res))) { throw new RemoteApiException('This project does not allow remote invocation'); } $res = Project::getAddressBookAssocList($prj_id); if (empty($res)) { throw new RemoteApiException('There are currently no users associated with the given project'); } return $res; }
function getDeveloperList($p) { $email = XML_RPC_decode($p->getParam(0)); $password = XML_RPC_decode($p->getParam(1)); $auth = authenticate($email, $password); if (is_object($auth)) { return $auth; } $prj_id = XML_RPC_decode($p->getParam(2)); $res = Project::getRemoteAssocList(); if (empty($res)) { return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "There are currently no projects setup for remote invocation"); } // check if this project allows remote invocation if (!in_array($prj_id, array_keys($res))) { return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "This project does not allow remote invocation"); } $res = Project::getAddressBookAssocList($prj_id); if (empty($res)) { return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "There are currently no users associated with the given project"); } else { return new XML_RPC_Response(XML_RPC_Encode($res)); } }
/** * Method used to get a list of names and emails that are * associated with a given project and issue. * * @access public * @param integer $prj_id The project ID * @param integer $issue_id The issue ID * @return array List of names and emails */ function getAddressBook($prj_id, $issue_id = FALSE) { static $returns; $key = serialize(array($prj_id, $issue_id)); if (!empty($returns[$key])) { return $returns[$key]; } $res = Project::getAddressBookAssocList($prj_id, $issue_id); if (empty($res)) { return ""; } else { $temp = array(); foreach ($res as $name => $email) { $temp["{$name} <{$email}>"] = $name; } $returns[$key] = $temp; return $temp; } }