############################################################################### # Sessions.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 2.4 # # Packaged: April 12, 2009 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2009 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # # Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com # # Your source for web hosting, web design, and domains. # ############################################################################### $sessionsplver = 'YaBB 2.4 $Revision$'; if ($GLOBAL::ACTION eq 'detailedversion') { return 1; } &LoadLanguage('Sessions'); sub SessionReval { if (${$uid.$username}{'sesquest'} eq "" || ${$uid.$username}{'sesquest'} eq "password") { $sesremark = qq~

$session_txt{'10'}
~; $sesquestion = "password"; $sestype = "password"; } else { $sesremark = ""; $sesquestion = "${$uid.$username}{'sesquest'}"; $sestype = "text"; } $yymain .= qq~

$img_txt{'34a'}
$session_txt{'3'}

$session_txt{'4'}$sesremark

~; $yytitle = "$img_txt{'34a'}"; &template; } sub SessionReval2 { require "$sourcedir/Decoder.pl"; $FORM{'cookielength'} = 360; $FORM{'cookieneverexp'} = 1; &fatal_error("no_secret_answer") if ($FORM{'sesanswer'} eq ""); if (${$uid.$username}{'sesquest'} eq "" || ${$uid.$username}{'sesquest'} eq "password") { $question = ${$uid.$username}{'password'}; $answer = &encode_password("$FORM{'sesanswer'}"); chomp $answer; } else { $question = ${$uid.$username}{'sesanswer'}; $answer = &scramble($FORM{'sesanswer'}, $username); chomp $answer; } if ($answer ne $question) { &UpdateCookie("delete"); $username = 'Guest'; $iamguest = '1'; $iamadmin = ''; $iamgmod = ''; $password = ''; $yyim = ''; $ENV{'HTTP_COOKIE'} = ''; $yyuname = ''; $formsession = &cloak("$mbname$username"); require "$sourcedir/LogInOut.pl"; $sharedLogin_text = $session_txt{'6'}; $GLOBAL::ACTION = "login"; &Login; } else { $iamadmin = ${$uid.$username}{'position'} eq 'Administrator' ? 1 : 0; $iamgmod = ${$uid.$username}{'position'} eq 'Global Moderator' ? 1 : 0; $sessionvalid = 1; } if ($FORM{'cookielength'} < 1 || $FORM{'cookielength'} > 9999) { $FORM{'cookielength'} = $Cookie_Length; } if (!$FORM{'cookieneverexp'}) { $ck{'len'} = "\+$FORM{'cookielength'}m"; } else { $ck{'len'} = 'Sunday, 17-Jan-2038 00:00:00 GMT'; } ${$uid.$username}{'session'} = &encode_password($user_ip); &UserAccount($username, "update"); &UpdateCookie("write", $username, ${$uid.$username}{'password'}, ${$uid.$username}{'session'}, "/", $ck{'len'}); $redir = ""; if($FORM{'sredir'}) { my $tmpredir = $FORM{'sredir'}; $tmpredir =~ s/\~/\=/g; $tmpredir =~ s/x3B/;/g; $tmpredir =~ s/search2/search/g; $redir = qq~?$tmpredir~; } $yySetLocation = qq~$scripturl$redir~; &redirectexit; } 1;