function i2b2_get_role($user_name, $project_id){
global $i2b2_pm_uri, $i2b2_domain, $i2b2_service_account_id, $i2b2_service_account_pw;
$request_xml = i2b2_header_xml($i2b2_pm_uri, $i2b2_domain, $i2b2_service_account_id, $i2b2_service_account_pw);
$request_xml .= "<pm:get_role>";
$request_xml .= " <project_id>$project_id</project_id>";
$request_xml .= " <user_name>$user_name</user_name>";
$request_xml .= "</pm:get_role>";
$request_xml .= i2b2_footer_xml();
$ch = curl_init($i2b2_pm_uri);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, "$request_xml");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
return $data;
} |