#! c:/perl/bin/perl # # pmemo.cgi # Post personal memo. # To browse the posted text, you need to enter password. # # 1.002 : 9/16/06 : タイトルがブランク時の処理を修正 # 1.001 : 7/9/06 : IEでPOSTから来るテキストデータを正しく表示するよう修正 # 1.0 : 7/8/06 : Created # # $Id: pmemo.cgi,v 1.3 2006/09/16 02:41:19 Hideki Kanayama Exp $ # Copyright(c) 2006, Hideki Kanayama, All Rights Reserved. use strict; use CGI qw(:cgi-lib); use CGI::Carp qw(fatalsToBrowser); use File::Basename; my $version = "1.002"; my $lastupdatedyear = "2006"; my $admindat = "adminpwd.dat"; my $setupfile = "pmemo_setup.pl"; my $script = basename($0); # English:1, Japanese:0 my $lang = 0; my $charset = ("Shift_JIS","ISO-8859-1")[$lang]; #######################3 # datadir our $datadir = "."; # datafile our $datafile = "$datadir/pmemo.dat"; # datafile our $basefile = "memo.doc"; # lockfile our $lockfile = "lockfile.dat"; # Title our $pagetitle = ('パーソナルメモ','Personal Memo')[$lang]; # Background our $bgimage_en = 0; our $bgimage_file = ''; our $bgcolor = "#ffffff"; # Back link our $backlink_en = 1; our $backlink = '..'; our $backlink_name = ('戻る','Back')[$lang]; # Body width our $body_width = '100'; # table layout our $number_en = 0; our $head_bgcolor = 'white'; our $title_head = 'Title'; our $title_width = 60; our $title_color = 'black'; our $date_head = 'Date'; our $date_width = 5; our $key_head = 'Password'; our $key_width = 5; our $option_width = 5; our $button_width = 5; our $button_name = 'Action'; # Admin link our $setup_en = 1; our $setup_name = ('管理用','Admin setup')[$lang]; # Admin only mode our $adminonly_en = 1; # body insertion our $body_insert1_en = 1; our $body_insert1 = "
"; our $body_insert2_en = 0; our $body_insert2 = ' '; our $body_insert3_en = 0; our $body_insert3 = ' '; # Style Sheet our $style_sheet_en = 0; our $style_sheet = ' '; # Head insert our $head_insert_en = 0; our $head_insert = ' '; # Time 1:localtime, 0:offset from GMT our $localtime_en = 1; our $offset_from_gmt = 9; #######################3 require "$setupfile" if (-e "$setupfile"); my $q = CGI->new; my $cgierror = $q->cgi_error; &error($cgierror) if ($cgierror); my %in = $q->Vars; if (! -e "$admindat"){ if ($in{mode} ne 'wradminpwd'){ &setadminpwd; } else { &wradminpwd($in{pwd}); } } if ($in{mode} eq 'crwrite'){ &crwrite; } elsif ($in{mode} eq 'action'){ &action; } elsif ($in{mode} eq 'deldoc2'){ &deldoc2; } elsif ($in{mode} eq 'setup'){ &setup; } elsif ($in{mode} eq 'wrsetup'){ &wrsetup; } else { &display; } sub display { &htmlhead($pagetitle); print "$body_insert1\n" if ($body_insert1_en); print "