sub perl_header { # ディレクトリパス $LIBdir = './lib'; $TPLdir = './tpl'; $usr_dir = './usr'; require "$LIBdir/cgi-lib.pl"; require "$LIBdir/jcode.pl"; ReadParse(); print "Content-type: text/html; charset=EUC-JP\n\n"; # ユーザーホームディレクトリ $usr_home = "$usr_dir/$in{'id'}"; # ファイルパス $AdminMENU = "$TPLdir/admin_menu.html"; $TemplateFILE = "$TPLdir/template.html"; $EditformFILE = "$TPLdir/user_admin_form.html"; $mail_tpl = "$TPLdir/mail_tpl.txt"; $user_data = '.user_data'; $admin_config = 'admin_config.ini'; # Sendmailコマンド $sendmail = '/usr/sbin/sendmail'; } sub html_header{ print " $login_title "; } sub Encrypt { $crypt_mail = crypt($in{'mail'},"UK"); $crypt = crypt($in{'password'},"UK"); } sub form_id { print 'アカウント'; print ''; } sub form_pw { print ''; } sub form_mail { print 'メールアドレス'; print ''; } sub form_file { print ' '; } sub form_submit { print ''; } sub html_footer { print " "; } sub form_error { print "入力内容が間違っています。"; } sub read_error { print "不正な読み込みです。"; } sub returnMENU { print '
'; print "
"; } sub return_AdminMENU { print '
'; print "
"; } sub entry_title { @links = glob("$usr_home/*.html"); # エントリーページのタイトル foreach $link (@links){ open(IN,"$link"); while(){ @in = ; @title = grep //, @in; grep {s///} @title; } close(IN); foreach $title (@title){ $sprintf = sprintf "%.20s", $title; $length = length $sprintf; if( $length >= 20 ){ $sprintf =~ s/$/../; } chomp $sprintf; push @title2,$sprintf; } } } sub chomp { $in{'body_text'} =~ s/\r\n/
/g; $in{'body_text'} =~ s/\n/
/g; $in{'body_text'} =~ s/\r/
/g; $in{'ad_top'} =~ s/\r\n/
/g; $in{'ad_top'} =~ s/\n/
/g; $in{'ad_top'} =~ s/\r/
/g; $in{'ad_bottom'} =~ s/\r\n/
/g; $in{'ad_bottom'} =~ s/\n/
/g; $in{'ad_bottom'} =~ s/\r/
/g; } ########### # XSS対策 # ########### sub xss { $in{'id'} =~ s/&/&/g; $in{'id'} =~ s/"/"/g; $in{'id'} =~ s//>/g; $in{'password'} =~ s/&/&/g; $in{'password'} =~ s/"/"/g; $in{'password'} =~ s//>/g; $in{'meta_keyword'} =~ s/&/&/g; $in{'meta_keyword'} =~ s/"/"/g; $in{'meta_keyword'} =~ s//>/g; $in{'meta_description'} =~ s/&/&/g; $in{'meta_description'} =~ s/"/"/g; $in{'meta_description'} =~ s//>/g; $in{'bgcolor'} =~ s/&/&/g; $in{'bgcolor'} =~ s/"/"/g; $in{'bgcolor'} =~ s//>/g; $in{'textcolor'} =~ s/&/&/g; $in{'textcolor'} =~ s/"/"/g; $in{'textcolor'} =~ s//>/g; $in{'title'} =~ s/&/&/g; $in{'title'} =~ s/"/"/g; $in{'body_text'} =~ s/&/&/g; $in{'body_text'} =~ s/"/"/g; } 1;