OSDN Git Service

Basic認証関連のコードをfunc.phpからauth.phpに移動
[pukiwiki/pukiwiki.git] / pukiwiki.php
1 <?php
2 // pukiwiki.php - Yet another WikiWikiWeb clone.
3 //
4 // PukiWiki 1.4.* 
5 //  Copyright (C) 2002 by PukiWiki Developers Team
6 //  http://pukiwiki.org/
7 //
8 // PukiWiki 1.3.* 
9 //  Copyright (C) 2002 by PukiWiki Developers Team
10 //  http://pukiwiki.org/
11 //
12 // PukiWiki 1.3 (Base)
13 //  Copyright (C) 2001,2002 by sng.
14 //  <sng@factage.com>
15 //  http://factage.com/sng/pukiwiki/
16 //
17 // Special thanks
18 //  YukiWiki by Hiroshi Yuki
19 //  <hyuki@hyuki.com>
20 //  http://www.hyuki.com/yukiwiki/
21 //
22 // This program is free software; you can redistribute it and/or modify
23 // it under the terms of the GNU General Public License as published by
24 // the Free Software Foundation; either version 2 of the License, or
25 // (at your option) any later version.
26 //
27 // This program is distributed in the hope that it will be useful,
28 // but WITHOUT ANY WARRANTY; without even the implied warranty of
29 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 // GNU General Public License for more details.
31 //
32 // $Id: pukiwiki.php,v 1.27 2003/07/14 03:56:32 arino Exp $
33 /////////////////////////////////////////////////
34
35
36 /////////////////////////////////////////////////
37 // ¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß
38 require('func.php');
39 require('file.php');
40 require('plugin.php');
41 require('html.php');
42 require('backup.php');
43
44 require('convert_html.php');
45 require('make_link.php');
46 require('diff.php');
47 require('config.php');
48 require('link.php');
49 require('trackback.php');
50 require('auth.php');
51 //require('mbstring.php');
52
53 /////////////////////////////////////////////////
54 // ¥×¥í¥°¥é¥à¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß
55 require('init.php');
56
57 /////////////////////////////////////////////////
58 // ¥á¥¤¥ó½èÍý
59
60 $base = $defaultpage;
61 $retvars = array();
62
63 // Plug-in action
64 if (!empty($vars['plugin'])) {
65         if (!exist_plugin_action($vars['plugin'])) {
66                 $s_plugin = htmlspecialchars($vars['plugin']);
67                 $msg = "plugin=$s_plugin is not implemented.";
68                 $retvars = array('msg'=>$msg,'body'=>$msg);
69         }
70         else {
71                 $retvars = do_plugin_action($vars['plugin']);
72                 if ($retvars !== FALSE) {
73                         $base = array_key_exists('refer',$vars) ? $vars['refer'] : '';
74                 }
75         }
76 }
77 // Command action
78 else if (!empty($vars['cmd'])) {
79         if (!exist_plugin_action($vars['cmd'])) {
80                 $s_cmd = htmlspecialchars($vars['cmd']);
81                 $msg = "cmd=$s_cmd is not implemented.";
82                 $retvars = array('msg'=>$msg,'body'=>$msg);
83         }
84         else {
85                 $retvars = do_plugin_action($vars['cmd']);
86                 $base = $vars['page'];
87         }
88 }
89
90 if ($retvars !== FALSE) {
91         $title = htmlspecialchars(strip_bracket($base));
92         $page = make_search($base);
93         
94         if (array_key_exists('msg',$retvars) and $retvars['msg'] != '') {
95                 $title = str_replace('$1',$title,$retvars['msg']);
96                 $page = str_replace('$1',$page,$retvars['msg']);
97         }
98         
99         if (array_key_exists('body',$retvars) and $retvars['body'] != '') {
100                 $body = $retvars['body'];
101         }
102         else {
103                 if ($base == '' or !is_page($base)) {
104                         $base = $defaultpage;
105                         $title = htmlspecialchars(strip_bracket($base));
106                         $page = make_search($base);
107                 }
108                 
109                 $vars['cmd'] = 'read';
110                 $vars['page'] = $base;
111                 $body = convert_html(get_source($base));
112                 $body .= tb_PutID($vars['page']);
113                 ref_save($vars['page']);
114         }
115         
116         // ** ½ÐÎϽèÍý **
117         catbody($title,$page,$body);
118 }
119 // ** ½ªÎ» **
120 ?>