Page Index Toggle Pages: 1
Topic Tools
Normal Topic [Standard] [CVS] Banned User and Last Online Time (Read 4,019 times)
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
[Standard] [CVS] Banned User and Last Online Time
Aug 4th, 2009 at 8:08pm
Post Tools
If banned user trying to login, the Last Online Time in View Proifle is updated to current trying Login Time.
« Last Edit: Mar 25th, 2010 at 3:01am by »  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Unilat
Development Team
Theme Team
****
Offline



Posts: 1,047
Location: Columbus Ohio, USA
Re: [Standard] [CVS] Banned User and Last Online Time
Reply #1 - Jun 20th, 2010 at 3:46am
Post Tools
Here's the fix!

Made login2 action not update the last login time first off. Also, made the banning subroutine not only change $username to Guest, but set $iamguest to true to make sure the banner and tabs display as if you have not logged in.

In Load.pl add highlighted:
Code
Select All
			fopen(LOADUSER, "+<$memberdir/$user.$userextension") || &fatal_error('cannot_open', "$memberdir/$user.$userextension", 1);
			my @settings = <LOADUSER>;
			for (my $i = 0; $i < @settings; $i++) {
				if ($settings[$i] =~ /'(.*?)',"(.*?)"/) {
					${$uid.$user}{$1} = $2;
					if($1 eq 'lastonline' && action != "login2") {
						${$uid.$user}{$1} = $date;
						$settings[$i] = qq~'lastonline',"$date"\n~;
					}
				}
			} 



and in Security.pl add highlighted:
Code
Select All
	sub write_banlog {
		&admin_fatal_error("banned","$register_txt{'678'}$register_txt{'430'}!") if $admincheck;
		fopen(LOG, ">>$vardir/ban_log.txt");
		print LOG "$date|$_[0]\n";
		fclose(LOG);
		&UpdateCookie("delete", $ban_user);
		$username = "Guest";
		$iamguest = 1;
		&fatal_error("banned","$security_txt{'678'}$security_txt{'430'}!");
	} 

« Last Edit: Jun 20th, 2010 at 3:46am by Unilat »  
Back to top
 
IP Logged
 
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: [Standard] [CVS] Banned User and Last Online Time
Reply #2 - Jun 20th, 2010 at 7:14am
Post Tools
Works great. Thnx. Smiley

New
cgi-bin/yabb2/Sources/Load.pl
cgi-bin/yabb2/Sources/Security.pl

in CVS/SVN.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top