############################################################################### # Admin.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Software Version: YaBB 1 Gold - SP1 # # Released: December 2001 # # =========================================================================== # # Software Distributed by: http://yabb.xnull.com # # Support, News, Updates at: http://yabb.xnull.com/community/ # # =========================================================================== # # Copyright (c) 2000-2002 Xnull (www.xnull.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # ############################################################################### $adminplver = "1 Gold - SP1"; sub Admin { &is_admin; # Load data for the 'remove old messages' feature, get totals, and get moderators fopen(FILE, "$vardir/oldestmes.txt"); $maxdays = ; fclose(FILE); $yymain .= qq~
$txt{'208'}

$txt{'428'}
- $txt{'222'}
- $txt{'7'}
- $txt{'216'}
- $txt{'764'}
- $txt{'135'}

$txt{'427'}
- $txt{'3'}
- $txt{'4'}

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

$txt{'501'}
- $txt{'202'}
- $txt{'502'}
- $txt{'504'}
- $txt{'593'}
- ($txt{'595'})
$txt{'124'} $txt{'579'}
 
$txt{'248'} $settings[1] ($username)!

$txt{'644'}

$txt{'645'}
$txt{'795'}
$txt{'693'}
$txt{'425'}: $YaBBversion/
($txt{'429'})

$txt{'571'}

Service Pack l: Special thanks to Corey Chapman, Bjoern Berg, Dave Baughman, Tim Cueppens, Jay Silverman and Gunther Meyer.

YaBB 1 Gold: Corey Chapman, Darya Misse, Popeye, [CV]XXL, Dave Baughman, Dave G, Carey P, Christian Land, Tim Cueppens, ejdmoo, StarSaber, Parham and the rest for helping out with graphics, code and other things :-)

YaBB 1 Final: Zef Hemel, Jeff Lewis, Christian Land, Corey Chapman, Peter Crouch and a bunch of others we want to thank!
~; $yytitle = "$txt{'208'}"; &template; exit; } sub FullStats { &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; 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; $yymain .= qq~
$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'} ~; require "$sourcedir/Recent.pl"; $recentsender = "admin"; &LastPost; $yymain .= qq~

$txt{'684'}: $administrators

$txt{'425'}: $YaBBversion/
($txt{'429'})
~; $yytitle = "$txt{'208'}"; &template; exit; } sub ShowClickLog { &is_admin; my($totalip,$totalclick,$totalbrow,$totalos,@log,@iplist,$date,@to,@from,@info,@os,@browser,@newiplist,@newbrowser,@newoslist,@newtolist,@newfromlist,$i,$curentry); 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++; } $yymain .= qq~
  $txt{'693'}

$txt{'697'}

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

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

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

~; for($i = 0; $i < @newoslist; $i++) { if($newoslist[$i]->[0] =~ /\S+/) { $yymain .= "$newoslist[$i]->[0]  ($newoslist[$i]->[1])
\n"; } } $yymain .= qq~
Pages Visited
~; 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+/) { $yymain .= "[0] target=_blank>$newtolist[$i]->[0]  ($newtolist[$i]->[1])
\n"; } } $yymain .= qq~
Referring Pages
~; 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+/ && $newfromlist[$i]->[0] !~ m~$boardurl~i) { $yymain .= "[0] target=_blank>$newfromlist[$i]->[0]  ($newfromlist[$i]->[1])
\n"; } } $yymain .= qq~
~; $yytitle = $txt{'693'}; &template; exit; } sub AdminMembershipRecount { &is_admin; &MembershipCountTotal; $yymain .= qq~$txt{'505'}~; $yytitle = $txt{'504'}; &template; exit; } sub AdminBoardRecount { &is_admin; 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($_); } } $yymain .= qq~$txt{'503'}~; $yytitle = $txt{'502'}; &template; exit; } sub RebuildMemList { &is_admin; opendir(DIR, "$memberdir") || die "$txt{'230'} ($memberdir) :: $!"; @contents = readdir(DIR); closedir(DIR); fopen(MEMLIST, ">$memberdir/memberlist.txt", 1); foreach $line (sort @contents){ $line =~ m~(.+)\.(.+)~; if ($2 eq 'dat'){ print MEMLIST "$1\n"; } } fclose(MEMLIST); $yymain .= qq~$txt{'594'}~; $yytitle = "$txt{'593'}"; &template; exit; } sub ViewMembers { &is_admin; # Load member list fopen(FILE, "$memberdir/memberlist.txt"); @memberlist = ; fclose(FILE); $yymain .= qq~
  $txt{'9'}
~; $count = 0; foreach $curmem (@memberlist) { $curmem =~ s/[\n\r]//g; &FormatUserName($curmem); if ($curmem eq "admin") { $yymain .= qq~ \n \n \n~; } else { $yymain .= qq~ \n \n \n~; } $count++; } $yymain .= qq~
$curmem   
$curmem   
~; $yytitle = "$txt{'9'}"; &template; 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); $yymain .= qq~
  $txt{'6'}

$txt{'735'}



$txt{'338'}




~; $yytitle = "$txt{'6'}"; &template; 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 clean_log { &is_admin; $yymain .= qq~
$txt{'202'}
$txt{'203'} $txt{'163'}  $txt{'164'}
~; $yytitle = $txt{'202'}; &template; exit; } sub do_clean_log { &is_admin; # Overwrite with a blank file fopen(FILE, ">$vardir/log.txt"); print FILE ''; fclose(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); fopen(FILE, "$vardir/ban_memname.txt"); @memnameban = ; fclose(FILE); $yymain .= qq~
$txt{'340'}

$txt{'724'}


$txt{'725'}


$txt{'725a'}


~; $yytitle = "$txt{'340'}"; &template; 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; $FORM{'ban_memname'} =~ tr/\r//d; $FORM{'ban_memname'} =~ s~\A[\s\n]+~~; $FORM{'ban_memname'} =~ s~[\s\n]+\Z~~; $FORM{'ban_memname'} =~ 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); fopen(FILE, ">$vardir/ban_memname.txt", 1); print FILE "$FORM{'ban_memname'}"; fclose(FILE); $yySetLocation = qq~$cgi;action=admin~; &redirectexit; } sub ver_detail { &is_admin; &loadfiles; $yymain .= qq~
 $txt{'429'}

$txt{'495'}

$txt{'494'}

$txt{'493'}

$txt{'496'}$YaBBversion
YaBB.$yyext$YaBBplver
$language$englishlngver
Admin.pl$adminplver
AdminEdit.pl$admineditplver
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
Printpage.pl$printplver
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
YaBBC.pl$yabbcplver

~; $yytitle = $txt{'429'}; &template; exit; } 1;