Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
PrefKarafuto committed Mar 7, 2024
2 parents b326431 + 73b75db commit eefc909
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions test/module/ninpocho.pl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ sub Load
$sid = $Sys->Get('SID');

#cookieにsessionIDが保存されていない場合
unless ($sid && $this->{'ANON_FLAG'}){
if (!$sid && !$this->{'ANON_FLAG'}){
my $addr = $ENV{'REMOTE_ADDR'};
my $ctx = Digest::MD5->new;
my $expiry = 60*60*24;
Expand Down Expand Up @@ -128,16 +128,14 @@ sub Load
}
}
$this->{'SESSION'} = $session;
$this->{'SID'} = $sid;
}else{
$this->{'SESSION'} = undef;
#セッションIDのみ使う場合
if($sid){
$this->{'SID'} = $sid;
}else{
if(!$sid){
$this->{'SID'} = generate_id();
}
}
$this->{'SID'} = $sid;
$Sys->Set('SID',$sid);
return $sid;
}
Expand Down Expand Up @@ -275,8 +273,6 @@ sub Save
$Cookie->Set('securitykey', $sec);
$Cookie->Set('countsession', $sid);

return unless $session;

# Hashテーブルを設定
if(!$this->{'ANON_FLAG'}){
my $addr = $ENV{'REMOTE_ADDR'};
Expand All @@ -290,6 +286,10 @@ sub Save
SetHash($ip_hash,$sid,time,$ninDir.'hash/ip_addr.cgi');
SetHash($user,$sid,time,$ninDir.'hash/user_info.cgi');
}

# 忍法帖を使わない場合
return unless $session;

if ($password) {
my $ctx3 = Digest::MD5->new;
$ctx3->add($Sys->Get('SECURITY_KEY'));
Expand Down
10 changes: 6 additions & 4 deletions test/module/post_service.pl
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ sub Write

$datepart = $Form->Get('datepart', '');
$idpart = $Form->Get('idpart', '');
unless ($Set->Get('BBS_HIDENUSI') || $Threads->GetAttr($threadid,'hidenusi') || $handle){
if (!$Set->Get('BBS_HIDENUSI') || !$Threads->GetAttr($threadid,'hidenusi') || !$handle){
$idpart .= '(主)' if (($sid eq $nusisid) || $Sys->Equal('MODE', 1));
}
$bepart = $Form->Get('BEID', '');
Expand Down Expand Up @@ -893,9 +893,11 @@ sub Command
}
#スレ主非表示
if($Form->Get('MESSAGE') =~ /(^|<br>)!hidenusi(<br>|$)/ && ($setBitMask & 32768)){
$Threads->SetAttr($threadid, 'hidenusi',1);
$Threads->SaveAttr($Sys);
$Command .= '※スレ主非表示<br>';
if(!$Set->Get('BBS_HIDENUSI')){
$Threads->SetAttr($threadid, 'hidenusi',1);
$Threads->SaveAttr($Sys);
$Command .= '※スレ主非表示<br>';
}
}
#BAN
if($Form->Get('MESSAGE') =~ /(^|<br>)!ban:&gt;&gt;([1-9][0-9]*)(<br>|$)/ && ($setBitMask & 4096)){
Expand Down

0 comments on commit eefc909

Please sign in to comment.