#! /usr/bin/perl # # crpedit.cgi # Edit a text or html on a browser and save with encription. # No one can read the text without the key to decript. # # 1.002 : 2/6/07 : タイトルの空白を禁止するように修正 # 1.001 : 7/9/06 : IEでPOSTから来るテキストデータを正しく表示するよう修正 # 1.0 : 12/12/05 : Created # # $Id: crpedit.cgi,v 1.6 2007/02/06 03:14:34 Hideki Kanayama Exp $ use strict; use CGI qw(:cgi-lib); use CGI::Carp qw(fatalsToBrowser); use File::Basename; use Crypt::CBC; my $version = "1.002"; my $lastupdatedyear = "2007"; my $admindat = "adminpwd.dat"; my $setupfile = "crpedit_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/crpedit.dat"; # datafile our $basefile = "cryp.doc"; # lockfile our $lockfile = "lockfile.dat"; # Title our $pagetitle = ('クリプト編集','Crypt Edit')[$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 = 'Key'; 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 "