#!/usr/bin/perl ##################################################### # LeoBBS X Plus 注册版本 / 雷傲极酷超级论坛注册版 # ##################################################### # 主页地址: http://www.LeoBBS.com/ # # 论坛地址: http://bbs.LeoBBS.com/ # ##################################################### BEGIN { $startingtime=(times)[0]+(times)[1]; foreach ($0,$ENV{'PATH_TRANSLATED'},$ENV{'SCRIPT_FILENAME'}){ my $LBPATH = $_; next if ($LBPATH eq ''); $LBPATH =~ s/\\/\//g; $LBPATH =~ s/\/[^\/]+$//o; unshift(@INC,$LBPATH); } } use LBCGI; $LBCGI::POST_MAX=500000; $LBCGI::DISABLE_UPLOADS = 1; $LBCGI::HEADERS_ONCE = 1; require "data/boardinfo.cgi"; require "data/styles.cgi"; require "bbs.lib.pl"; require "cleanolddata.pl"; $|++; eval ('$complevel = 9 if ($complevel eq ""); use WebGzip($complevel); $gzipused = 1;') if ($usegzip eq "yes"); $thisprog = "loginout.cgi"; $query = new LBCGI; &ipbanned; #封杀一些 ip if ($COOKIE_USED eq 2 && $mycookiepath ne "") { $cookiepath = $mycookiepath; } elsif ($COOKIE_USED eq 1) { $cookiepath =""; } else { $boardurltemp =$boardurl; $boardurltemp =~ s/http\:\/\/(\S+?)\/(.*)/\/$2/; $cookiepath = $boardurltemp; $cookiepath =~ s/\/$//; # $cookiepath =~ tr/A-Z/a-z/; } $inforum = $query -> param('forum'); &error("打开文件&老大,别乱黑我的程序呀!") if (($inforum) && ($inforum !~ /^[0-9]+$/)); if (-e "${lbdir}data/style${inforum}.cgi") { require "${lbdir}data/style${inforum}.cgi"; } for ('inmembername','inpassword','action','CookieDate','onlineview','viewMode','nodispavatar', 'nodispsign','nodispphoto','freshtime','hidden','selectstyle','tanchumsg') { next unless defined $_; next if $_ eq 'SEND_MAIL'; $tp = $query->param($_); $tp = &unHTML("$tp"); ${$_} = $tp; } $hidden = 0 if ($canhidden eq "no"); $CookieDate = "+1d" if ($CookieDate eq ""); $inselectstyle = $query->cookie("selectstyle"); $inselectstyle = $skinselected if ($inselectstyle eq ""); &error("普通错误&老大,别乱黑我的程序呀!") if (($inselectstyle =~ m/\//)||($inselectstyle =~ m/\\/)||($inselectstyle =~ m/\.\./)); if (($inselectstyle ne "")&&(-e "${lbdir}data/skin/${inselectstyle}.cgi")) {require "${lbdir}data/skin/${inselectstyle}.cgi";} if ($inpassword ne "") { eval {$inpassword = md5_hex($inpassword);}; if ($@) {eval('use Digest::MD5 qw(md5_hex);$inpassword = md5_hex($inpassword);');} unless ($@) {$inpassword = "lEO$inpassword";} } if (! $inmembername) { $inmembername = $query->cookie("amembernamecookie"); } if (! $inpassword) { $inpassword = $query->cookie("apasswordcookie"); } $inmembername =~ s/[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?]//isg; $inpassword =~ s/[\a\f\n\e\0\r\t\|\@\;\#\{\}\$]//isg; if ($catbackpic ne "") { $catbackpic = "background=$imagesurl/images/$skin/$catbackpic"; } if ($inmembername eq "" || $inmembername eq "客人") { $inmembername = "客人"; $userregistered = "no"; } else { &error("用户登陆&对不起,您输入的用户名有问题,请不要在用户名中包含\@\#\$\%\^\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?\[\]这类字符!") if ($inmembername =~ /[\a\f\n\e\0\r\t\`\~\!\@\#\$\%\^\&\*\(\)\+\=\\\{\}\;\'\:\"\,\.\/\<\>\?\[\]]/); &getmember("$inmembername","no"); &error("用户登录&对不起,用户名和密码输入错误!") if (($inpassword ne $password)&&($action ne "logout")); $inmembername = $membername; } $memberfilename = $inmembername; $memberfilename =~ s/ /\_/g; $memberfilename =~ tr/A-Z/a-z/; &getoneforum("$inforum"); #&moderator("$inforum"); #&title; &mischeader("登录/退出"); $output .= qq~

~; if ($action eq "login") { &cleanolddata; if (($userregistered ne "no") && ($inpassword eq $password)) { &whosonline("$inmembername\t论坛登录\tnone\t登录论坛\t"); if ($inforum eq "") { $refrashurl = "leobbs.cgi"; } else { $refrashurl = "forums.cgi?forum=$inforum"; } $output .= qq~
感谢你登录 $inmembername
具体情况:
~; if ($boarddispsign eq "no") { $nodispsign="yes"; } else { $nodispsign="no" if !($nodispsign); } $namecookie = cookie(-name => "amembernamecookie", -value => "$inmembername", -path => "$cookiepath/", -expires => "$CookieDate"); $passcookie = cookie(-name => "apasswordcookie", -value => "$inpassword", -path => "$cookiepath/", -expires => "$CookieDate"); $onlineviewcookie = cookie(-name => "onlineview", -value => "$onlineview", -path => "$cookiepath/", -expires => "$CookieDate"); $viewcookie = cookie(-name => "viewMode", -value => "$viewMode", -path => "$cookiepath/", -expires => "$CookieDate"); $freshtimecookie = cookie(-name => "freshtime", -value => "$freshtime", -path => "$cookiepath/", -expires => "$CookieDate"); $selectstylecookie = cookie(-name => "selectstyle", -value => "$selectstyle", -path => "$cookiepath/", -expires => "$CookieDate"); $tanchumsgcookie = cookie(-name => "tanchumsg", -value => "$tanchumsg", -path => "$cookiepath/", -expires => "$CookieDate"); $nodisp = cookie(-name => "nodisp", -value => "$nodispavatar|$nodispsign|$nodispphoto", -path => "$cookiepath/", -expires => "$CookieDate"); print header(-cookie=>[$onlineviewcookie,$threadcookie,$viewcookie, $nodisp, $freshtimecookie, $selectstylecookie, $tanchumsgcookie, $namecookie,$passcookie] , -expires=>"$EXP_MODE" , -cache=>"$CACHE_MODES"); } else { print header(-charset=>gb2312 , -expires=>"$EXP_MODE" , -cache=>"$CACHE_MODES"); $output .= qq~登录错误 登录错误的可能原因:

~; } } elsif ($action eq "logout") { &cleanolddata1; if ($inmembername ne "" && $inmembername ne "客人") { $filetoopen = "$lbdir" . "data/onlinedata.cgi"; my $filetoopens = &lockfilename($filetoopen); if (!(-e "$filetoopens.lck")) { &winlock($filetoopen) if ($OS_USED eq "Nt" || $OS_USED eq "Unix"); open(FILE,"$filetoopen"); flock(FILE, 1) if ($OS_USED eq "Unix"); sysread(FILE, my $onlinedata,(stat(FILE))[7]); close(FILE); $onlinedata =~ s/\r//isg; if (length($onlinedata) >= 80) { my $inmembername1 = $inmembername; $inmembername1 =~ s/\|/\\\|/isg; $onlinedata =~ s/(.*)(^|\n)$inmembername1\t(.*?)(\n|$)(.*)/$1$2$5/i; ($savedcometime, $savedtime, undef) = split(/\t/, $3); open(ONLINEFILE,">$filetoopen"); flock(ONLINEFILE, 2) if ($OS_USED eq "Unix"); print ONLINEFILE "$onlinedata"; close(ONLINEFILE); } else { unlink("$filetoopen"); } &winunlock($filetoopen) if ($OS_USED eq "Nt" || $OS_USED eq "Unix"); require "douplogintime.pl"; &uplogintime("$inmembername","") } else { unlink ("$filetoopens.lck") if ((-M "$filetoopens.lck") *86400 > 30); } } $output .= qq~您现在已经退出论坛 具体选项: ~; $namecookie = cookie(-name => "amembernamecookie", -value => "", -path => "$cookiepath/"); $passcookie = cookie(-name => "apasswordcookie", -value => "", -path => "$cookiepath/"); $trashcookie = cookie(-name => "templastvisit", -value => "", -path => "$cookiepath/"); $onlineviewcookie = cookie(-name => "onlineview", -value => "", -path => "$cookiepath/"); $viewcookie = cookie(-name => "viewMode", -value => "", -path => "$cookiepath/"); $nodisp = cookie(-name => "nodisp", -value => "", -path => "$cookiepath/"); $freshtimecookie = cookie(-name => "freshtime", -value => "", -path => "$cookiepath/"); $selectstylecookie = cookie(-name => "$selectstyle", -value => "", -path => "$cookiepath/"); $tanchumsgcookie = cookie(-name => "$tanchumsg", -value => "", -path => "$cookiepath/"); $banfreshcookie = cookie(-name => "banfresh" , -value => "", -path => "$cookiepath/"); $treeviewcookie = cookie(-name => "treeview" , -value => "", -path => "$cookiepath/"); $tecookie = cookie(-name => "catlog" , -value => "", -path => "$cookiepath/"); print header(-cookie=>[$banfreshcookie, $treeviewcookie, $tecookie, $namecookie, $passcookie, $trashcookie,$onlineviewcookie,$viewcookie, $nodisp, $freshtimecookie, $selectstylecookie, $tanchumsgcookie] , -expires=>"$EXP_MODE" , -cache=>"$CACHE_MODES"); } else { if ($query->cookie("selectstyle")) { $inselectstyle = $query->cookie("selectstyle"); } $inselectstyle = $skinselected if ($inselectstyle eq ""); if ($query->cookie("viewMode") ne "") { $checked ="checked"; $checked1 =""; } else { $checked1 ="checked"; $checked =""; } if ($query->cookie("tanchumsg") eq "") { $tcchecked ="checked"; $tcchecked1 =""; } else { $tcchecked1 ="checked"; $tcchecked =""; } if (($query->cookie("onlineview") == 1)||($query->cookie("onlineview") eq "")) { $online ="checked"; $online1 =""; } else { $online1 ="checked"; $online =""; } $nodisp = $query->cookie("nodisp"); ($nodispavatar, $nodispsign, $nodispphoto) = split(/\|/,$nodisp); if ($nodispavatar eq "yes"){ $checked2 ="checked" ; } if ($boarddispsign eq "no") { $checked3 ="checked disabled"; } elsif ($boarddispsign eq "noselect" && $nodispsign eq "") { $checked3 ="checked"; } elsif ($boarddispsign eq "noselect" && $nodispsign eq "yes") { $checked3 ="checked"; } elsif ($boarddispsign eq "noselect" && $nodispsign eq "no") { $checked3 ="" ; } elsif ($boarddispsign eq "yes" && $nodispsign eq "") { $checked3 =""; } elsif ($boarddispsign eq "yes" && $nodispsign eq "yes") { $checked3 ="checked"; } elsif ($boarddispsign eq "yes" && $nodispsign eq "no") { $checked3 =""; } if ($nodispphoto eq "yes") { $checked4 ="checked"; } print header(-charset=>gb2312 , -expires=>"$EXP_MODE" , -cache=>"$CACHE_MODES"); if ($inmembername ne "客人") { my $filetoopens = "$lbdir" . "data/onlinedata.cgi"; $filetoopens = &lockfilename($filetoopens); if (!(-e "$filetoopens.lck")) { &whosonline("$inmembername\t论坛登录\tnone\t登录论坛\t"); } } opendir (DIR, "${lbdir}data/skin"); @skindata = readdir(DIR); closedir (DIR); my $myskin=""; @skindata = grep(/\.cgi$/,@skindata); $topiccount = @skindata; @skindata=sort @skindata; for (my $i=0;$i<$topiccount;$i++){ $skindata[$i]=~s /\.cgi//isg; $myskin.=qq~~; } if ($canhidden ne "no") { $userhidden = qq~论坛隐身
请选择你的登录显示方式,可以适当保密你的隐私。


~; } else { $userhidden = ""; } $helpurl = &helpnewfiles("快速登录"); $helpurl = qq~$helpurl~; $output .= qq~
请输入您的用户名、密码登录 您目前的身份是: $inmembername ,要使用其他用户身份,请输入用户名和密码。未注册客人请输入网名,密码留空。 请输入您的用户名   您没有注册? 请输入您的密码   忘记密码? 论坛登录选项 $userhidden Cookie 选项
请选择你的 Cookie 保存时间,下次访问可以方便输入。
(在网吧等公共场所建议选择这个)


(在家里或使用自己的电脑时才可选择这个)
~; if ($advlogin == 1) { $advloginout = "true"; $advmode = qq~关闭高级登录选项 ~;} else { $advloginout = "none"; $advmode = qq~显示高级登录选项 ~;} $output .=qq~
~; if ($showskin ne "off") {$output.=qq~ ~;} $output.=qq~
在线列表 请选择你的在线名单显示方式,可以加快论坛显示。

查看贴子 请选择你喜好的查看贴子方式,可以方便阅读。

查看贴子内容 请选择查看贴子内容时候是否显示用户头像、签名和贴图。


风格设定 请选择你的论坛风格。
有短消息是否弹出?
(如果管理员设置了不弹出则此选择无效)


页面自动刷新时间
请输入分论坛首页自动刷新的时间(不输入则按照分论坛的默认设置进行刷新或者不刷新)
每隔 分钟自动刷新一次

$advmode


~; } $inselectstyle =~ s/\(/\\(/isg; $inselectstyle =~ s/\)/\\)/isg; $output =~ s/option value=\"$inselectstyle\"/option value=\"$inselectstyle\" selected/; &output("$boardname - 登录/退出",\$output); exit;