#!/usr/bin/perl ##### Yet Another Dice Chat ##### ### $Id: index.cgi,v 1.2 2007/05/06 03:27:40 jyugoya Exp $ ### YADChat / 2007 © 結城由羅@世界忍者国 / BSD Lisence ### mihanaさんに連絡がつかないのでコードをrewrite中。 ##### 設定ファイル読み込み ##### require 'config.cgi'; ##### ライブラリ読み込み ##### require 'yadchatlib.pl'; ######################## ##### メイン処理部 ##### ######################## ##### CGIパッケージ ##### use CGI qw/:standard/; ##### グローバル変数 ##### # CGI オブジェクト $query = new CGI; # パラメータ取得 $IN{'mode'} = $query->param('mode'); $IN{'name'} = $query->param('name'); $IN{'comment'} = $query->param('comment'); $IN{'del'} = $query->param('del'); $IN{'close'} = $query->param('close'); $IN{'pass'} = $query->param('pass'); ##### HTML文書表示 ##### # ヘッダー print $query->header(-charset => $CONF{'charset'}); print $query->start_html(-lang => $CONF{'lang'}, -encoding => $CONF{'charset'}, -head => meta({-http_equiv => 'Content-Type', -content => 'text/html; charset=' . $CONF{'charset'}}), -title=>$CONF{'title'}, -style=>{-src=>$CONF{'indexstyle'}}); # ガイド print<ホーム | ルーム一覧
EOM # タイトル print $query->h1($CONF{'title'}); print "\n"; # デバッグ if ($DEBUG) { &printDebug(); } # 処理分岐 if ($IN{'name'} && $IN{'comment'} && $IN{'pass'}) { if ($DEBUG) { print "

create New Room ...\n"; } &createNewRoom($IN{'name'}, $IN{'comment'}); } elsif ($IN{'del'} && $IN{'pass'} eq $CONF{'pass'}) { if ($DEBUG) { print "

delete a Room ...\n"; } &deleteRoom($IN{'del'}); } elsif ($IN{'close'}) { if ($DEBUG) { print "

close a Room ...\n"; } &closeRoom($IN{'pass'}, $IN{'close'}); } if ($DEBUG) { print "done

\n"; } # 注意書き &printNotice(); # 表示分岐 if (!$IN{'mode'}) { &printRoomList(); } elsif ($IN{'mode'} eq "make") { &printMakeRoom(); } elsif ($IN{'mode'} eq "log") { &printLogList(); } elsif ($IN{'mode'} eq "admin"){ &printAdminMenu(); } print< EOM # フッター print &genCopyright(); # 表示終了 print $query->end_html; ### End of index.cgi