By WebOsPublisher
#!/usr/local/bin/perl
## G-LIGHT : admin.cgi ( 2003/10/13 )
## Copyright (c) KentWeb
##
webmaster@kent-web.com ## kent-web.com/
#------------#
# ЉЗ—ќ‰ж–К #
#------------#
sub admin {
if ($in{'pass'} eq "") { &enter; }
elsif ($in{'pass'} ne $pass) { &error("ѓpѓXѓЏЃ[ѓh‚Є€б‚ў‚Ь‚·"); }
# ЌнЏњ
if ($in{'job'} eq "dele" && $in{'no'}) {
# ѓЌѓbѓNЉJЋn
&lock if ($lockkey);
@data=();
open(IN,"$logfile") || &error("Open Error: $logfile");
while () {
($no) = split(//);
$f=0;
foreach $del ( split(/\0/, $in{'no'}) ) {
if ($no == $del) { $f++; last; }
}
if (!$f) { push(@data,$_); }
}
close(IN);
# ЌXђV
open(OUT,") {
@f = split(//);
last if ($in{'no'} == $f[0]);
}
close(IN);
&edit_form(@f);
# ЏCђіЋАЌs
} elsif ($in{'job'} eq "edit2") {
# ѓЌѓbѓNЉJЋn
&lock if ($lockkey);
@data=();
open(IN,"$logfile") || &error("Open Error: $logfile");
while () {
($no,$dat,$nam,$eml,$area,$ico,$icom,
$com,$res,$url,$hos,$pw,$sub,$tim) = split(//);
if ($in{'no'} == $no) {
$_ = "$no$dat$in{'name'}$in{'email'}$in{'area'}$in{'icon'}$in{'icom'}$in{'comment'}$in{'comment2'}$in{'url'}$hos$pw$in{'sub'}$tim\n";
}
push(@data,$_);
}
close(IN);
# ЌXђV
open(OUT,"
Џ€—ќ‚р‘I‘р‚µ‚Д‘—ђMѓ{ѓ^ѓ“‚р‰џ‚µ‚Д‚‚ѕ‚і‚ўЃB
Џ€—ќЃF
ЏCђі/ѓЊѓX
‹LЋ–ЌнЏњ
EOM
# ѓЌѓO“WЉJ
open(IN,"$logfile") || &error("Open Error: $logfile");
while () {
($no,$dat,$nam,$eml,$area,$ico,$icom,
$com,$res,$url,$hos,$pw,$sub,$tim) = split(//);
$sub ||= '–і‘и';
$com =~ s///g;
if (length($com) //g;
if (length($res)
$sub - $nam $dat[–{•¶] $com\n";
if ($res) { print "[•ФђM] $res\n"; }
}
close(IN);
print
EOM
exit;
}
#------------#
# ЏCђі‰ж–К #
#------------#
sub edit_form {
local(@f) = @_;
# ѓAѓCѓRѓ“’и‹`
@ico1 = split(/\s+/, $ico1);
@ico2 = split(/\s+/, $ico2);
@ico3 = split(/\s+/, $ico3);
&header;
print
•ПЌX‚·‚й•”•Є‚М‚ЭЏCђі‚µ‚Д‘—ђMѓ{ѓ^ѓ“‚р‰џ‚µ‚Д‚‚ѕ‚і‚ўЃB
EOM
&form(@f);
print
EOM
exit;
}
#------------#
# “ьЋє‰ж–К #
#------------#
sub enter {
&header;
print
ѓpѓXѓЏЃ[ѓh‚р“ь—Н‚µ‚Д‚‚ѕ‚і‚ў
EOM
exit;
}
1;
__END__