############################################################################### # Profile.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 1 Gold - SP 1.1 # # Released: December 2001; Updated March 22, 2002 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2002 Xnull (www.xnull.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # ############################################################################### $profileplver = "1 Gold - SP 1.1"; sub ModifyProfile { if ($INFO{'username'} =~ m~/~){ &fatal_error($txt{'224'}); } if ($INFO{'username'} =~ m~\\~){ &fatal_error($txt{'225'}); } if ($INFO{'username'} =~ m~White_Hindu~){ &fatal_error($txt{'80a'}); } if($username ne $INFO{'username'} && $settings[7] ne 'Administrator') { &fatal_error($txt{'80'}); } if($allowpics) { opendir(DIR, "$facesdir") || fatal_error("$txt{'230'} ($facesdir)!$txt{'681'}"); closedir(DIR); } fopen(FILE, "$memberdir/$INFO{'username'}.dat"); @memsettings=; fclose(FILE); foreach (@memsettings) { $_ =~ s~[\n\r]~~g; } $dr = $memsettings[14] ? $memsettings[14] : $txt{'470'}; if ($memsettings[11] eq 'Male') { $GenderMale = ' selected'; } if ($memsettings[11] eq 'Female') { $GenderFemale = ' selected'; } $signature = $memsettings[5]; $signature =~ s/\&\&/\n/g; $signature =~ s/\<//g; &CalcAge("parse"); # Let's get the birthdate $memsettings[9] =~ tr/+/ /; $memsettings[10] =~ tr/+/ /; if ($memsettings[17] == 6) { $tsl6 = ' selected'; } elsif ($memsettings[17] == 5) { $tsl5 = ' selected'; } elsif($memsettings[17] == 4) { $tsl4 = ' selected'; } elsif ($memsettings[17] == 3) { $tsl3 = ' selected'; } elsif ($memsettings[17] == 2) { $tsl2 = ' selected'; } elsif ($memsettings[17] == 1) { $tsl1 = ' selected'; } elsif ($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'; } $dayormonthm = qq~$txt{'564'}~; $dayormonthd = qq~$txt{'565'}~; if ($tsl2 || $tsl3 || $tsl6) {$dayormonth=$dayormonthd.$dayormonthm;} else {$dayormonth=$dayormonthm.$dayormonthd;} $oldformat = $date; $oldmonth = substr($oldformat,0,2); $oldday = substr($oldformat,3,2); $oldyear = ("20".substr($oldformat,6,2)) - 1900; $oldhour = substr($oldformat,-8,2); $oldminute = substr($oldformat,-5,2); $oldsecond = substr($oldformat,-2,2); use Time::Local 'timelocal'; eval { $oldtime = timelocal($oldsecond,$oldminute,$oldhour,$oldday,$oldmonth-1,$oldyear); }; my ($psec,$pmin,$phour,$dummy,$dummy,$dummy,$dummy,$dummy,$dummy) = localtime($oldtime); if ($phour < 10) { $phour = "0$phour" }; if ($pmin < 10) { $pmin = "0$pmin" }; if ($psec < 10) { $psec = "0$psec" }; $proftime = $phour.":".$pmin.":".$psec; $ampm = $phour > 11 ? 'pm' : 'am'; $phour = $phour % 12 || 12; $proftime = qq~$phour:$pmin:$psec$ampm~; my( @imconfig, $sel0, $sel1 ); if (-e("$memberdir/$INFO{'username'}.imconfig")) { fopen(FILE, "$memberdir/$INFO{'username'}.imconfig"); @imconfig = ; fclose(FILE); } $imconfig[0] =~ s/[\n\r]//g; $imconfig[0] =~ s/\|/\n/g; $imconfig[1] =~ s/[\n\r]//g; if ($imconfig[1]) { $sel0=''; $sel1=' selected'; } else { $sel0=' selected'; $sel1=''; } $yymain .= qq~ $txt{'79'} $txt{'698'} $txt{'517'} $txt{'35'}: $INFO{'username'} $txt{'81'}: $txt{'596'} $txt{'82'}: $txt{'68'}: $txt{'518'} $txt{'69'}: $txt{'679'} ~; require "$sourcedir/ExtendedProfiles.pl"; $yymain .= ext_editprofile($INFO{'username'},"required") . qq~ $txt{'597'} ~; $yymain .= ext_editprofile($INFO{'username'},"additional") . qq~ $txt{'231'}: $txt{'238'} $txt{'239'} $txt{'563'}: $dayormonth$txt{'566'} $txt{'227'}: $txt{'83'}: $txt{'598'} $txt{'84'}: $txt{'599'} $txt{'513'}: $txt{'600'} $txt{'603'}: $txt{'601'} $txt{'604'}: $txt{'602'} $txt{'228'}: ~; if($allowpics) { opendir(DIR, "$facesdir") || fatal_error("$txt{'230'} ($facesdir)!$txt{'681'}"); @contents = readdir(DIR); closedir(DIR); $images = ""; foreach $line (sort @contents){ ($name, $extension) = split (/\./, $line); $checked = ""; if ($line eq $memsettings[13]) { $checked = ' selected'; } if ($memsettings[13] =~ m~\Ahttp://~ && $line eq 'blank.gif') { $checked = ' selected'; } if ($extension =~ /gif/i || $extension =~ /jpg/i || $extension =~ /jpeg/i || $extension =~ /png/i ){ if ($line eq 'blank.gif') { $name = $txt{'422'}; } $images .= qq~$name\n~; } } if ($memsettings[13] =~ m~\Ahttp://~) { $pic = 'blank.gif'; $checked = ' checked'; $tmp = $memsettings[13]; } else { $pic = $memsettings[13]; $tmp = 'http://'; } $yymain .= qq~ $txt{'229'}: $txt{'474'} $userpic_limits $images $txt{'475'} ~; } $yymain .= qq~ $imtxt{'38'} $txt{'325'}:$txt{'326'} $imconfig[0] ~; if($enable_mailsounds) { # sounds hack chomp($imconfig[2]); opendir(DIR, "$soundsdir") || fatal_error("$txt{'230'} ($soundsdir)!$imtxt{'27'}"); @contents = readdir(DIR); closedir(DIR); $sounds = ""; if ($imconfig[2] eq "blank.wav" || $imconfig[2] eq "") { $sounds = qq~$imtxt{'28'}\n~; } else { $sounds = qq~$imtxt{'28'}\n~; } foreach $line (sort @contents) { chomp($line); ($name, $extension) = split (/\./, $line); $checked = ""; if ($line eq "$imconfig[2]") { $checked = ' selected'; } if($extension =~ /wav/i) { $sounds .= qq~$name\n~; } } $yymain .= qq~ $imtxt{'29'}:$sounds~; } else { $yymain .= qq~~; } if($enable_notification) { $yymain .= qq~ $txt{'327'}: $txt{'164'} $txt{'163'} ~; } else { $yymain .= qq~~; } chomp($imconfig[4]); if($imconfig[4] eq "on") { $enable_imprev = 'checked'; } $yymain .= qq~$imtxt{'51'}:~; if($enable_mailpopup) { chomp($imconfig[3]); chomp($imconfig[5]); if($imconfig[3] eq "on") { $enable_userimpopup = 'checked'; } if($imconfig[5] eq "on") { $popup_userim = 'checked'; } $yymain .= qq~ $imtxt{'05'}: $imtxt{'53'}:~; } else { $yymain .= qq~ ~; } chomp($imconfig[6]); $imconfig[7] =~ s~~\n~ig; if($imconfig[6] eq "on") { $send_away_im = 'checked'; } $yymain .= qq~ $imtxt{'80'} $imtxt{'82'}$imtxt{'81'} $imconfig[7] $txt{'605'} ~; if ($allow_hide_email) { $yymain .= qq~ $txt{'721'} ~; } $yymain .= qq~ $txt{'486'}: $txt{'479'} $txt{'480'} $txt{'484'} $txt{'483'} $txt{'481'} $txt{'482'} $txt{'485'} $txt{'371'}: $txt{'519'} $txt{'741'}: $proftime $txt{'85'}: $txt{'606'} $signature $txt{'664'} ~; fopen(FILE, "$vardir/membergroups.txt"); @lines = ; fclose(FILE); if($settings[7] eq 'Administrator') { $position=''; foreach $curl (@lines) { if($curl ne $lines[1] && $curl ne $lines[2] && $curl ne $lines[3] && $curl ne $lines[4] && $curl ne $lines[5] && $curl ne $lines[6]) { if($curl ne $lines[0]) { $position= qq~$position$curl~; } else { $position= qq~$position$curl~; } } } if($memsettings[7] eq 'Administrator') { $tt = $lines[0]; } else { $tt = $memsettings[7]; } $yymain .= qq~ $txt{'86'}: $txt{'87'}: $tt --------------- $position $txt{'233'}: $txt{'421'} ~; } if($settings[7] eq 'Administrator') { $confdel_text = "$txt{'775'} $txt{'777'} $INFO{'username'} $txt{'778'}"; } else { $confdel_text = "$txt{'775'} $txt{'776'} $txt{'778'}"; } $yymain .= qq~ ~; $yytitle = $txt{'79'}; &template; exit; } sub ModifyProfile2 { my( $ignorelist, $notify, $sound, $popup, $imprev, $imspop, $enableaim, $awayim); $ignorelist = "$FORM{'ignore'}"; $notify = "$FORM{'notify'}"; $sound = "$FORM{'usersound'}"; $popup = "$FORM{'userpopup'}"; $imprev = "$FORM{'imprev'}"; $imspop = "$FORM{'popupims'}"; $awayim = "$FORM{'awayim'}"; $enableaim = "$FORM{'sendaim'}"; $ignorelist =~ s~\A\n\s*~~; $ignorelist =~ s~\s*\n\Z~~; $ignorelist =~ s~\n\s*\n~\n~g; $ignorelist =~ s~[\n\r]~\|~g; $ignorelist =~ s~\|\|~\|~g; $notify =~ s~[\n\r]~~g; $sound =~ s~[\n\r]~~g; $popup =~ s~[\n\r]~~g; $imprev =~ s~[\n\r]~~g; $imspop =~ s~[\n\r]~~g; $enableaim =~ s~[\n\r]~~g; $awayim =~ s~[\n]~~g; my( %member, $key, $value, $newpassemail, @memberlist, $a, @check_settings, @reserve, $matchword, $matchcase, $matchuser, $matchname, $namecheck, $reserved, $reservecheck, @dirdata, $filename, @entries, $entry, $umail, @members, $tempname ); $FORM{'signature'} =~ s~\n~\&\&~g; while( ($key,$value) = each(%FORM) ) { $value =~ s~\A\s+~~; $value =~ s~\s+\Z~~; $value =~ s~[\n\r]~~g; $member{$key} = $value; } # make sure this person has access to this profile if($username ne $member{'username'} && $settings[7] ne 'Administrator') { &fatal_error($txt{'80'}); } if( $settings[7] ne 'Administrator' ) { $member{'username'} = $username; $member{'settings6'} = $settings[6]; $member{'settings7'} = $settings[7]; } if($member{'settings6'} !~ /\A[0-9]+\Z/) { &fatal_error("$txt{'749'}"); } if ($member{'username'} =~ /\//){ &fatal_error($txt{'224'}); } if ($member{'username'} =~ /\\/){ &fatal_error($txt{'225'}); } $INFO{'username'} = $member{'username'}; if(length($member{'usertext'}) > 51) { &fatal_error("$txt{'757'}"); } if( $member{'userpicpersonalcheck'} && ( $member{'userpicpersonal'} =~ m/\.gif\Z/i || $member{'userpicpersonal'} =~ m/\.jpg\Z/i || $member{'userpicpersonal'} =~ m/\.jpeg\Z/i || $member{'userpicpersonal'} =~ m/\.png\Z/i ) ) { $member{'userpic'} = $member{'userpicpersonal'}; } if($member{'userpic'} eq "") { $member{'userpic'} = "blank.gif"; } &fatal_error("$txt{'592'}") if($member{'userpic'} !~ m^\A[0-9a-zA-Z_\.\#\%\-\:\+\?\$\&\~\.\,\@/]+\Z^); if(!$allowpics) { $member{'userpic'} = "blank.gif"; } if( $emailnewpass && lc $member{'email'} ne lc $settings[2] && $settings[7] ne 'Administrator') { srand(); $member{'passwrd1'} = int( rand(100) ); $member{'passwrd1'} =~ tr/0123456789/ymifxupbck/; $_ = int( rand(77) ); $_ =~ tr/0123456789/q8dv7w4jm3/; $member{'passwrd1'} .= $_; $_ = int( rand(89) ); $_ =~ tr/0123456789/y6uivpkcxw/; $member{'passwrd1'} .= $_; $_ = int( rand(188) ); $_ =~ tr/0123456789/poiuytrewq/; $member{'passwrd1'} .= $_; $_ = int( rand(65) ); $_ =~ tr/0123456789/lkjhgfdaut/; $member{'passwrd1'} .= $_; $newpassemail = 1; } else { &fatal_error("($member{'username'}) $txt{'213'}") if($member{'passwrd1'} ne $member{'passwrd2'}); &fatal_error("($member{'username'}) $txt{'91'}") if($member{'passwrd1'} eq ''); &fatal_error("$txt{'240'} $txt{'36'} $txt{'241'}") if($member{'passwrd1'} !~ /\A[\s0-9A-Za-z!@#$%\^&*\(\)_\+|`~\-=\\:;'",\.\/?\[\]\{\}]+\Z/); } &fatal_error("$txt{'75'}") if($member{'name'} eq ''); &fatal_error("$txt{'240'} $txt{'68'} $txt{'241'}") if($member{'name'} !~ /^[\s0-9A-Za-zöäüÖÄÜßñ\[\]#%+,-|\.:=?@^_]+$/); &fatal_error("$txt{'75'}") if($member{'name'} eq '|'); &fatal_error("$txt{'568'}") if(length($member{'name'}) > 30); &fatal_error("$txt{'76'}") if($member{'email'} eq ''); &fatal_error("$txt{'240'} $txt{'69'} $txt{'241'}") if($member{'email'} !~ /^[0-9A-Za-z@\._\-]+$/); &fatal_error("$txt{'500'}") if(($member{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/) || ($member{'email'} !~ /^.+@\[?(\w|[-.])+\.[a-zA-Z]{2,4}|[0-9]{1,4}\]?$/)); if( $member{'bday1'} ne "" || $member{'bday1'} ne "" || $member{'bday1'} ne "" ) { &fatal_error("$txt{'567'}") if( $member{'bday1'} !~ /^[0-9]+$/ || $member{'bday2'} !~ /^[0-9]+$/ || $member{'bday3'} !~ /^[0-9]+$/ || length($member{'bday3'}) < 4 ); &fatal_error("$txt{'567'}") if( $member{'bday1'} < 1 || $member{'bday1'} > 12 || $member{'bday2'} < 1 || $member{'bday2'} > 31 || $member{'bday3'} < 1901 || $member{'bday3'} > $year-5 ); } &fatal_error("$txt{'680'}") if ($member{'username'} eq "admin" && $member{'settings7'} ne "Administrator"); if($member{'moda'} eq $txt{'88'}) { if (length($member{'signature'}) > $MaxSigLen) { $member{'signature'} = substr($member{'signature'},0,$MaxSigLen); } $member{'icq'} =~ s/[^0-9]//g; $member{'bday1'} =~ s/[^0-9]//g; $member{'bday2'} =~ s/[^0-9]//g; $member{'bday3'} =~ s/[^0-9]//g; if($member{'bday1'}) { $member{'bday'} = "$member{'bday1'}/$member{'bday2'}/$member{'bday3'}"; } else { $member{'bday'} = ''; } $member{'signature'} =~ s/</g; $member{'signature'} =~ s/>/g; $member{'aim'} =~ s/ /\+/g; $member{'yim'} =~ s/ /\+/g; if($settings[7] ne "Administrator") { $member{'dr'} = $settings[14]; } # store the name temorarily so we can restore any _'s later $tempname = $member{'name'}; $member{'name'} =~ s/\_/ /g; &ToHTML($member{'location'}); &ToHTML($member{'aim'}); &ToHTML($member{'yim'}); &ToHTML($member{'gender'}); &ToHTML($member{'usertext'}); &ToHTML($member{'websiteurl'}); &ToHTML($member{'websitetitle'}); &ToHTML($member{'email'}); &ToHTML($FORM{'hideemail'}); &ToHTML($member{'name'}); &FromHTML($member{'usertext'}); $member{'usertext'} =~ s~(\S{15})(?=\S)~$1 ~g; &ToHTML($member{'usertext'}); if ( length $member{'signature'} > 1000 ) { $member{'signature'} = substr( $member{'signature'}, 0, 1000 ); } $member{'usertimeoffset'} =~ tr/,/./; $member{'usertimeoffset'} =~ s/[^\d*|\.|\-|w*]//g; if (( $member{'usertimeoffset'} < -23.5) || ( $member{'usertimeoffset'} > 23.5)) { &fatal_error($txt{'487'}); } fopen(FILE, "$memberdir/memberlist.txt"); @memberlist = ; fclose(FILE); $testname = lc $member{'name'}; for ($a = 0; $a < @memberlist; $a++) { chomp $memberlist[$a]; $membername = lc $memberlist[$a]; if( fopen(FILE2, "$memberdir/$memberlist[$a].dat") ) { # Load users and check email (removed !$yyUDLoaded{$memberlist[$a]} && ) if( -e("$memberdir/$memberlist[$a].dat") && lc $memberlist[$a] ne lc $member{'username'}) { # If user is not in memory, s/he must be loaded. &LoadUser($memberlist[$a]); if(lc $userprofile{$memberlist[$a]}->[2] eq lc $member{'email'}) { &fatal_error("$txt{'730'} ($member{'email'}) $txt{'731'}"); } } $tmpa = ; $realnametemp = ; fclose(FILE2); chomp $realnametemp; $realnametemp = lc $realnametemp; if ($realnametemp eq $testname && lc $memberlist[$a] ne lc $member{'username'} && $settings[7] ne 'Administrator') { &fatal_error("($member{'name'}) $txt{'473'}"); } } } fopen(FILE, "$vardir/reserve.txt") || &fatal_error("$txt{'23'} reserve.txt"); @reserve = ; fclose(FILE); fopen(FILE, "$vardir/reservecfg.txt") || &fatal_error("$txt{'23'} reservecfg.txt"); @reservecfg = ; fclose(FILE); for($a = 0; $a < @reservecfg; $a++) { chomp $reservecfg[$a]; } $matchword = $reservecfg[0] eq 'checked'; $matchcase = $reservecfg[1] eq 'checked'; $matchuser = $reservecfg[2] eq 'checked'; $matchname = $reservecfg[3] eq 'checked'; $namecheck = $matchcase eq 'checked' ? $member{'name'} : lc $member{'name'}; foreach $reserved (@reserve) { chomp $reserved; $reservecheck = $matchcase ? $reserved : lc $reserved; if ($matchname) { if ($matchword) { if ($namecheck eq $reservecheck) { &fatal_error("$txt{'244'} $reserved"); } } else { if ($namecheck =~ $reservecheck) { &fatal_error("$txt{'244'} $reserved"); } } } } # let's restore the name now &ToHTML($tempname); $member{'name'} = $tempname; fopen(FILE, "+>$memberdir/$member{'username'}.imconfig"); print FILE "$ignorelist\n$notify\n$sound\n$popup\n$imprev\n$imspop\n$enableaim\n$awayim"; fclose(FILE); require "$sourcedir/ExtendedProfiles.pl"; my $error = &ext_validate_submition($member{'username'},$username); if ($error ne "") { &fatal_error($error); } else { &ext_saveprofile($member{'username'}); } fopen( FILE, ">$memberdir/$member{'username'}.dat", 1); print FILE "$member{'passwrd1'}\n"; print FILE "$member{'name'}\n"; print FILE "$member{'email'}\n"; print FILE "$member{'websitetitle'}\n"; print FILE "$member{'websiteurl'}\n"; print FILE "$member{'signature'}\n"; print FILE "$member{'settings6'}\n"; print FILE "$member{'settings7'}\n"; print FILE "$member{'icq'}\n"; print FILE "$member{'aim'}\n"; print FILE "$member{'yim'}\n"; print FILE "$member{'gender'}\n"; print FILE "$member{'usertext'}\n"; print FILE "$member{'userpic'}\n"; print FILE "$member{'dr'}\n"; print FILE "$member{'location'}\n"; print FILE "$member{'bday'}\n"; print FILE "$member{'usertimeselect'}\n"; print FILE "$member{'usertimeoffset'}\n"; if ($FORM{'hideemail'} ne "checked") { $FORM{'hideemail'} = ""; } print FILE "$FORM{'hideemail'}\n"; fclose(FILE); if($newpassemail) { # Write log fopen(LOG, "$vardir/log.txt"); @entries = ; fclose(LOG); fopen(LOG, ">$vardir/log.txt", 1); $field="$username"; foreach $curentry (@entries) { $curentry =~ s/\n//g; ($name, $value) = split(/\|/, $curentry); if($name ne "$field") { print LOG "$curentry\n"; } } fclose(LOG); $yySetCookies1 = cookie(-name => "$cookieusername", -value => "", -path => "/", -expires => "Thursday, 01-Jan-1970 00:00:00 GMT"); $yySetCookies2 = cookie(-name => "$cookiepassword", -value => "", -path => "/", -expires => "Thursday, 01-Jan-1970 00:00:00 GMT"); $username = 'Guest'; $password = ''; @settings = (); $realname = ''; $realemail = ''; $ENV{'HTTP_COOKIE'} = ''; &FormatUserName($member{'username'}); # Advanced System eMails Mod &advsendmail3(5,$member{'email'},$member{'username'},$member{'passwrd1'}); # End Advanced System eMails Mod $yymain .= qq~~; require "$sourcedir/LogInOut.pl"; $sharedLogin_title="$txt{'34'}"; $sharedLogin_text="$txt{'638'}"; &sharedLogin; $yymain .= qq~~; $yytitle="$txt{'245'}"; &template; exit; } else { if ($member{'username'} eq $username) { $password = crypt("$member{'passwrd1'}",$pwseed); $yySetCookies1 = cookie(-name => "$cookieusername", -value => "$username", -path => "/", -expires => "Sunday, 17-Jan-2038 00:00:00 GMT"); $yySetCookies2 = cookie(-name => "$cookiepassword", -value => "$password", -path => "/", -expires => "Sunday, 17-Jan-2038 00:00:00 GMT"); &LoadUserSettings; &WriteLog; } &ViewProfile; } } else { if($member{'username'} ne "admin") { # For security, remove username from mod position fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); foreach $curcat (@categories) { $curcat =~ s/[\n\r]//g; fopen(CAT, "$boardsdir/$curcat.cat"); @catinfo = ; fclose(CAT); foreach $curboard (@catinfo) { $curboard =~ s/[\n\r]//g; chomp $curboard; fopen(BOARD, "$boardsdir/$curboard.dat"); @boardinfo = ; fclose(BOARD); $boardinfo[2] =~ s/[\n\r]//g; $boardinfo[2] =~ /^\|(.*?)\|$/; $mods = $1 or $mods = $boardinfo[2]; $mods =~ s/\|(\S?)/,$1/g; $mods_changed=0; if($settings[7] eq 'Administrator' && $mods =~ /(,*)$member{'username'}(,*)/g) {$mods =~ s~(,*)$member{'username'}(,*)~~; $mods_changed=1;} elsif($member{'username'} eq $username && $mods =~ /(,*)$username(,*)/g) {$mods =~ s~(,*)$username(,*)~~; $mods_changed=1;} if ($mods_changed == 1) { $boardinfo[2] = $mods; fopen(BOARD, ">$boardsdir/$curboard.dat", 1); print BOARD @boardinfo; fclose(BOARD); } } } if($settings[7] eq 'Administrator') { # Advanced System eMails Mod &advsendmail3(14,$webmaster_email,$member{'username'},""); # to webmaster &advsendmail3(16,$member{'email'},$member{'username'},""); # to member # End Advanced System eMails Mod unlink("$memberdir/$member{'username'}.dat"); unlink("$memberdir/$member{'username'}.msg"); unlink("$memberdir/$member{'username'}.log"); unlink("$memberdir/$member{'username'}.outbox"); unlink("$memberdir/$member{'username'}.imconfig"); unlink("$memberdir/$member{'username'}.ext"); unlink("$memberdir/$member{'username'}.buddy"); unlink("$memberdir/$member{'username'}.storage"); unlink("$memberdir/$member{'username'}.ll"); } elsif( $member{'username'} eq $username ) { # Advanced System eMails Mod &advsendmail3(13,$webmaster_email,$username,""); # End Advanced System eMails Mod unlink("$memberdir/$username.dat"); unlink("$memberdir/$username.msg"); unlink("$memberdir/$username.log"); unlink("$memberdir/$username.outbox"); unlink("$memberdir/$username.imconfig"); unlink("$memberdir/$username.ext"); unlink("$memberdir/$username.buddy"); unlink("$memberdir/$username.storage"); unlink("$memberdir/$username.ll"); } opendir (DIRECTORY,"$datadir"); @dirdata = readdir(DIRECTORY); closedir (DIRECTORY); if($settings[7] eq 'Administrator') { $umail=$member{'email'}; } else { $umail=$settings[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 $member{'username'}) { 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); if($settings[7] ne 'Administrator') { require "$sourcedir/LogInOut.pl"; &Logout; } $yySetLocation = qq~$scripturl~; &redirectexit; } else { &fatal_error("$txt{'751'}"); } } exit; } sub ViewProfile { if ($INFO{'username'} =~ /\//){ &fatal_error("$txt{'224'}" ); } if ($INFO{'username'} =~ /\\/){ &fatal_error("$txt{'225'}" ); } if(!-e ("$memberdir/$INFO{'username'}.dat")){ &fatal_error("$txt{'453'} -- $INFO{'username'}"); } my($memberinfo, $modify, $email, $gender, $pic); # get the member's info fopen(FILE, "$memberdir/$INFO{'username'}.dat"); @memsettings=; fclose(FILE); chomp @memsettings; $icq = $memsettings[8]; $memsettings[5] =~ s~\&\&~~g; $message = $memsettings[5]; if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } $showursig = $message; if($memsettings[4] !~ m~\Ahttp://~) { $memsettings[4] = "http://$memsettings[4]"; } $memsettingsd[9] = $memsettings[9]; $memsettingsd[9] =~ tr/+/ /; $memsettingsd[10] = $memsettings[10]; $memsettingsd[10] =~ tr/+/ /; $dr = ""; if ($memsettings[14] eq "") { $dr = "$txt{'470'}"; } else { $dr = "$memsettings[14]"; $dr = &timeformat($dr); } &CalcAge("calc"); # How old is he/she? &CalcAge("isbday"); # is it the bday? if($isbday) { $isbday = ""; } fopen(FILE, "$vardir/membergroups.txt"); @membergroups = ; fclose(FILE); if($memsettings[6] > $GodPostNum) { $memberinfo = "$membergroups[6]"; } elsif($memsettings[6] > $SrPostNum) { $memberinfo = "$membergroups[5]"; } elsif($memsettings[6] > $FullPostNum) { $memberinfo = "$membergroups[4]"; } elsif($memsettings[6] > $JrPostNum) { $memberinfo = "$membergroups[3]"; } else { $memberinfo = "$membergroups[2]"; } if($memsettings[7] ne "") { $memberinfo = "$memsettings[7]"; } if($memsettings[7] eq "Administrator") { $memberinfo = "$membergroups[0]"; } &FormatUserName($INFO{'username'}); if ($username eq $INFO{'username'} || $settings[7] eq "Administrator") { $modify = qq~« $txt{'17'} »~; } if ($memsettings[19] ne "checked" || $settings[7] eq "Administrator" || !$allow_hide_email) { $email = qq~$memsettings[2]~; } else { $email = qq~$txt{'722'}~; } $gender = ""; if ($memsettings[11] eq "Male") { $gender = qq~$txt{'238'}~; } if ($memsettings[11] eq "Female") { $gender = qq~$txt{'239'}~; } if($allowpics) { if ($memsettings[13] =~ /^\http:\/\// ) { if ($userpic_width ne 0) { $tmp_width = "width=$userpic_width"; } else { $tmp_width=""; } if ($userpic_height ne 0) { $tmp_height = "height=$userpic_height"; } else { $tmp_height=""; } $pic = qq~~; $pic = qq~~; } else { $pic = qq~~; $pic = qq~~; } } $online = "$txt{'113'} ?"; fopen(FILE, "$vardir/log.txt"); @entries = ; fclose(FILE); foreach $curentry (@entries) { chomp $curentry; ($name, $value) = split(/\|/, $curentry); if($name) { &LoadUser($name); if(lc $name eq lc $INFO{'username'}) { $online =~ s~\?~$txt{'686'}.~; } } } fopen(FILE, "$memberdir/$INFO{'username'}.ll"); my ($userlastlogin, $userlastpost, $userlastim) = ; fclose(FILE); $userlastlogin =~ s/\n//g; $userlastlogin = &timeformat($userlastlogin); $userlastpost =~ s/\n//g; $userlastpost = &timeformat($userlastpost); $userlastim =~ s/\n//g; $userlastim = &timeformat($userlastim); if ($userlastlogin eq "") { $userlastlogin = "$txt{'470'}"; } if ($userlastpost eq "") { $userlastpost = "$txt{'470'}"; } if ($userlastim eq "") { $userlastim = "$txt{'470'}"; } $online =~ s~\?~$txt{'687'}.~; if($memsettings[6] > 100000) { $memsettings[6] = "$txt{'683'}"; } if($username ne $INFO{'username'} && $enable_buddies) { $add2bud = qq~$imtxt{'37'}.~; } else { $add2bud = qq~~; } $yymain .= qq~ $txt{'35'}: $INFO{'username'} $modify $txt{'232'} $txt{'68'}: $memsettings[1] $txt{'86'}: $memsettings[6] $txt{'87'}: $memberinfo $txt{'233'}: $dr ~; if( $settings[7] eq 'Administrator' || $settings[7] eq 'Global Moderator') { $yymain .= qq~ $amv_txt{'9'}: $userlastlogin $amv_txt{'10'}: $userlastpost $amv_txt{'11'}: $userlastim ~; } $yymain .= qq~ ~; require "$sourcedir/ExtendedProfiles.pl"; $yymain .= ext_viewprofile($INFO{'username'}) . qq~ $txt{'513'}: ~; if( $memsettings[8] ne "" && $memsettings[8] !~ m~\D~ ) {$yymain .= qq~ $memsettings[8]~;} $yymain .= qq~ $txt{'603'}: $memsettingsd[9] $txt{'604'}: ~; if( $memsettings[10] ne "") {$yymain .= qq~ $memsettingsd[10]~;} $yymain .= qq~ $txt{'69'}: $email $txt{'96'}: $memsettings[3] $txt{'231'}: $gender $txt{'420'}: $age $isbday $txt{'227'}: $memsettings[15] $pic $memsettings[12] ~; if ($memsettings[5] ne ''){ if ($username eq $INFO{'username'} || $settings[7] eq 'Administrator' || $settings[7] eq 'Global Moderator') { $yymain .= qq~ $txt{'226'}: $txt{'226a'} $memsettings[5] $txt{'226'}: $txt{'226b'} $showursig ~; } else { $yymain .= qq~ $txt{'226'}: $showursig ~; } }else { $yymain .= qq~ $txt{'226'}: $txt{'164'} $txt{'226'} ~; } $yymain .= qq~ $txt{'459'}: $online $txt{'688'}. $add2bud $txt{'460'} 5 10 50 $txt{'190'} $txt{'461'}. ~; $yytitle = "$txt{'92'} $INFO{'username'}"; &template; exit; } sub usersrecentposts { my $curuser = $INFO{'username'}; &FormatUserName($curuser); if ($curuser =~ m~/~){ &fatal_error($txt{'224'}); } if ($curuser =~ m~\\~){ &fatal_error($txt{'225'}); } my $display = $FORM{'viewscount'}; if( $display =~ /\D/ ) { &fatal_error($txt{'337'}); } $display ||= 999999999; my( @memset, @categories, %data, %cat, $numfound, $oldestfound, $curcat, %catname, %cataccess, %catboards, $openmemgr, @membergroups, $tmpa, %openmemgr, $curboard, @threads, @boardinfo, $i, $c, @messages, $tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $mns, $mtime, $counter, $board, $notify ); fopen(FILE, "$memberdir/$curuser.dat") || &fatal_error("$txt{'23'} $curuser.txt"); @memset = ; fclose(FILE); @categories = (); fopen(FILE, "$vardir/cat.txt"); @categories = ; fclose(FILE); &LoadCensorList; # Load Censor List $oldestfound = stringtotime("01/10/37 $txt{'107'} 00:00:00"); foreach $curcat (@categories) { chomp $curcat; fopen(FILE, "$boardsdir/$curcat.cat"); $catname{$curcat} = ; chomp $catname{$curcat}; $cataccess{$curcat} = ; chomp $cataccess{$curcat}; @{$catboards{$curcat}} = ; fclose(FILE); $openmemgr{$curcat} = 0; @membergroups = split( /,/, $cataccess{$curcat} ); foreach $tmpa (@membergroups) { if( $tmpa eq $settings[7]) { $openmemgr{$curcat} = 1; last; } } if( ! $cataccess{$curcat} || $settings[7] eq 'Administrator' ) { $openmemgr{$curcat} = 1; } unless( $openmemgr{$curcat} ) { next; } boardcheck: foreach $curboard (@{$catboards{$curcat}}) { #### unless ($settings[7] eq "Administrator") { my $cookiename = "$cookiepassword$curboard"; my $crypass = crypt($boardpw{$curboard},$pwseed); my $access = &AccessCheck($curboard, ''); if (($boardpw{$curboard} && $yyCookies{$cookiename} ne $crypass) || ($access ne "granted")) { next; } } #### chomp $curboard; fopen(FILE, "$boardsdir/$curboard.txt"); @threads = ; fclose(FILE); fopen(FILE, "$boardsdir/$curboard.dat"); @boardinfo = ; fclose(FILE); foreach (@boardinfo) { chomp; } @{$boardinfo{$curboard}} = @boardinfo; $cat{$curboard} = $curcat; threadcheck: for ($i = 0; $i < @threads; $i++) { chomp $threads[$i]; ($tnum, $tsub, $tname, $temail, $tdate, $treplies, $tusername, $ticon, $tstate) = split( /\|/, $threads[$i] ); fopen(FILE, "$datadir/$tnum.txt") || next; @messages = ; fclose(FILE); for ($c = 0; $c < @messages; $c++) { chomp $messages[$c]; ($msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = split(/\|/,$messages[$c]); if ($curuser eq $musername) { $mtime = stringtotime($mdate); if( $numfound >= $display && $mtime <= $oldestfound ) { next boardcheck; } else { $data{$mtime} = [$curboard, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns]; if( $mtime < $oldestfound ) { $oldestfound = $mtime; } ++$numfound; } } } } } } $yymain .= qq~ $txt{'92'} $memset[1] ~; @messages = sort {$b <=> $a } keys %data; if( @messages > $display ) { $#messages = $display - 1; } $counter = 1; for( $i = 0; $i < @messages; $i++ ) { ($board, $tnum, $c, $msub, $mname, $memail, $mdate, $musername, $micon, $mattach, $mip, $message, $mns) = @{ $data{$messages[$i]} }; foreach (@censored) { ($tmpa,$tmpb) = @{$_}; $message =~ s~\Q$tmpa\E~$tmpb~gi; $msub =~ s~\Q$tmpa\E~$tmpb~gi; } &wrap; $displayname = $mname; if($enable_ubbc) { $ns = $mns; if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; } &wrap2; if($enable_notification) { $notify = qq~$menusep$img{'notify'}~; } $mdate = timeformat($mdate); $yymain .= qq~ $counter $catname{$cat{$board}} / $boardinfo{$board}->[0] / $msub $txt{'30'}: $mdate $message $img{'reply'}$menusep$img{'replyquote'}$notify ~; ++$counter; } if($counter <= 1) { $yymain .= "$txt{'755'}"; } else { $yymain .= qq~ $txt{'92'} $memset[1] ~; } $yytitle = "$txt{'458'} $memset[1]"; &template; exit; } 1;
$txt{'92'} $memset[1]