当前位置: 首页>>代码示例>>PHP>>正文


PHP Attachment::getDetails方法代码示例

本文整理汇总了PHP中Attachment::getDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachment::getDetails方法的具体用法?PHP Attachment::getDetails怎么用?PHP Attachment::getDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Attachment的用法示例。


在下文中一共展示了Attachment::getDetails方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFile

 /**
  * @param int $file_id
  * @return struct
  * @access protected
  */
 public function getFile($file_id)
 {
     $res = Attachment::getDetails($file_id);
     if (empty($res)) {
         throw new RemoteApiException('The requested file could not be found');
     }
     return $res;
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:13,代码来源:RemoteApi.php

示例2: buildFullHeaders

 /**
  * Method used to build the headers of a web-based message.
  *
  * @param   integer $issue_id The issue ID
  * @param   string $message_id The message-id
  * @param   string $from The sender of this message
  * @param   string $to The primary recipient of this message
  * @param   string $cc The extra recipients of this message
  * @param   string $body The message body
  * @param   string $in_reply_to The message-id that we are replying to
  * @param   array $iaf_ids Array with attachment file id-s
  * @return  string The full email
  */
 public static function buildFullHeaders($issue_id, $message_id, $from, $to, $cc, $subject, $body, $in_reply_to, $iaf_ids = null)
 {
     // hack needed to get the full headers of this web-based email
     $mail = new Mail_Helper();
     $mail->setTextBody($body);
     // FIXME: $body unused, but does mime->get() have side effects?
     $body = $mail->mime->get(array('text_charset' => APP_CHARSET, 'head_charset' => APP_CHARSET, 'text_encoding' => APP_EMAIL_ENCODING));
     if (!empty($issue_id)) {
         $mail->setHeaders(array('Message-Id' => $message_id));
     } else {
         $issue_id = 0;
     }
     // if there is no existing in-reply-to header, get the root message for the issue
     if ($in_reply_to == false && !empty($issue_id)) {
         $in_reply_to = Issue::getRootMessageID($issue_id);
     }
     if ($in_reply_to) {
         $mail->setHeaders(array('In-Reply-To' => $in_reply_to));
     }
     if ($iaf_ids) {
         foreach ($iaf_ids as $iaf_id) {
             $attachment = Attachment::getDetails($iaf_id);
             $mail->addAttachment($attachment['iaf_filename'], $attachment['iaf_file'], $attachment['iaf_filetype']);
         }
     }
     $cc = trim($cc);
     if (!empty($cc)) {
         $cc = str_replace(',', ';', $cc);
         $ccs = explode(';', $cc);
         foreach ($ccs as $address) {
             if (!empty($address)) {
                 $mail->addCc($address);
             }
         }
     }
     return $mail->getFullHeaders($from, $to, $subject);
 }
开发者ID:korusdipl,项目名称:eventum,代码行数:50,代码来源:class.support.php

示例3: header

// | 59 Temple Place - Suite 330                                          |
// | Boston, MA 02111-1307, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com>                             |
// +----------------------------------------------------------------------+
//
// @(#) $Id: s.download.php 1.14 04/01/26 20:37:04-06:00 joao@kickass. $
//
include_once "config.inc.php";
include_once APP_INC_PATH . "class.auth.php";
include_once APP_INC_PATH . "class.attachment.php";
include_once APP_INC_PATH . "db_access.php";
Auth::checkAuthentication(APP_COOKIE);
if (stristr(APP_BASE_URL, 'https:')) {
    // fix for IE 5.5/6 with SSL sites
    header('Pragma: cache');
}
// fix for IE6 (KB812935)
header('Cache-Control: must-revalidate');
if ($HTTP_GET_VARS['cat'] == 'attachment') {
    $file = Attachment::getDetails($HTTP_GET_VARS["id"]);
    if (!empty($file)) {
        if (!Issue::canAccess($file['iat_iss_id'], Auth::getUserID())) {
            $tpl = new Template_API();
            $tpl->setTemplate("permission_denied.tpl.html");
            $tpl->displayTemplate();
            exit;
        }
        Attachment::outputDownload($file['iaf_file'], $file["iaf_filename"], $file['iaf_filesize'], $file['iaf_filetype']);
    }
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:31,代码来源:download.php

示例4: getFile

function getFile($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;
    }
    $file_id = XML_RPC_decode($p->getParam(2));
    $res = Attachment::getDetails($file_id);
    if (empty($res)) {
        return new XML_RPC_Response(0, $XML_RPC_erruser + 1, "The requested file could not be found");
    } else {
        $res['iaf_file'] = base64_encode($res['iaf_file']);
        return new XML_RPC_Response(XML_RPC_Encode($res));
    }
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:17,代码来源:xmlrpc.php

示例5: dirname

// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <jpm@mysql.com>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
if (stristr(APP_BASE_URL, 'https:')) {
    // fix for IE 5.5/6 with SSL sites
    header('Pragma: cache');
}
// fix for IE6 (KB812935)
header('Cache-Control: must-revalidate');
if ($_GET['cat'] == 'attachment') {
    $file = Attachment::getDetails($_GET['id']);
    if (!empty($file)) {
        if (!Issue::canAccess($file['iat_iss_id'], Auth::getUserID())) {
            $tpl = new Template_Helper();
            $tpl->setTemplate('permission_denied.tpl.html');
            $tpl->displayTemplate();
            exit;
        }
        $force_inline = filter_input(INPUT_GET, 'force_inline');
        Attachment::outputDownload($file['iaf_file'], $file['iaf_filename'], $file['iaf_filesize'], $file['iaf_filetype'], $force_inline);
    }
}
开发者ID:korusdipl,项目名称:eventum,代码行数:31,代码来源:download.php


注:本文中的Attachment::getDetails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。