Kicking out annoying users, how?

Does anyone know of a way to kick out users from the site, i.e. log them out.

I have searched the forum and the market but have found nothing. I'm sure i'm not the only one that would want something like this, its not fun to have people on your site you dont want there and you can do nothing about it until they themselves log out.

 

Any help would be appreciated.

Quote · 31 Jan 2012

http://www.boonex.com/forums/topic/Log-out-inactive-users-how-to-.htm

 

Edit: Topic reopened on request. 

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 31 Jan 2012

Yes, this is a good request and certainly applies to a user that sits there like a log. I have one such user, not sure what he is upto, just logs on and sits there, no contribution at all - zero.

Quote · 31 Jan 2012

How about something like this, to knock down two birds with one stone (also regarding my post linked above).

 

When a user logs on a 1 is set in the db, when a user logs off or is idling for X minutes it's set to 0.

Then we have a script that checks that field every X seconds, if it's 1 all is nice and dandy.

If it's set to 0 his session is killed. Admins or moderators could then have the ability to set that 0.

 

I'm sure there are much better ways to do this but let's speed up the thought processes :)

Quote · 31 Jan 2012

Hi!

Here is the solution:-

open phpMyadmin

open dolphin DB

open sys_injection

click sql and run this query

INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES

('head_inactive_redirect', '0', 'injection_head', 'php', 'replace me', '0', '1')

INSERT INTO `sys_injections` (`name`, `page_index`, `key`, `type`, `data`, `replace`, `active`) VALUES

('body_inactive_redirect', '0', 'injection_body', 'php', 'replace me', '0', '1')

edit the created row "name = head_inactive_redirect" and replace data field with below code replacing "replace me"

if (isMember() && !isAdmin()) {

echo '<script type="text/javascript">

var timer = 0;

function set_interval()

{

timer = setInterval("auto_logout()",300000);

}

function reset_interval()

{

if (timer != 0) {

clearInterval(timer);

timer = 0;

timer = setInterval("auto_logout()",300000);

}

}

function auto_logout()

{

window.location="logout.php";

}

</script>';

}

now hit "Go"

now edit the created row "name = body_inactive_redirect" and replace data field with below code replacing "replace me"

if (isMember() && !isAdmin()) {

echo 'onLoad="set_interval();" onmousemove="reset_interval();"'

}

hit "Go" and done. I don't think i need to remind you about clear the........:) enjoy

I have also attached a txt file with the above instruction if anyone need it.

Now what this does:

This script starts a timer when a page is loaded and reset it on every mouse movement. So, when a user will not move his mouse for 5 min this will redirect them to logout.php and what will happened after this you all know. This will not work for visitors(non-members) and admin they can do everything normally.

You all might be thinking that all my solutions comes from sys_injection but i can't do anything i love it...lol 

steps.txt · 1.3K · 116 downloads
so much to do....
Quote · 31 Jan 2012

Great stuff! I will give it a try right away on my dev platform.

Now we only need a way to kick'em out on command :)

 

The only problem i see here is that the user should be warned (move your mouse or die) before they get logged out due to inactivity, i can just imagine sitting and writing a 3 page long blog entry just to be logged out as you reach for the mouse to click pooooost...and its gone :)

I will set it to 30 minutes for now though, just to be sure.

 

 

 

Quote · 31 Jan 2012

I didnt manage to get it to work. The head injection was injected, but not the body, at least i could not find it in the source code of the page.

I then removed the table rows and added them between script tags in _header and _footer. Then i could see them both in the source code, the first between the <head> tags and the second just before </body>. But it still didn't log me out after 5 minutes. And i was sitting and just staring at the screen for 6 minutes, two times.

I will try it again later when i get back from work. Maybe someone else would like to give it a go in the meantime.

Quote · 31 Jan 2012

if you are using admin account than it will not work. or non member

so much to do....
Quote · 31 Jan 2012

Yes i know that, and I'm 99.9% sure i did not, i had two different users in two different browsers online. And as i said, i also couldn't see the injected body code in the source code. But maybe i messed something up, i will give it another try in a few hours.

Quote · 31 Jan 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.