/**
 * Get the project attachment with the specified id.
 *
 * @param string $p_username  The name of the user trying to access the filters.
 * @param string $p_password  The password of the user.
 * @param integer $p_attachment_id  The id of the attachment to be retrieved.
 * @return Base64 encoded data that represents the attachment.
 */
function mc_project_attachment_get($p_username, $p_password, $p_project_attachment_id)
{
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return new soap_fault('Client', '', 'Access Denied');
    }
    return mci_file_get($p_project_attachment_id, 'doc', $t_user_id);
}
Exemplo n.º 2
0
/**
 * Get the issue attachment with the specified id.
 *
 * @param string $p_username  The name of the user trying to access the filters.
 * @param string $p_password  The password of the user.
 * @param integer $p_attachment_id  The id of the attachment to be retrieved.
 * @return Base64 encoded data that represents the attachment.
 */
function mc_issue_attachment_get($p_username, $p_password, $p_issue_attachment_id)
{
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return mci_soap_fault_login_failed();
    }
    $t_file = mci_file_get($p_issue_attachment_id, 'bug', $t_user_id);
    if (SoapObjectsFactory::isSoapFault($t_file)) {
        return $t_file;
    }
    return SoapObjectsFactory::encodeBinary($t_file);
}
/**
 * Get the issue attachment with the specified id.
 *
 * @param string $p_username  The name of the user trying to access the filters.
 * @param string $p_password  The password of the user.
 * @param integer $p_attachment_id  The id of the attachment to be retrieved.
 * @return Base64 encoded data that represents the attachment.
 */
function mc_issue_attachment_get($p_username, $p_password, $p_issue_attachment_id)
{
    $t_user_id = mci_check_login($p_username, $p_password);
    if ($t_user_id === false) {
        return mci_soap_fault_login_failed();
    }
    $t_file = mci_file_get($p_issue_attachment_id, 'bug', $t_user_id);
    if (get_class((object) $t_file) == 'soap_fault') {
        return $t_file;
    }
    return base64_encode($t_file);
}