コード例 #1
0
ファイル: index.php プロジェクト: vojtajina/sitellite
}
$res = db_shift('select name from sitellite_filesystem
	where
		path = ? and
		name = ? and
		extension = ? and
		' . $acl, $info['dirname'], $info['basename'], $info['extension']);
if (!$res) {
    header('Location: ' . site_prefix() . '/index');
    exit;
}
if ($parameters['rid']) {
    // retrieve a specific revision (only if current file's permissions pass though)
    loader_import('cms.Versioning.Rex');
    $r = new Rex('sitellite_filesystem');
    $revision = $r->getRevision($parameters['file'], $parameters['rid'], true);
    header('Cache-control: private');
    header('Content-Type: ' . str_replace('|[,;].*$|i', '', mime($parameters['file'])));
    header('Content-Disposition: inline; filename="' . basename($parameters['file']) . '"');
    header('Content-Length: ' . $revision->filesize);
    echo $revision->body;
    exit;
}
set_time_limit(0);
if (isset($_SERVER['HTTP_RANGE'])) {
    $size = filesize('inc/data/' . $parameters['file']);
    if (preg_match('/^bytes=(\\d+)-(\\d*)$/', $_SERVER['HTTP_RANGE'], $matches)) {
        $from = $matches[1];
        $to = $matches[2];
        if (empty($to)) {
            $to = $size - 1;
コード例 #2
0
ファイル: index.php プロジェクト: vojtajina/sitellite
<?php

loader_import('cms.Versioning.Rex');
loader_import('saf.Date');
$rex = new Rex($parameters['_collection']);
// default: database, database
if (!$rex->collection) {
    header('Location: ' . $_SERVER['HTTP_REFERER']);
    exit;
}
$revision = $rex->getRevision($parameters['_key'], $parameters['_rid'], true);
if (!$revision) {
    header('Location: ' . $_SERVER['HTTP_REFERER']);
    exit;
}
$current = $rex->getRevision($parameters['_key'], $parameters['_current'], true);
if (!$current) {
    header('Location: ' . $_SERVER['HTTP_REFERER']);
    exit;
}
$info = array('r_autoid' => $revision->sv_autoid, 'r_author' => $revision->sv_author, 'r_action' => $revision->sv_action, 'r_revision' => Date::timestamp($revision->sv_revision, 'F j, Y - g:ia'), 'r_changelog' => $revision->sv_changelog, 'r_current' => $revision->sv_current, 'r_deleted' => $revision->sv_deleted);
unset($revision->sv_autoid);
unset($revision->sv_author);
unset($revision->sv_action);
unset($revision->sv_revision);
unset($revision->sv_changelog);
unset($revision->sv_current);
unset($revision->sv_deleted);
$cinfo = array('c_autoid' => $current->sv_autoid, 'c_author' => $current->sv_author, 'c_action' => $current->sv_action, 'c_revision' => Date::timestamp($current->sv_revision, 'F j, Y - g:ia'), 'c_changelog' => $current->sv_changelog, 'c_current' => $current->sv_current, 'c_deleted' => $current->sv_deleted);
unset($current->sv_autoid);
unset($current->sv_author);
コード例 #3
0
ファイル: index.php プロジェクト: vojtajina/sitellite
<?php

global $cgi;
loader_import('cms.Versioning.Rex');
loader_import('saf.Date');
$rex = new Rex($cgi->_collection);
if (!$rex->collection) {
    header('Location: ' . $_SERVER['HTTP_REFERER']);
    exit;
}
$revision = $rex->getRevision($cgi->_key, $cgi->_rid, true);
if (!$revision) {
    header('Location: ' . $_SERVER['HTTP_REFERER']);
    exit;
}
$info = array('sv_autoid' => $revision->sv_autoid, 'sv_author' => $revision->sv_author, 'sv_action' => $revision->sv_action, 'sv_revision' => Date::timestamp($revision->sv_revision, 'F j, Y - g:ia'), 'sv_changelog' => $revision->sv_changelog, 'sv_current' => $revision->sv_current, 'sv_deleted' => $revision->sv_deleted);
unset($revision->sv_autoid);
unset($revision->sv_author);
unset($revision->sv_action);
unset($revision->sv_revision);
unset($revision->sv_changelog);
unset($revision->sv_current);
unset($revision->sv_deleted);
$GLOBALS['cms_history_view_colnames'] = array();
global $cms_history_view_colnames;
foreach ($rex->info as $k => $v) {
    if (strpos($k, 'hint:') === 0) {
        if (isset($v['alt'])) {
            $cms_history_view_colnames[str_replace('hint:', '', $k)] = intl_get($v['alt']);
        }
    }