Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[r1081]: branches / 2.5.4 / cgi-bin / yabb2 / Sources / Sessions.pm Maximize Restore History

Download this file

Sessions.pm    124 lines (113 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
###############################################################################
# Sessions.pm #
# $Date: 2013-06-25 15:33:13 +0000 (Tue, 25 Jun 2013) $
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.5.4 #
# Packaged: July 1, 2013 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2013 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
our $VERSION = '2.5.4';
$sessionspmver = 'YaBB 2.5.4 $Revision: 1081 $';
if ( $action eq 'detailedversion' ) { return 1; }
LoadLanguage('Sessions');
get_template('Other');
sub SessionReval {
if ( ${ $uid . $username }{'sesquest'} eq q{}
|| ${ $uid . $username }{'sesquest'} eq 'password' )
{
$sesremark =
qq~<br /><br /><fieldset><i>$session_txt{'10'}</i></fieldset>~;
$sesquestion = 'password';
$sestype = 'password';
}
else {
$sesremark = q{};
$sesquestion = "${$uid.$username}{'sesquest'}";
$sestype = 'text';
}
$yymain .= $my_sessions;
$yymain =~ s/{yabb sesremark}/$sesremark/sm;
$yymain =~ s/{yabb sestype}/$sestype/sm;
$yymain =~ s/{yabb sesstext3}/$session_txt{'3'}/sm;
$yymain =~ s/{yabb sesstext4}/$session_txt{'4'}/sm;
$yymain =~ s/{yabb sesquestion}/$sesquest_txt{$sesquestion}/sm;
$yymain =~ s/{yabb sesredir}/$INFO{'sesredir'}/sm;
$yytitle = "$img_txt{'34a'}";
$yyjsstyle = 1;
template();
return;
}
sub SessionReval2 {
require Sources::Decoder;
$FORM{'cookielength'} = 360;
$FORM{'cookieneverexp'} = 1;
if ( $FORM{'sesanswer'} eq q{} ) { fatal_error('no_secret_answer'); }
if ( ${ $uid . $username }{'sesquest'} eq q{}
|| ${ $uid . $username }{'sesquest'} eq 'password' )
{
$question = ${ $uid . $username }{'password'};
$answer = encode_password("$FORM{'sesanswer'}");
chomp $answer;
}
else {
$question = descramble( ${ $uid . $username }{'sesanswer'}, $username );
$answer = $FORM{'sesanswer'};
# bug fix courtesy Derek Barnstorm;
chomp $answer;
}
if ( $answer ne $question ) {
UpdateCookie('delete');
$username = 'Guest';
$iamguest = '1';
$iamadmin = q{};
$iamgmod = q{};
$password = q{};
$yyim = q{};
local $ENV{'HTTP_COOKIE'} = q{};
$yyuname = q{};
$formsession = cloak("$mbname$username");
require Sources::LogInOut;
$sharedLogin_text = $session_txt{'6'};
$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);
chomp ${ $uid . $username }{'session'};
UserAccount( $username, 'update' );
UpdateCookie(
'write', $username,
${ $uid . $username }{'password'},
${ $uid . $username }{'session'},
q{/}, $ck{'len'}
);
$redir = q{};
if ( $FORM{'sredir'} ) {
my $tmpredir = $FORM{'sredir'};
$tmpredir =~ s/\~/\=/gxsm;
$tmpredir =~ s/x3B/;/gxsm;
$tmpredir =~ s/search2/search/gxsm;
$redir = qq~?$tmpredir~;
}
$yySetLocation = qq~$scripturl$redir~;
redirectexit();
return;
}
1;