############################################################################### # Admin.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Project started by Zef Hemel (zef@zefnet.com) # # Software Version: YaBB 1 Gold - Release # # =========================================================================== # # Software Distributed by: http://yabb.xnull.com # # Support, News, Updates at: http://yabb.xnull.com/community/ # # =========================================================================== # # Copyright (c) 2000-2001 X-Null - All Rights Reserved # # Software by: The YaBB Development Team # ############################################################################### $adminplver="1 Gold - Release"; sub Admin { &is_admin; my( $numcats, $numboards, @categories, @catboards, @curcataccess, $curcat, $curcatname, $curcataccess, $curboard, $threadcount, $messagecount, $maxdays, $totalt, $totalm, $avgt, $avgm ); my( $memcount, $latestmember ) = &MembershipGet; &LoadUser($latestmember); $thelatestmember = qq~$txt{'656'} $userprofile{$latestmember}->[1]~; $memcount ||= 1; # Load data for the 'remove old messages' feature, get totals, and get moderators fopen(FILE, "$vardir/oldestmes.txt"); $maxdays = ; fclose(FILE); fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); $numcats = @categories; # get the number of categories foreach $curcat (@categories) { chomp $curcat; fopen(CATFILE, "$boardsdir/$curcat.cat"); $curcatname = ; $curcataccess = ; @catboards = ; fclose(CATFILE); chomp $curcatname; chomp $curcataccess; $yyAccessCat{$curcat} = $settings[7] eq 'Administrator' || $moderators{$username} || ! $curcataccess; unless( $yyAccessCat{$curcat} ) { foreach ( split(/\,/, $curcataccess) ) { if( $_ && $_ eq $settings[7] ) { $yyAccessCat{$curcat} = 1; last; } } } foreach $curboard (@catboards) { chomp $curboard; $numboards++; ( $threadcount, $messagecount ) = &BoardCountGet($curboard); $totalt += $threadcount; $totalm += $messagecount; } } $avgt = $totalt / $memcount; $avgm = $totalm / $memcount; &LoadAdmins; &LoadLogCount; $yytitle = "$txt{'208'}"; &header; print << "EOT"; $showmods
$txt{'208'}
$txt{'248'} $settings[1] ($username)!
$txt{'644'}

$txt{'424'}
$txt{'427'}
$txt{'7'}
$txt{'3'}
$txt{'4'}

$txt{'426'}
$txt{'5'}
$txt{'8'}
$txt{'6'}
$txt{'206'}
$txt{'207'}

$txt{'428'}
$txt{'216'}
$txt{'222'}
$txt{'135'}
$txt{'202'}

$txt{'501'}
$txt{'610'}
$txt{'502'}
$txt{'504'}
$txt{'593'}
($txt{'595'})
$txt{'124'} $txt{'579'}
 
$txt{'645'}
$txt{'94'}
$txt{'488'} $memcount
$txt{'489'} $totalm
$txt{'490'} $totalt
$txt{'658'} $numcats
$txt{'665'} $numboards
$txt{'691'} ($txt{'692'}): $yyclicks
$txt{'693'}
$txt{'657'}
$thelatestmember
$txt{'659'} EOT require "$sourcedir/Recent.pl"; $recentsender = "admin"; &LastPost; print <<"EOT";

$txt{'684'}: $administrators

$txt{'425'}: $YaBBversion/
$txt{'429'}


$txt{'571'}

YaBB 1 Gold: Ze0|ntrus (Corey Chapman), plushpuffin (Darya Misse), Popeye, [CV]XXL, DaveB, DaveG, CareyP, Christian Land, Tim C, ejdmoo, StarSaber, Parham and the rest for helping out with graphics, code and other things :-)

YaBB 1 Final: Zef Hemel, Jeff Lewis, Christian Land, Ze0|ntrus, Peter Crouch and a bunch of others we want to thank!


EOT &footer; exit; } sub ShowClickLog { &is_admin; my($totalip,$totalclick,$totalbrow,$totalos,@log,@iplist,$date,@to,@from,@info,@os,@browser,@newiplist,@newbrowser,@newoslist,@newtolist,@newfromlist); my($i,$curentry); $yytitle = $txt{'693'}; &header; fopen(LOG, "$vardir/clicklog.txt"); @log = ; fclose(LOG); $i = 0; foreach $curentry (@log) { ($iplist[$i],$date,$to[$i],$from[$i],$info[$i]) = split(/\|/, $curentry); $i++; } $i = 0; foreach $curentry (@info) { if ($curentry !~ /\s\(Win/i || $curentry !~ /\s\(mac/) { $curentry =~ s/\s\((compatible;\s)*/ - /ig; } else { $curentry =~ s/(\S)*\(/; /g; } if ($curentry =~ /\s-\sWin/i) { $curentry =~ s/\s-\sWin/; win/ig; } if ($curentry =~ /\s-\sMac/i) { $curentry =~ s/\s-\sMac/; mac/ig; } ($browser[$i],$os[$i]) = split(/\;\s/, $curentry); if($os[$i] =~ /\)\s\S/) { ($os[$i],$browser[$i]) = split(/\)\s/, $os[$i]); } $os[$i] =~ s/\)//g; $i++; } print <<"EOT";
  $txt{'693'}

$txt{'697'}

$txt{'694'}
EOT for($i = 0; $i < @iplist; $i++) { $iplist{$iplist[$i]}++; } $i = 0; while(($key, $val ) = each(%iplist)) { $newiplist[$i] = [ $key, $val ]; $i++; } $totalclick = @iplist-1; $totalip = @newiplist-1; print qq~$txt{'742'}: $totalclick
~; print qq~$txt{'743'}: $totalip

~; for($i = 0; $i < @newiplist; $i++) { if($newiplist[$i]->[0] =~ /\S+/) { print "$newiplist[$i]->[0]  ($newiplist[$i]->[1])
\n"; } } print <<"EOT";
$txt{'695'}
EOT for($i = 0; $i < @browser; $i++) { $browser{$browser[$i]}++; } $i = 0; while(($key, $val ) = each(%browser)) { $newbrowser[$i] = [ $key, $val ]; $i++; } $totalbrow = @newbrowser-1; print qq~$txt{'744'}: $totalbrow

~; for($i = 0; $i < @newbrowser; $i++) { if($newbrowser[$i]->[0] =~ /\S+/) { print "$newbrowser[$i]->[0]  ($newbrowser[$i]->[1])
\n"; } } print <<"EOT";
$txt{'696'}
EOT for($i = 0; $i < @os; $i++) { $os{$os[$i]}++; } $i = 0; while(($key, $val ) = each(%os) ) { $newoslist[$i] = [ $key, $val ]; $i++; } $totalos = @newoslist-1; print qq~$txt{'745'}: $totalos

~; for($i = 0; $i < @newoslist; $i++) { if($newoslist[$i]->[0] =~ /\S+/) { print "$newoslist[$i]->[0]  ($newoslist[$i]->[1])
\n"; } } print <<"EOT";
Pages Visited
EOT for($i = 0; $i < @to; $i++) { $to{$to[$i]}++; } $i = 0; while(($key, $val ) = each(%to)) { $newtolist[$i] = [ $key, $val ]; $i++; } for($i = 0; $i < @newtolist; $i++) { if($newtolist[$i]->[0] =~ /\S+/) { print "[0] target=_blank>$newtolist[$i]->[0]  ($newtolist[$i]->[1])
\n"; } } print <<"EOT";
Referring Pages
EOT for($i = 0; $i < @from; $i++) { $from{$from[$i]}++; } $i = 0; while(($key, $val ) = each(%from)) { $newfromlist[$i] = [ $key, $val ]; $i++; } for($i = 0; $i < @newfromlist; $i++) { if($newfromlist[$i]->[0] =~ /\S+/) { print "[0] target=_blank>$newfromlist[$i]->[0]  ($newfromlist[$i]->[1])
\n"; } } print <<"EOT";
EOT &footer; exit; } sub RepairBoards { &is_admin; unless( $maintenance ) { &fatal_error($txt{'611'}); } $yytitle = $txt{'612'}; &header; %users = (); %emails = (); %userslc = (); %nicknamess = (); %nicknameslc = (); keys %users = $#memberlist; keys %emails = $#memberlist; keys %userslc = $#memberlist; keys %nicknames = $#memberlist; keys %nicknameslc = $#memberlist; fopen(FILE, "$memberdir/memberlist.txt") || &fatal_error("1000 $txt{'106'}: $txt{'23'} memberlist.txt"); while( $musername = ) { $musername =~ s~[\n\r]~~g; if( $musername && fopen(FILE2, "$memberdir/$musername.dat") ) { $_ = ; $mname = ; $memail = ; fclose(FILE2); $mname =~ s~[\n\r]~~g; $memail =~ s~[\n\r]~~g; $musernamelc = lc $musername; $mnamelc = lc $mname; $users{$musername} = $mname; $emails{$musername} = $memail; $nicknames{$mname} = $musername; $userslc{$musernamelc} = $mname; $nicknameslc{$mnamelc} = $musername; } } fclose(FILE); @categories = (); fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); foreach $curcat (@categories) { chomp $curcat; fopen(FILE, "$boardsdir/$curcat.cat"); $catname{$curcat} = ; chomp $catname{$curcat}; $cataccess{$curcat} = ; chomp $cataccess{$curcat}; @catboards = ; fclose(FILE); print qq~
$txt{'613'}: $curcat / $catname{$curcat}
~; boardcheck: foreach $curboard (@catboards) { $curboard =~ s~[\n\r]~~g; print qq~$txt{'614'}: $curboard
~; fopen(FILE, "$boardsdir/$curboard.dat"); @boardinfo = ; fclose(FILE); chomp @boardinfo; @{$boardinfo{$curboard}} = @boardinfo; $cat{$curboard} = $curcat; fopen(FILE, "$boardsdir/$curboard.txt") || &fatal_error("1001 $txt{'106'}: $txt{'23'} $curboard.txt"); @threads = ; fclose(FILE); # Process Board Here # %ttimes = (); keys %ttimes = $#threads; $totalposts = 0; $totalthreads = 0; threadcheck: for( $threadnum = 0; $threadnum < @threads; ++$threadnum ) { $curthread = $threads[$threadnum]; $curthread =~ s~[\n\r]~~g; if( $curthread =~ m~\A\s*\Z~ ) { $threads[$threadnum] = ''; next threadcheck; } ($tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate) = split( /\|/, $curthread ); if( fopen(FILE, "$datadir/$tnum.txt") ) { @messages = ; fclose(FILE); } else { $threads[$threadnum] = ''; next threadcheck; } $treplies = 0; postcheck: for( $postnum = 0; $postnum < @messages; ++$postnum ) { $curpost = $messages[$postnum]; $curpost =~ s~[\n\r]~~g; if( $curpost =~ m~\A\s*\Z~ ) { $messages[$postnum] = ''; next postcheck; } ++$treplies; ($msub, $mname, $memail, $mdate, $musername, $icon, $mattach, $mip, $message, $mns, $mlm, $mlmb) = split(/\|/,$curpost); $mnamelc = lc $mname; $musernamelc = lc $musername; unless( $musername eq 'Guest' || exists $userslc{$musernamelc} ) { $musername = $nicknames{$mname} || $nicknameslc{$mnamelc} || 'Guest'; } if( $mlmb ) { $mlmblc = lc $mlmb; $mlmb = $users{ $nicknames{$mlmb} } || $userslc{ $nicknameslc{$mlmblc} } || $mlmb; } if( $musername ne 'Guest' && exists $users{$musername} ) { $mname = $users{$musername}; $memail = $emails{$musername}; } else { $musername = 'Guest'; $mname =~ s/\&/\&/g; $mname =~ s/"/\"/g; $mname =~ s/ / \ /g; $mname =~ s//>/g; $mname =~ s/\|/\|/g; $memail =~ s/\&/\&/g; $memail =~ s/"/\"/g; $memail =~ s/ / \ /g; $memail =~ s//>/g; $memail =~ s/\|//g; $mnamelc = lc $mname; if( exists $nicknameslc{$mnamelc} || exists $userslc{$mnamelc} ) { $mname .= " ($txt{'28'})"; } } $msub =~ s/\cM//g; $msub =~ s~<~<~g; $msub =~ s~>~>~g; $msub =~ s~"~"~g; $msub =~ s~|~\|~g; $msub =~ s~ ~ ~g; $msub =~ s~&~&~g; if (length($msub) > 50) { $msub = substr($msub,0,50); } $msub =~ s/\&/\&/g; $msub =~ s/"/\"/g; $msub =~ s/ / \ /g; $msub =~ s//>/g; $msub =~ s/\|/\|/g; $message =~ s/\cM//g; $message =~ s~<~<~g; $message =~ s~>~>~g; $message =~ s~"~"~g; $message =~ s~|~\|~g; $message =~ s~ \  \  \ ~\t~g; $message =~ s~ ~ ~g; $message =~ s~&~&~g; $message =~ s/
/\n/gi; $message =~ s~(\S{80})(?=\S)~$1\n~g; $message =~ s~\[([^\]]{0,30})\n([^\]]{0,30})\]~\[$1$2\]~g; $message =~ s~\[/([^\]]{0,30})\n([^\]]{0,30})\]~\[/$1$2\]~g; $message =~ s~(\w+://[^<>\s\n\"\]\[]+)\n([^<>\s\n\"\]\[]+)~$1$2~g; $message =~ s/\&/\&/g; $message =~ s/"/\"/g; $message =~ s/ / \ /g; $message =~ s//>/g; $message =~ s/\t/ \  \  \ /g; $message =~ s/\|/\|/g; $message =~ s~\n~
~g; &CheckIcon; $messages[$postnum] = qq~$msub|$mname|$memail|$mdate|$musername|$icon|$mattach|$mip|$message|$mns|$mlm|$mlmb\n~; if( $postnum == 0 ) { $tname = $mname; $temail = $memail; $tusername = $musername; $tsub = $msub; $ticon = $icon; } if( $postnum == $#messages ) { $tdate = $mdate; $lastposter = $musername eq 'Guest' ? qq~Guest-$mname~ : $musername; } } if( $treplies ) { --$treplies; if( fopen(FILE, ">$datadir/$tnum.txt") ) { print FILE @messages; fclose(FILE); $totalposts += $treplies + 1; ++$totalthreads; $ttimes{$threadnum} = stringtotime($tdate); $threads[$threadnum] = qq~$tnum|$tsub|$tname|$temail|$tdate|$treplies|$tusername|$ticon|$tstate\n~; if( fopen(FILE, "$datadir/$tnum.data") ) { $_ = ; ($views, $_) = split( /\|/, $_ ); fclose(FILE); } else { $views = 0; } if( fopen(FILE, ">$datadir/$tnum.data") ) { print FILE qq~$views|$lastposter~; fclose(FILE); } } else { $treplies = -1; } } if( $treplies < 0 ) { unlink("$datadir/$tnum.txt"); unlink("$datadir/$tnum.mail"); unlink("$datadir/$tnum.data"); $threads[$threadnum] = ''; $ttimes{$threadnum} = 0; } print qq~~; } @threads = map { $_->[0] } sort { $b->[1] <=> $a->[1] } map { [ $threads[$_], $ttimes{$_} ] } keys %ttimes; if( fopen(FILE, ">$boardsdir/$curboard.txt", 1) ) { print FILE @threads; fclose(FILE); } ($tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate) = split( /\|/, $threads[0] ); if( fopen(FILE, "$datadir/$tnum.data") ) { $_ = ; ($views, $lastposter) = split( /\|/, $_ ); fclose(FILE); } &BoardCountSet( $curboard, $totalthreads, $totalposts, $tdate, $lastposter ); #/ Process Board Here /# } } &BoardCatsMake; print qq~$txt{'51'}
~; &footer; exit; } sub AdminMembershipRecount { &is_admin; $yytitle = $txt{'504'}; &header; &MembershipCountTotal; print qq~$txt{'505'}~; &footer; exit; } sub AdminBoardRecount { &is_admin; $yytitle = $txt{'502'}; my( $curcat, $curcatname, $curcataccess ); my( @categories, @catboards ); fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); foreach $curcat (@categories) { chomp $curcat; fopen(FILE, "$boardsdir/$curcat.cat"); chomp( $curcatname = ); chomp( $curcataccess = ); @catboards = ; fclose(FILE); foreach (@catboards) { chomp; &BoardCountTotals($_); } } &header; print qq~$txt{'503'}~; &footer; exit; } sub RebuildMemList { &is_admin; $yytitle = "$txt{'593'}"; opendir(DIR, "$memberdir") || die "$txt{'230'} ($memberdir) :: $!"; @contents = readdir(DIR); closedir(DIR); fopen(MEMLIST, ">$memberdir/memberlist.txt", 1); foreach $line (sort @contents){ #($name, $extension) = split (/\./, $line); $line =~ m~(.+)\.(.+)~; if ($2 eq 'dat'){ print MEMLIST "$1\n"; } } fclose(MEMLIST); &header; print qq~$txt{'594'}~; &footer; exit; } sub ViewMembers { &is_admin; # Load member list fopen(FILE, "$memberdir/memberlist.txt"); @memberlist = ; fclose(FILE); $yytitle = "$txt{'9'}"; &header; print <<"EOT";
  $txt{'9'}
EOT $count = 0; foreach $curmem (@memberlist) { $curmem =~ s/[\n\r]//g; &FormatUserName($curmem); if ($curmem eq "admin") { print qq~ \n \n \n~; } else { print qq~ \n \n \n~; } $count++; } print <<"EOT";
$curmem   
$curmem   
EOT &footer; exit; } sub DeleteMultiMembers { &is_admin; my($count, $memnum, $currentmem); fopen(FILE, "$memberdir/memberlist.txt"); @memnum = ; fclose(FILE); $count = 0; while (@memnum > $count) { $currentmem = $FORM{"member$count"}; if (exists $FORM{"member$count"}) { fopen(FILE, "$memberdir/$currentmem.dat"); @memsettings=; fclose(FILE); foreach (@memsettings) { $_ =~ s~[\n\r]~~g; } unlink("$memberdir/$currentmem.dat"); unlink("$memberdir/$currentmem.msg"); unlink("$memberdir/$currentmem.log"); unlink("$memberdir/$currentmem.outbox"); unlink("$memberdir/$currentmem.imconfig"); opendir (DIRECTORY,"$datadir"); @dirdata = readdir(DIRECTORY); closedir (DIRECTORY); $umail=$memsettings[2]; foreach $filename (@dirdata) { unless( $filename =~ m~mail\A~ ) { next; } fopen(FILE, "$datadir/$filename"); @entries = ; fclose(FILE); fopen(FILE, ">$datadir/$filename"); foreach $entry (@entries) { $entry =~ s/[\n\r]//g; if ($entry ne $umail) { print FILE "$entry\n"; } } fclose(FILE); } fopen(FILE, "$memberdir/memberlist.txt"); @members = ; fclose(FILE); fopen(FILE, ">$memberdir/memberlist.txt", 1); my $memberfound = 0; my $lastvalidmember = ''; foreach $curmem (@members) { chomp $curmem; if($curmem ne $currentmem) { print FILE "$curmem\n"; $lastvalidmember = $curmem; } else { ++$memberfound; } } fclose(FILE); my $membershiptotal = @members - $memberfound; fopen(FILE, "+>$memberdir/members.ttl"); print FILE qq~$membershiptotal|$lastvalidmember~; fclose(FILE); } $count++; } $yySetLocation = qq~$scripturl?action=viewmembers~; &redirectexit; } sub MailingList { &is_admin; fopen(FILE, "$memberdir/memberlist.txt"); @memberlist = ; fclose(FILE); $yytitle = "$txt{'6'}"; &header; print <<"EOT";
  $txt{'6'}

$txt{'735'}



$txt{'338'}




EOT &footer; exit; } sub ml { $FORM{'emails'} = "; " . $FORM{'emails'}; @emails = split(/;\s*/, $FORM{'emails'}); foreach $curmem (@emails) { &sendmail( $curmem, "$mbname: $FORM{'subject'}", "$FORM{'message'}\n\n$txt{'130'}\n\n$scripturl"); } $yySetLocation = qq~$cgi&action=admin~; &redirectexit; } sub EditNews { &is_admin; fopen(FILE, "$vardir/news.txt"); @newsitems = ; fclose(FILE); $yytitle = "$txt{'7'}"; &header; print <<"EOT";
$txt{'7'}

$txt{'670'}




EOT &footer; exit; } sub EditNews2 { &is_admin; fopen(FILE, ">$vardir/news.txt", 1); print FILE "$FORM{'news'}"; fclose(FILE); $yySetLocation = qq~$cgi\&action=admin~; &redirectexit; } sub EditMemberGroups { &is_admin; my( @lines, $mgroups, $i ); fopen(FILE, "$vardir/membergroups.txt"); @lines = ; fclose(FILE); $yytitle = $txt{'8'}; foreach $i (@lines) { $i =~ tr/\r//d; $i =~ tr/\n//d; } for( $i = 7; $i < @lines; ++$i ) { if( $lines[$i] =~ m~\A\s+\Z~ ) { next; } $mgroups .= "$lines[$i]\n"; } &header; print <<"EOT";
$txt{'8'}
$txt{'11'}:
$txt{'12'}:
$txt{'569'}:
$txt{'13'}:
$txt{'14'}:
$txt{'15'}:
$txt{'570'}:
$txt{'16'}:
EOT &footer; exit; } sub EditMemberGroups2 { &is_admin; my $additional = $FORM{'additional'}; while( $groups = each(%FORM) ) { $FORM{$groups} =~ tr/\n//d; $FORM{$groups} =~ tr/\r//d; } fopen(FILE, ">$vardir/membergroups.txt", 1); print FILE "$FORM{'admin'}\n"; print FILE "$FORM{'moderator'}\n"; print FILE "$FORM{'newbie'}\n"; print FILE "$FORM{'junior'}\n"; print FILE "$FORM{'full'}\n"; print FILE "$FORM{'senior'}\n"; print FILE "$FORM{'god'}\n"; print FILE "$additional"; fclose(FILE); $yySetLocation = qq~$cgi&action=admin~; &redirectexit; } sub SetCensor { &is_admin; my( @censored, $i ); fopen(FILE, "$vardir/censor.txt"); @censored = ; fclose(FILE); foreach $i (@censored) { $i =~ tr/\r//d; $i =~ tr/\n//d; } $yytitle = "$txt{'135'}"; &header; print <<"EOT";
$txt{'135'}
$txt{'136'}


EOT &footer; exit; } sub SetCensor2 { &is_admin; $FORM{'censored'} =~ tr/\r//d; $FORM{'censored'} =~ s~\A[\s\n]+~~; $FORM{'censored'} =~ s~[\s\n]+\Z~~; $FORM{'censored'} =~ s~\n\s*\n~\n~g; my @lines = split( /\n/, $FORM{'censored'} ); fopen(FILE, ">$vardir/censor.txt", 1); foreach my $i (@lines) { $i =~ tr/\n//d; unless( $i && $i =~ m~.+\=.+~ ) { next; } print FILE "$i\n"; } fclose(FILE); $yySetLocation = qq~$cgi&action=admin~; &redirectexit; } sub clean_log { &is_admin; $yytitle = $txt{'202'}; &header; print <<"EOT";
$txt{'202'}
$txt{'203'} $txt{'163'}  $txt{'164'}
EOT &footer; exit; } sub do_clean_log { &is_admin; # Overwrite with a blank file fopen(FILE, ">$vardir/log.txt"); print FILE ''; close FILE; &Admin; } sub ipban { &is_admin; my( @ipban, @emailban, $curban ); fopen(FILE, "$vardir/ban.txt"); @ipban = ; fclose(FILE); fopen(FILE, "$vardir/ban_email.txt"); @emailban = ; fclose(FILE); $yytitle = "$txt{'340'}"; &header; print <<"EOT";
$txt{'340'}

$txt{'724'}


$txt{'725'}


EOT &footer; exit; } sub ipban2 { &is_admin; $FORM{'ban'} =~ tr/\r//d; $FORM{'ban'} =~ s~\A[\s\n]+~~; $FORM{'ban'} =~ s~[\s\n]+\Z~~; $FORM{'ban'} =~ s~\n\s*\n~\n~g; $FORM{'ban_email'} =~ tr/\r//d; $FORM{'ban_email'} =~ s~\A[\s\n]+~~; $FORM{'ban_email'} =~ s~[\s\n]+\Z~~; $FORM{'ban_email'} =~ s~\n\s*\n~\n~g; fopen(FILE, ">$vardir/ban.txt", 1); print FILE "$FORM{'ban'}"; fclose(FILE); fopen(FILE, ">$vardir/ban_email.txt", 1); print FILE "$FORM{'ban_email'}"; fclose(FILE); $yySetLocation = qq~$cgi&action=admin~; &redirectexit; } sub SetReserve { my( @reserved, @reservecfg, $i ); &is_admin; fopen(FILE, "$vardir/reserve.txt"); @reserved = ; fclose(FILE); fopen(FILE, "$vardir/reservecfg.txt"); @reservecfg = ; fclose(FILE); $yytitle = "$txt{'341'}"; foreach $i (@reservecfg) { $i =~ tr/\r//d; $i =~ tr/\n//d; } &header; print <<"EOT";
$txt{'341'}

$txt{'699'}

$txt{'342'}

$txt{'726'}
$txt{'727'}
$txt{'728'}
$txt{'729'}
EOT &footer; exit; } sub SetReserve2 { &is_admin; $FORM{'reserved'} =~ tr/\r//d; $FORM{'reserved'} =~ s~\A[\s\n]+~~; $FORM{'reserved'} =~ s~[\s\n]+\Z~~; $FORM{'reserved'} =~ s~\n\s*\n~\n~g; fopen(FILE, ">$vardir/reserve.txt", 1); my $matchword = $FORM{'matchword'} eq 'checked' ? 'checked' : ''; my $matchcase = $FORM{'matchcase'} eq 'checked' ? 'checked' : ''; my $matchuser = $FORM{'matchuser'} eq 'checked' ? 'checked' : ''; my $matchname = $FORM{'matchname'} eq 'checked' ? 'checked' : ''; print FILE $FORM{'reserved'}; fclose(FILE); fopen(FILE, "+>$vardir/reservecfg.txt"); print FILE "$matchword\n"; print FILE "$matchcase\n"; print FILE "$matchuser\n"; print FILE "$matchname\n"; fclose(FILE); $yySetLocation = qq~$cgi&action=admin~; &redirectexit; } sub ModifyTemplate { &is_admin; my( $fulltemplate, $line ); fopen(FILE, "$boarddir/template.html"); while( $line = ) { $line =~ tr/\r//d; $line =~ tr/\n//d; $line =~ s/&/&/g; $line =~ s//>/g; $line =~ s/\|/\|/g; $line =~ s/\%/%/g; $line =~ s/"/"/g; $fulltemplate .= qq~$line\n~; } fclose(FILE); $yytitle = "$txt{'216'}"; &header; print <<"EOT";
$txt{'216'}

$txt{'682'}




EOT &footer; exit; } sub ModifyTemplate2 { &is_admin; $FORM{'template'} =~ tr/\r//d; $FORM{'template'} =~ s~\A\n~~; $FORM{'template'} =~ s~\n\Z~~; fopen(FILE, ">$boarddir/template.html"); print FILE $FORM{'template'}; fclose(FILE); $yySetLocation = qq~$cgi&action=admin~; &redirectexit; } sub ver_detail { &is_admin; &loadfiles; $yytitle = $txt{'429'}; &header; print <<"EOT";
$txt{'429'}

$txt{'495'}

$txt{'494'}

$txt{'493'}

$txt{'496'}$YaBBversion
YaBB.pl$YaBBplver
$language$englishlngver
Admin.pl$adminplver
BoardIndex.pl$boardindexplver
Display.pl$displayplver
ICQPager.pl$icqpagerplver
InstantMessage.pl$instantmessageplver
Load.pl$loadplver
LockThread.pl$lockthreadplver
LogInOut.pl$loginoutplver
Maintenance.pl$maintenanceplver
ManageBoards.pl$manageboardsplver
ManageCats.pl$managecatsplver
Memberlist.pl$memberlistplver
MessageIndex.pl$messageindexplver
ModifyMessage.pl$modifymessageplver
MoveThread.pl$movethreadplver
Notify.pl$notifyplver
Post.pl$postplver
Profile.pl$profileplver
Recent.pl$recentplver
Register.pl$registerplver
RemoveOldThreads.pl$removeoldthreadsplver
RemoveThread.pl$removethreadplver
Search.pl$searchplver
SendTopic.pl$sendtopicplver
Security.pl$securityplver
Subs.pl$subsplver

EOT &footer; exit; } sub ModifySettings { &is_admin; my($mainchecked, $guestaccchecked, $forcechecked, $blankchecked, $agreechecked, $mailpasschecked, $newpasschecked, $welchecked); my($menuchecked, $ubbcchecked, $aluchecked, $cpchecked, $pbchecked, $insertchecked, $newschecked, $gpchecked, $notifchecked); my($ahmchecked, $slmchecked, $srbarchecked, $smbarchecked, $smreadchecked, $smodchecked, $supicchecked, $sutextchecked, $sgichecked); my($snfchecked, $fls1, $fls2, $fls3, $utfchecked, $truncchecked, $mts1, $mts2, $mts3, $tsl6, $tsl5, $tsl4, $tsl3, $tsl2, $tsl1); $yytitle = $txt{'222'}; &header; # figure out what to print if ($maintenance) { $mainchecked = ' checked'; } if ($guestaccess == 0) { $guestaccchecked = ' checked'; } if ($yyForceIIS) { $forcechecked = ' checked'; } if ($yyblankpageIIS) { $blankchecked = ' checked'; } if($RegAgree) { $agreechecked = " checked"; } if($emailpassword) { $mailpasschecked = " checked"; } if($emailnewpass) { $newpasschecked = " checked"; } if($emailwelcome) { $welchecked = " checked"; } if ($MenuType) { $menuchecked = ' checked'; } if ($enable_ubbc) { $ubbcchecked = ' checked'; } if ($autolinkurls) { $aluchecked = ' checked'; } if ($curposlinks) { $cpchecked = ' checked'; } if ($profilebutton) { $pbchecked = ' checked'; } if ($enable_news) { $newschecked = "checked" } if ($enable_guestposting) { $gpchecked = "checked" } if ($enable_notification) { $notifchecked = "checked" } if ($allow_hide_email) { $ahmchecked = "checked" } if ($showlatestmember) { $slmchecked = "checked" } if ($Show_RecentBar) { $srbarchecked = "checked" } if ($Show_MemberBar) { $smbarchecked = "checked" } if ($showmarkread) { $smreadchecked = "checked" } if ($showmodify) { $smodchecked = "checked" } if ($ShowBDescrip) { $bdescripchecked = "checked" } if ($showuserpic) { $supicchecked = "checked" } if ($showusertext) { $sutextchecked = "checked" } if ($showgenderimage) { $sgichecked = "checked" } if ($shownewsfader) { $snfchecked = "checked" } if ($showyabbcbutt) { $syabbcchecked = "checked" } if ($allowpics) { $allowpicschecked = "checked" } if ($use_flock == 0) { $fls1 = " selected" } elsif ($use_flock == 1) { $fls2 = " selected" } elsif ($use_flock == 2) { $fls3 = " selected" } $utfchecked = $usetempfile ? ' checked' : ''; $truncchecked = $faketruncation ? ' checked' : ''; if ($mailtype == 0) { $mts1 = ' selected'; } elsif ($mailtype == 1) { $mts2 = ' selected'; } elsif( $mailtype == 2 ) { $mts3 = ' selected'; } if ($timeselected == 6) { $tsl6 = " selected" } elsif ($timeselected == 5) { $tsl5 = " selected" } elsif ($timeselected == 4) { $tsl4 = " selected" } elsif ($timeselected == 3) { $tsl3 = " selected" } elsif ($timeselected == 2) { $tsl2 = " selected" } else { $tsl1 = " selected" } print <<"EOT";
$txt{'222'}

$txt{'347'}

$txt{'348'}
$txt{'632'}
$txt{'666'}
$txt{'667'}
$txt{'349'}
$txt{'350'}
$txt{'351'}
$txt{'432'}
$txt{'352'}
$txt{'353'}
$txt{'584'}
$txt{'702'}
$txt{'639'}
$txt{'619'}
$txt{'354'}
$txt{'407'}
$txt{'355'}
$txt{'404'}

$txt{'356'}
$txt{'357'}
$txt{'358'}
$txt{'359'}
$txt{'360'}
$txt{'361'}
$txt{'362'}
$txt{'423'}
$txt{'363'}
$txt{'390'}
$txt{'506'}
$txt{'364'}

$txt{'365'}
$txt{'366'}
$txt{'367'}
$txt{'368'}
$txt{'640'}
$txt{'369'}
$txt{'370'}
$txt{'388'}
$txt{'389'}

$txt{'521'}
$txt{'522'}
$txt{'523'}
$txt{'587'}
$txt{'723'}
$txt{'382'}
$txt{'387'}
$txt{'509'}
$txt{'510'}
$txt{'618'}
$txt{'732'}
$txt{'383'}
$txt{'384'}
$txt{'385'}
$txt{'386'}
$txt{'740'}

$txt{'378'}
$txt{'379'}
$txt{'746'}
$txt{'380'}
$txt{'381'}
$txt{'524'}
$txt{'371'}
$txt{'372'}
$txt{'373'}
$txt{'374'}
$txt{'375'}
$txt{'498'}
$txt{'689'}
$txt{'690'}
$txt{'376'}
$txt{'739'}
$txt{'408'}

$txt{'588'}
$txt{'589'}
$txt{'590'}
$txt{'591'}

$txt{'476'}
$txt{'477'}
$txt{'478'}

$txt{'392'}
$txt{'393'}
$txt{'607'}
$txt{'391'}
$txt{'615'}
$txt{'630'}

EOT &footer; exit; } sub GetBoardURL { my $url = 'http://' . ($ENV{'HTTP_HOST'} ? $ENV{'HTTP_HOST'} : $ENV{'SERVER_NAME'}) . ($ENV{'SERVER_PORT'} != 80 ? ":$ENV{'SERVER_PORT'}" : '') . $ENV{'SCRIPT_NAME'}; $url =~ s~/[^/]+\Z~/~; return $url; } # Gets our current absolute path. Needed for error messages. sub GetDirPath { eval 'use Cwd; $cwd = cwd();'; unless( $cwd ) { $cwd = `pwd`; chomp $cwd; } unless( $cwd ) { $cwd = $0 || $ENV{'PWD'} || $ENV{'CWD'} || ( $ENV{'DOCUMENT_ROOT'} . '/' . $ENV{'SCRIPT_NAME'} || $ENV{'PATH_INFO'} ); } $cwd =~ tr~\\~/~; $cwd =~ s~\A(.+)/\Z~$1~; $cwd =~ s~\A(.+)/YaBB\.\w+\Z~$1~i; return $cwd; } sub is_exe { my $cmd; foreach $cmd (@_) { $cmd =~ s/^\s+//; # remove any options my $name = ($cmd =~ /^(\S+)/)[0]; # check for absolute or relative path return ($cmd) if (-x $name and ! -d $name and $name =~ m:/:); if (defined $ENV{PATH}) { my $dir; foreach $dir (split(/:/, $ENV{PATH})) { return "$dir/$cmd" if (-x "$dir/$name" && ! -d "$dir/$name"); } } } 0; } sub ModifySettings2 { &is_admin; my @onoff = qw/ allowpics showyabbcbutt showbdescrip maintenance guestaccess insert_original enable_ubbc enable_news enable_guestposting enable_notification showlatestmember showrecentbar showmemberbar showmarkread showmodify showuserpic showusertext showgenderimage shownewsfader MenuType curposlinks profilebutton autolinkurls emailpassword RegAgree emailwelcome allow_hide_email usetempfile faketruncation emailnewpass yyForceIIS yyblankpageIIS/; # Set as 0 or 1 if box was checked or not my $fi; map { $fi = lc $_; ${$_} = $FORM{$fi} eq 'on' ? 1 : 0; } @onoff; $guestaccess = $guestaccess ? 0 : 1; # If empty fields are submitted, set them to default-values to save yabb from crashing $timeout = $FORM{'timeout'} || 0; $fadertime = $FORM{'fadertime'} || 5; $timeselected = $FORM{'timeselect'} || 0; $timeoffset = $FORM{'timeoffset'} || 0; $TopAmmount = $FORM{'TopAmmount'} || 25; $MembersPerPage = $FORM{'MembersPerPage'} || 20; $maxdisplay = $FORM{'maxdisplay'} || 20; $maxmessagedisplay = $FORM{'maxmessagedisplay'} || 20; $max_log_days_old = $FORM{'max_log_days_old'} || 21; $clicklogtime = $FORM{'clicklogtime'} || 600; $use_flock = $FORM{'use_flock'} || 0; $LOCK_EX = $FORM{'LOCK_EX'} || 2; $LOCK_UN = $FORM{'LOCK_UN'} || 8; $LOCK_SH = $FORM{'LOCK_SH'} || 1; $Cookie_Length = $FORM{'cookielength'} || 60; $cookieusername = $FORM{'cookieusername'} || 'yabbusername'; $cookiepassword = $FORM{'cookiepassword'} || 'yabbpassword'; $maxmesslen = $FORM{'maxmesslen'} || 5000; $maxsiglen = $FORM{'maxsiglen'} || 200; $jrmem = $FORM{'jrmem'} || 50; $fullmem = $FORM{'fullmem'} || 100; $srmem = $FORM{'srmem'} || 250; $godmem = $FORM{'godmem'} || 500; $language = $FORM{'language'} || 'english.lng'; $mbname = $FORM{'mbname'} || 'My YaBB 1 Gold - Release'; $mbname =~ s/\"/\'/g; $boardurl = $FORM{'boardurl'} || &GetBoardURL; $boarddir = $FORM{'boarddir'} || &GetDirPath; $boardsdir = $FORM{'boardsdir'} || "$boarddir/Boards"; $datadir = $FORM{'datadir'} || "$boarddir/Messages"; $memberdir = $FORM{'memberdir'} || "$boarddir/Members"; $sourcedir = $FORM{'sourcedir'} || "$boarddir/Sources"; $vardir = $FORM{'vardir'} || "$boarddir/Variables"; $facesdir = $FORM{'facesdir'} || "$boarddir/YaBBImages/avatars"; $facesurl = $FORM{'facesurl'} || "$boardurl/YaBBImages/avatars"; $imagesdir = $FORM{'imagesdir'} || "$boardurl/YaBBImages"; $helpfile = $FORM{'helpfile'} || "$boardurl/YaBBHelp/index.html"; $mailprog = $FORM{'mailprog'} || &is_exe( '/usr/lib/sendmail', '/usr/sbin/sendmail', '/usr/ucblib/sendmail', 'sendmail', 'mailx', 'Mail', 'mail' ); $smtp_server = $FORM{'smtp_server'} || '127.0.0.1'; $webmaster_email = $FORM{'webmaster_email'} || 'webmaster@mysite.com'; $mailtype = $FORM{'mailtype'} || 0; $color{'titlebg'} = $FORM{'titlebg'} || '#FFB903'; $color{'titletext'} = $FORM{'titletext'} || '#000000'; $color{'windowbg'} = $FORM{'windowbg'} || '#272A2F'; $color{'windowbg2'} = $FORM{'windowbg2'} || '#444444'; $color{'windowbg3'} = $FORM{'windowbg3'} || '#FFB903'; $color{'catbg'} = $FORM{'catbg'} || '#40454C'; $color{'bordercolor'} = $FORM{'bordercolor'} || '#000000'; $color{'fadertext'} = $FORM{'fadertext'} || '#FFFFFF'; $color{'fadertext2'} = $FORM{'fadertext2'} || '#FFFFFF'; $faderpath = $FORM{'faderpath'} || "$boardurl/fader.js"; $ubbcjspath = $FORM{'ubbcjspath'} || "$boardurl/ubbc.js"; $userpic_width = $FORM{'userpic_width'} || 65; $userpic_height = $FORM{'userpic_height'} || 65; $userpic_limits = $FORM{'userpic_limits'} || 'Please note that your image has to be gif or jpg and that it will be resized!'; $userpic_limits =~ s/\"/\'/g; @domains = my $filler = q~ ~; my $setfile = << "EOF"; ############################################################################### # Settings.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Project started by Zef Hemel (zef\@zefnet.com) # # Software Version: YaBB 1 Gold - Release # # =========================================================================== # # Software Distributed by: http://yabb.xnull.com # # Support, News, Updates at: http://yabb.xnull.com/community/ # # =========================================================================== # # Copyright (c) 2000-2001 X-Null - All Rights Reserved # # Software by: The YaBB Development Team # ############################################################################### ########## Board Info ########## # Note: these settings must be properly changed for YaBB to work \$maintenance = $maintenance; # Set to 1 to enable Maintenance mode \$guestaccess = $guestaccess; # Set to 0 to disallow guests from doing anything but login or register \$yyForceIIS = $yyForceIIS; # Set to 1 if you encounter errors while running on an MS IIS server \$yyblankpageIIS = $yyblankpageIIS; # Set to 1 if you encounter blank pages after posting (usually on MS IIS servers) \$language = "$language"; # Change to language pack you want to use \$mbname = "$mbname"; # The name of your YaBB forum \$boardurl = "$boardurl"; # URL of your board's folder (without trailing '/') \$Cookie_Length = $Cookie_Length; # Cookies will expire after XX minutes of person logging in (they will be logged out after) \$cookieusername = "$cookieusername"; # Name of the username cookie \$cookiepassword = "$cookiepassword"; # Name of the password cookie \$RegAgree = $RegAgree; # Set to 1 to display the registration agreement when registering \$emailpassword = $emailpassword; # 0 - instant registration. 1 - password emailed to new members \$emailnewpass = $emailnewpass; # Set to 1 to email a new password to members if they change their email address \$emailwelcome = $emailwelcome; # Set to 1 to email a welcome message to users even when you have mail password turned off \$mailprog = "$mailprog"; # Location of your sendmail program \$smtp_server = "$smtp_server"; # SMTP-Server \$webmaster_email = q^$webmaster_email^; # Your e-mail address. (eg: \$webmaster_email = q^admin\@host.com^;) \$mailtype = $mailtype; # 0 - sendmail, 1 - SMTP, 2 - Net::SMTP ########## Directories/Files ########## # Note: directories other than \$imagesdir do not have to be changed unless you move things \$boarddir = "$boarddir"; # The absolute path to the board's folder (usually can be left as '.') \$boardsdir = "$boardsdir"; # Directory with board data files \$datadir = "$datadir"; # Directory with messages \$memberdir = "$memberdir"; # Directory with member files \$sourcedir = "$sourcedir"; # Directory with YaBB source files \$vardir = "$vardir"; # Directory with variable files \$facesdir = "$facesdir"; # Absolute Path to your avatars folder \$facesurl = "$facesurl"; # URL to your avatars folder \$imagesdir = "$imagesdir"; # URL to your images directory \$ubbcjspath = "$ubbcjspath"; # Web path to your 'ubbc.js' REQUIRED for post/modify to work properly! \$faderpath = "$faderpath"; # Web path to your 'fader.js' \$helpfile = "$helpfile"; # Location of your help file ########## Colors ########## # Note: equivalent to colors in CSS tag of template.html, so set to same colors preferrably # for browsers without CSS compatibility and for some items that don't use the CSS tag \$color{'titlebg'} = "$color{'titlebg'}"; # Background color of the 'title-bar' \$color{'titletext'} = "$color{'titletext'}"; # Color of text in the 'title-bar' (above each 'window') \$color{'windowbg'} = "$color{'windowbg'}"; # Background color for messages/forms etc. \$color{'windowbg2'} = "$color{'windowbg2'}"; # Background color for messages/forms etc. \$color{'windowbg3'} = "$color{'windowbg3'}"; # Color of horizontal rules in posts \$color{'catbg'} = "$color{'catbg'}"; # Background color for category (at Board Index) \$color{'bordercolor'} = "$color{'bordercolor'}"; # Table Border color for some tables \$color{'fadertext'} = "$color{'fadertext'}"; # Color of text in the NewsFader ("The Latest News" color) \$color{'fadertext2'} = "$color{'fadertext2'}"; # Color of text in the NewsFader (news color) ########## Layout ########## \$MenuType = $MenuType; # 1 for text menu or anything else for images menu \$curposlinks = $curposlinks; # 1 for links in navigation on current page, or 0 for text without link \$profilebutton = $profilebutton; # 1 to show view profile button under post, or 0 for blank \$timeselected = $timeselected; # Select your preferred output Format of Time and Date \$allow_hide_email = $allow_hide_email; # Allow users to hide their email from public. Set 0 to disable \$showlatestmember = $showlatestmember; # Set to 1 to display "Welcome Newest Member" on the Board Index \$shownewsfader = $shownewsfader; # 1 to allow or 0 to disallow NewsFader javascript on the Board Index # If 0, you'll have no news at all unless you put tag # back into template.html!!! \$Show_RecentBar = $showrecentbar; # Set to 1 to display the Recent Posts bar on Board Index \$Show_MemberBar = $showmemberbar; # Set to 1 to display the Members List table row on Board Index \$showmarkread = $showmarkread; # Set to 1 to display and enable the mark as read buttons \$showmodify = $showmodify; # Set to 1 to display "Last modified: Realname - Date" under each message \$ShowBDescrip = $showbdescrip; # Set to 1 to display board descriptions on the topic (message) index for each board \$showuserpic = $showuserpic; # Set to 1 to display each member's picture in the message view (by the ICQ.. etc.) \$showusertext = $showusertext; # Set to 1 to display each member's personal text in the message view (by the ICQ.. etc.) \$showgenderimage = $showgenderimage; # Set to 1 to display each member's gender in the message view (by the ICQ.. etc.) \$showyabbcbutt = $showyabbcbutt; # Set to 1 to display the yabbc buttons on Posting and IM Send Pages ########## Feature Settings ########## \$enable_ubbc = $enable_ubbc; # Set to 1 if you want to enable UBBC (Uniform Bulletin Board Code) \$enable_news = $enable_news; # Set to 1 to turn news on, or 0 to set news off \$allowpics = $allowpics; # set to 1 to allow members to choose avatars in their profile \$enable_guestposting = $enable_guestposting; # Set to 0 if do not allow 1 is allow. \$enable_notification = $enable_notification; # Allow e-mail notification \$autolinkurls = $autolinkurls; # Set to 1 to turn URLs into links, or 0 for no auto-linking. \$timeoffset = $timeoffset; # Time Offset (so if your server is EST, this would be set to -1 for CST) \$TopAmmount = $TopAmmount; # No. of top posters to display on the top members list \$MembersPerPage = $MembersPerPage; # No. of members to display per page of Members List - All \$maxdisplay = $maxdisplay; # Maximum of topics to display \$maxmessagedisplay = $maxmessagedisplay; # Maximum of messages to display \$MaxMessLen = $maxmesslen; # Maximum Allowed Characters in a Posts \$MaxSigLen = $maxsiglen; # Maximum Allowed Characters in Signatures \$ClickLogTime = $clicklogtime; # Time in minutes to log every click to your forum (longer time means larger log file size) \$max_log_days_old = $max_log_days_old; # If an entry in the user's log is older than ... days remove it # Set to 0 if you want it disabled \$fadertime = $fadertime; # Length in seconds to display each item in the news fader \$timeout = $timeout; # Minimum time between 2 postings from the same IP ########## Membergroups ########## \$JrPostNum = $jrmem; # Number of Posts required to show person as 'junior' membergroup \$FullPostNum = $fullmem; # Number of Posts required to show person as 'full' membergroup \$SrPostNum = $srmem; # Number of Posts required to show person as 'senior' membergroup \$GodPostNum = $godmem; # Number of Posts required to show person as 'god' membergroup ########## MemberPic Settings ########## \$userpic_width = $userpic_width; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit \$userpic_height = $userpic_height; # Set pixel size to which the selfselected userpics are resized, 0 disables this limit \$userpic_limits = qq~$userpic_limits~; # Text To Describe The Limits ########## File Locking ########## \$LOCK_EX = $LOCK_EX; # You can probably keep this as it is set now. \$LOCK_UN = $LOCK_UN; # You can probably keep this as it is set now. \$LOCK_SH = $LOCK_SH; # You can probably keep this as it is set now. \$use_flock = $use_flock; # Set to 0 if your server doesn't support file locking, # 1 for Unix/Linux and WinNT, and 2 for Windows 95/98/ME \$usetempfile = $usetempfile; # Write to a temporary file when updating large files. # This can potentially save your board index files from # being corrupted if a process aborts unexpectedly. # 0 to disable, 1 to enable. \$faketruncation = $faketruncation; # Enable this option only if YaBB fails with the error: # "truncate() function not supported on this platform." # 0 to disable, 1 to enable. 1; EOF $setfile =~ s~(.+\;)\s+(\#.+$)~$1 . substr( $filler, 0, (70-(length $1)) ) . $2 ~gem; $setfile =~ s~(.{64,}\;)\s+(\#.+$)~$1 . "\n " . $2~gem; # $setfile =~ s~(.+\;)(\s+)(\#.{40,}?)\s+(.{10,}$)~$1 . $2 . $3 . "\n # " . $4~gem; # $setfile =~ s~^\s\s\s+(\#.{40,}?)\s+(.{10,}$)~" " . $1 . "\n # " . $2~gem; $setfile =~ s~^\s\s\s+(\#.+$)~substr( $filler, 0, 70 ) . $1~gem; fopen(FILE, ">$boarddir/Settings.pl"); print FILE $setfile; fclose(FILE); $password = crypt($settings[0],$pwseed); $Cookie_Exp_Date = 'Sun, 17-Jan-2038 00:00:00 GMT'; $yySetCookies = qq~Set-Cookie: $cookieusername=$username; path=/; expires=$Cookie_Exp_Date;\n~; $yySetCookies .= qq~Set-Cookie: $cookiepassword=$password; path=/; expires=$Cookie_Exp_Date;\n~; &LoadUserSettings; &WriteLog; &Admin; } 1;