source: branches/rel/html/admin/contents/file_view.php @ 12157

Revision 12157, 686 bytes checked in by uehara, 17 years ago (diff)
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.