version 1.87, 2002/08/09 10:05:00
|
version 1.90, 2002/08/13 00:37:18
|
Line 952 sub make_new_child {
|
Line 952 sub make_new_child {
|
my ($cmd,$fname)=split(/:/,$userinput); |
my ($cmd,$fname)=split(/:/,$userinput); |
my ($udom,$uname,$ufile)=split(/\//,$fname); |
my ($udom,$uname,$ufile)=split(/\//,$fname); |
my $udir=propath($udom,$uname).'/userfiles'; |
my $udir=propath($udom,$uname).'/userfiles'; |
unless (-e $udir) { mkdir($udir); } |
unless (-e $udir) { mkdir($udir,0770); } |
if (-e $udir) { |
if (-e $udir) { |
$ufile=~s/^[\.\~]+//; |
$ufile=~s/^[\.\~]+//; |
$ufile=~s/\///g; |
$ufile=~s/\///g; |
Line 1214 sub make_new_child {
|
Line 1214 sub make_new_child {
|
my $proname=propath($udom,$uname); |
my $proname=propath($udom,$uname); |
my $qresult=''; |
my $qresult=''; |
if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) { |
if (tie(%hash,'GDBM_File',"$proname/$namespace.db",&GDBM_READER,0640)) { |
|
study($regexp); |
foreach $key (keys %hash) { |
foreach $key (keys %hash) { |
if (eval('$key=~/$regexp/')) { |
my $unescapeKey = &unescape($key); |
|
if (eval('$unescapeKey=~/$regexp/')) { |
$qresult.="$key=$hash{$key}&"; |
$qresult.="$key=$hash{$key}&"; |
} |
} |
} |
} |
if (untie(%hash)) { |
if (untie(%hash)) { |
$qresult=~s/\&$//; |
$qresult=~s/\&$//; |
Line 1573 sub getchat {
|
Line 1575 sub getchat {
|
my %hash; |
my %hash; |
my $proname=&propath($cdom,$cname); |
my $proname=&propath($cdom,$cname); |
my @entries=(); |
my @entries=(); |
if |
if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db", |
(tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",&GDBM_READER(),0640)) |
&GDBM_READER(),0640)) { |
{ |
@entries=map { $_.':'.$hash{$_} } sort keys %hash; |
@entries=map { $_.':'.$hash{$_} } sort keys %hash; |
untie %hash; |
untie %hash; |
|
} |
} |
return @entries; |
return @entries; |
} |
} |
|
|
sub chatadd { |
sub chatadd { |
my ($cdom,$cname,$newchat)=@_; |
my ($cdom,$cname,$newchat)=@_; |
my %hash; |
my %hash; |
my $proname=&propath($cdom,$cname); |
my $proname=&propath($cdom,$cname); |
my @entries=(); |
my @entries=(); |
if |
if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db", |
(tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",&GDBM_WRCREAT(),0640)) |
&GDBM_WRCREAT(),0640)) { |
{ |
@entries=map { $_.':'.$hash{$_} } sort keys %hash; |
@entries=map { $_.':'.$hash{$_} } sort keys %hash; |
my $time=time; |
my $time=time; |
my ($lastid)=($entries[$#entries]=~/^(\w+)\:/); |
my ($lastid)=($entries[$#entries]=~/^(\w+)\:/); |
my ($thentime,$idnum)=split(/\_/,$lastid); |
my ($thentime,$idnum)=split(/\_/,$lastid); |
my $newid=$time.'_000000'; |
my $newid=$time.'_000000'; |
if ($thentime==$time) { |
if ($thentime==$time) { |
$idnum=~s/^0+//; |
$idnum=~s/^0+//; |
$idnum++; |
$idnum++; |
$idnum=substr('000000'.$idnum,-6,6); |
$idnum=substr('000000'.$idnum,-6,6); |
$newid=$time.'_'.$idnum; |
$newid=$time.'_'.$idnum; |
} |
} |
$hash{$newid}=$newchat; |
$hash{$newid}=$newchat; |
my $expired=$time-3600; |
my $expired=$time-3600; |
foreach (keys %hash) { |
foreach (keys %hash) { |
my ($thistime)=($_=~/(\d+)\_/); |
my ($thistime)=($_=~/(\d+)\_/); |
if ($thistime<$expired) { |
if ($thistime<$expired) { |
delete $hash{$_}; |
undef $hash{$_}; |
} |
} |
} |
|
untie %hash; |
} |
} |
untie %hash; |
|
} |
|
} |
} |
|
|
sub unsub { |
sub unsub { |