/** * @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)); } }