source: branches/feature-module-update/html/admin/contents/file_view.php @ 15080

Revision 15080, 739 bytes checked in by nanasess, 17 years ago (diff)

svn properties 設定

  • svn:mime-type - application/x-httpd-php; charset=UTF-8
  • svn:keywords - Id
  • Property svn:keywords set to Id
  • Property svn:mime-type set to application/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
4 *
5 * http://www.lockon.co.jp/
6 */
7
8require_once("../require.php");
9require_once(DATA_PATH . "include/file_manager.inc");
10
11// ソースとして表示するファイルを定義(直接実行しないファイル)
12$arrViewFile = array(
13                     'html',
14                     'htm',
15                     'tpl',
16                     'php',
17                     'css',
18                     'js',
19);
20
21// 拡張子取得
22$arrResult = split('\.', $_GET['file']);
23$ext = $arrResult[count($arrResult)-1];
24
25// ファイル内容表示
26if(in_array($ext, $arrViewFile)) {
27    // ファイルを読み込んで表示
28    header("Content-type: text/plain\n\n");
29    print(sfReadFile(USER_PATH.$_GET['file']));
30} else {
31    header("Location: ".USER_URL.$_GET['file']);
32}
33?>
Note: See TracBrowser for help on using the repository browser.