Jump to content

Session Cookie deletion for Banned Pilots


mark1million

Recommended Posts

  • Moderators

Mark,

a cronjob would work, get all of the banned pilots and and delete all of the banned pilot sessions. or if your okay doing some minor core changes.

if you want, I can write something up for you.

Link to comment
Share on other sites

  • Moderators

Mark,

If you have the beta version and you know those custom pilot status with groups.. Here's I got mine working.

Step 1: Add a new setting in the local.config.php (You'll see the 'remove_sessions' part, set it to true for any other groups you have.)

2 => array(
	'name' => 'Banned',
	'message' => 'Your account is banned, please contact an admin!',
	'default' => false,
	'canlogin' => false,
	'active' => false,
	'autoretire' => false,
	'group_add' => array(
		'Inactive Pilots',
	),
	'group_remove' => array(
		'Active Pilots',
	),
 'remove_sessions' => true,
),

Step 2: Add a new if group removes session in the PilotData.class.php

Find this code... line 352ish

if(is_array($info['group_remove']) && count($info['group_remove']) > 0) {
			foreach($info['group_remove'] as $group) {
				PilotGroups::removeUserFromGroup($pilotid, $group);
			}
		}

Add after the above code...

if($info['remove_sessions'])
  {
$sql = "DELETE FROM ".TABLE_PREFIX."sessions
  WHERE pilotid = {$pilotid}";

DB::Query($sql);
  }

And that should do the trick by clearing banned pilot sessions.

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...