#!/usr/local/bin/perl ############################################################################### # Copyright (C) 2000 T.Kimata # http://www.nk.rim.or.jp/~t_kimata/cgi/ # # All rights reserved. # # This software is provided 'as-is', without any express or implied warranty. # In no event will the authors be held liable for any damages arising from the # use of this software. # # Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: # # 1. The origin of this software must not be misrepresented; you must not claim # that you wrote the original software. If you use this software in a product, # an acknowledgment in the product documentation would be appreciated but is # not required. # # 2. Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. # # 3. This notice may not be removed or altered from any source distribution. ############################################################################### # (SS)C-BOARD v3.8 by N.Hirai / atman@skullysoft.com # #   Sorry, these softwares are prepared for Japanese residents only. #   And it is constituted only in Japanese. # # C-BOARDのオリジナルはt_Kimata氏が開発されました、 # 当バージョンはスカリーソフト( http://www.skullysoft.com/ )により、 # 不具合の修正等を行った改造版です。 # 当バージョンのライセンスはオリジナルに準拠します。 # オリジナルのライセンスは冒頭の通りです。 # 著作権はオリジナルソース部分が T.Kimata 氏、改造部分は改造者(複数)にありま # す。 # ############################################################################### # # 「トクトク」等、ヘッダーをフィルタリングするサーバーの場合はコメントアウト # (この場合、処理の都合上キャッシュ等の機能が使えなくなります) # $::SYS{'liar'} = 1; #─────────────────────────────────────── # # カレントディレクトリの移動(IIS, mod_perl用) # BEGIN { # chdir 'c:/www/develop/c-board/c-board'; # } #─────────────────────────────────────── #── 初期化 require './cmd/sub.pl'; &SUBMAIN::init; #── アクセス権チェック if ($CNF::permission{'bse'}{'mode'}) { require './cmd/prm.pl'; &PERMISSION::check('bse'); } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃■コマンド解釈 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ require './cmd/sub.pl'; &SUBMAIN::cmd; exit; #━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ package main; #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ 下準備 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BEGIN { require './lib/cmn.pl'; require './lib/cgi.pl'; } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ 後始末 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ END { map(&::unlock($_), keys %{$::FLAG{'lock'}}); } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ オートローダー #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ sub AUTOLOAD { $::FLAG{'autoload'}++ && exit; # 無限ループ防止 eval <<'__SUB__'; #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ ロック #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ sub lock { my $mode = shift; require './cmd/sub.pl'; return(&SUBMAIN::lock($mode)); } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ ロック解除 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ sub unlock { my $mode = shift; require './cmd/sub.pl'; &SUBMAIN::unlock($mode); } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ POSTデータ読み込み #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ sub read_post_request { require './cmd/sub.pl'; &SUBMAIN::read_post_request; } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ デバッグ用情報を記録 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ sub debug { my $name = shift; my $r_value = shift; require './cmd/sub.pl'; &SUBMAIN::debug($name, $r_value); } #┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ #┃ エラー表示 #┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ sub error { my $r_error = shift; require './cmd/sub.pl'; &SUBMAIN::error($r_error); } __SUB__ length($@) && die $@; my $name = ($AUTOLOAD =~ /^main::(.+)$/)[0]; if (!defined &{$name}) { &::error(\"定義されていない関数($AUTOLOAD)が呼ばれました。"); exit; } goto &{'main::' . $name}; } # $Id: c-board.cgi,v 2.4 2004/07/30 09:00:00 N.Hirai Exp $;