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


PHP FileData::setId方法代码示例

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


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

示例1: isset

// check for session and $id
session_start();
include_once 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (!isset($id) || $id == '') {
    header('Location:error.php?ec=2');
    exit;
}
// includes
// in case file is accessed directly
// verify again that user has view rights
$filedata = new FileData($id, $pdo);
$filedata->setId($id);
if ($filedata->getError() != '') {
    header('Location:error.php?ec=2');
    ob_end_flush();
    // Flush buffer onto screens
    ob_end_clean();
    // Clean up buffer
    exit;
} else {
    // all checks completed
    /* to avoid problems with some browsers,
          download script should not include parameters on the URL
          so let's use a form and pass the parameters via POST
       */
    // form not yet submitted
    // display information on how to initiate download
开发者ID:chaitanyar1,项目名称:opendocman,代码行数:31,代码来源:view.php

示例2: callPluginMethod

        $GLOBALS['smarty']->assign('comment', $comment);
        $GLOBALS['smarty']->assign('db_prefix', $GLOBALS['CONFIG']['db_prefix']);
        display_smarty_template('edit.tpl');
        udf_edit_file_form();
        // Call Plugin API
        callPluginMethod('onBeforeEditFile', $data_id);
        display_smarty_template('_edit_footer.tpl');
    }
    //end else
} else {
    // form submitted, process data
    $fileId = $_REQUEST['id'];
    $filedata = new FileData($fileId, $pdo);
    // Call the plugin API
    callPluginMethod('onBeforeEditFileSaved');
    $filedata->setId($fileId);
    $perms_error = false;
    // check submitted data
    // at least one user must have "view" and "modify" rights
    foreach ($_REQUEST['user_permission'] as $permission) {
        if ($permission > 2) {
            $perms_error = true;
        }
    }
    if (!$perms_error) {
        header("Location:error.php?ec=12");
        exit;
    }
    // Check to make sure the file is available
    $status = $filedata->getStatus($fileId);
    if ($status != 0) {
开发者ID:watsonad,项目名称:opendocman,代码行数:31,代码来源:edit.php

示例3: isset

}
require_once "AccessLog_class.php";
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (strchr($_REQUEST['id'], '_')) {
    header('Location:error.php?ec=20');
}
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
    header('Location:error.php?ec=2');
    exit;
}
/* if the user has read-only authority on the file, his check out 
will be the same as the person with admin or modify right except that the DB will not have any recored of him checking out this file.  Therefore, he will not be able to check-in the file on
the server
*/
$fileobj = new FileData($_GET['id'], $GLOBALS['connection'], DB_NAME);
$fileobj->setId($_GET['id']);
if ($fileobj->getError() != NULL || $fileobj->getStatus() > 0 || $fileobj->isArchived()) {
    header('Location:error.php?ec=2');
    exit;
}
if (!isset($_GET['submit'])) {
    draw_header(msg('area_check_out_file'), $last_message);
    // form not yet submitted
    // display information on how to initiate download
    checkUserPermission($_REQUEST['id'], $fileobj->WRITE_RIGHT, $fileobj);
    ?>


<p>

<form action="<?php 
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:31,代码来源:check-out.php

示例4: isset

}
require_once "AccessLog_class.php";
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (strchr($_REQUEST['id'], '_')) {
    header('Location:error.php?ec=20');
}
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
    header('Location:error.php?ec=2');
    exit;
}
/* if the user has read-only authority on the file, his check out 
will be the same as the person with admin or modify right except that the DB will not have any recored of him checking out this file.  Therefore, he will not be able to check-in the file on
the server
*/
$file_data_obj = new FileData($_GET['id'], $pdo);
$file_data_obj->setId($_GET['id']);
if ($file_data_obj->getError() != NULL || $file_data_obj->getStatus() > 0 || $file_data_obj->isArchived()) {
    header('Location:error.php?ec=2');
    exit;
}
if (!isset($_GET['submit'])) {
    draw_header(msg('area_check_out_file'), $last_message);
    // form not yet submitted
    // display information on how to initiate download
    checkUserPermission($_REQUEST['id'], $file_data_obj->WRITE_RIGHT, $file_data_obj);
    ?>


<p>

<form action="<?php 
开发者ID:scdogan,项目名称:opendocman,代码行数:31,代码来源:check-out.php


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