View Full Version : Automatic Logouts
Was the Automatic Logout feature noted on the documents page for 2.0 Alpha brought forward into 2.1 ?
cyberhorse
29-11-05, 11:07 PM
as far as I know, yes. There is a system setting for how long your sessions last for - that's also the auto-logout time.
I am running 2.01 and have a problem with people logging out. I was wondering if the Session handler and Session Idle time settings actually worked. I have my Session Handler set for PHP Default and the Session Idle Time for for 1 Hour. Regardless of the settings, if the user does not log out of Dotproject the session remains active. Is there a better setting that would automatically log a user out after X number of minutes of no activity?
minotaur
30-11-05, 11:42 PM
I can confirm that users do NOT automatically logout. Login timeout set to 2d.
My test site was setup week and half ago. Early test users are still logged in - now approx 228 hrs. and counting . . .
Can I force the users to logout as admin?
MacOfTheEast
01-12-05, 12:22 AM
I can confirm that users do NOT automatically logout. Login timeout set to 2d.I can DENY that users do not get automatically logged out :-) It works here.
Bear in mind that you won't notice that they've been logged out until they try to do something (move to another page, refresh, etc.) That's when they'll be asked to log in again (diverted to the login screen.)
I have set...
Session Handler dotProject Extended Sessions
Session Idle Time 1h
Session Maximum Lifetime 12h
I do remember, however, that there's something not quite right with the (d)ays definition so, as a test, try setting it to 1h and 12h per the above to see if that works for you.
Good Luck,
MOTE
MacofTheEast
When I view the User Admin module I see those users that have logged off (noted as Offline) and those that have simply closed the browser without logging off (noted as XX.XX Hrs.(xx.xx Hrs Idle)-Online).
I have in the past set my sessions:
Session Handler dotProject Extended Sessions
Session Idle Time 1h
Session Maximum Lifetime 12h
Exactly as your currect settings are. This has made no difference. I have seen users stay Idle-Oine as long as 988hrs before I reset the password and log them out. My goal is to eliminate this and have a user logged ofs after a determined amount of inactive time.
MacOfTheEast
01-12-05, 02:53 AM
My goal is to eliminate this and have a user logged ofs after a determined amount of inactive time.So what you are looking for is a routine that runs in the background, kills their session after 'x' of inactivity, and automatically sends them to a screen informing them that they've been logged out? Is that what you'd like? If so, I suggest you make a 'new feature request' in Mantis.
Sorry that I can't help further.
Regards,
MOTE
minotaur
01-12-05, 03:44 AM
I have set...
Session Handler dotProject Extended Sessions
Session Idle Time 1h
Session Maximum Lifetime 12h
I do remember, however, that there's something not quite right with the (d)ays definition so, as a test, try setting it to 1h and 12h per the above to see if that works for you.
MOTE
MacofTheEast,
Thanks for your suggestion. I changed the settings as you suggested. I was then idle as a user and when I returned a couple of hours later I was returned to the log-in screen.
However, the User Administration log in the still shows me logged in (as user) with the elapsed time continuing to grow.
So, it appears that I was logged out but the admin does not see it so. As far at my view of the user through the User Administration screen, I am still ONLINE although IDLE.
I realise as I write this that I am equating being ONLINE as being LOGGED IN. Is this what ONLINE is meant to suggest? If so, the idle timeout seems to work but the information is not being passed/updated for the benefit of the admin.
minotaur
07-12-05, 08:21 AM
I wanted to show what it looks like in the User Admin section for users that have long since timed-out but are still showing as logged in.
229 hours is a long time to be online when the idle timeout is set to 1h and the max session lifetime is 12h.
http://www.mgrush.com/images/user/inactive_stillloggedin.png
Minotaur
Your image is exactly the issue I was trying to explain. I guess the old saying of a picture being worth a thousand words is right on target.
Mike
Michal_Fapso
05-04-06, 05:27 AM
It is because in the "User admin" module the information about user's online/offline status is gathered from users log. But the record "logout" for users is added only when the user is logged out.
From the security point of view, you just need to set session variables in "System Admin":
Session Handler
Session Idle Time
Session Maximum Lifetime
...to force users to log in again after some amount of idle time.
If you would like to see it also in Users Admin module, you can edit the file $DOTPROJECT/modules/admin/vw_usr.php:
somewhere before the foreach loop add this:
$max_idle_time_hours = dPsessionConvertTime('idle_time') / 3600;
and within the loop just modify the if-structure to something like this:
foreach ($user_logs as $row_log) {
if ($row_log["online"] == '1'){
if ($row_log['idle'] > $max_idle_time_hours) {
echo '<span style="color: red">'.$AppUI->_('Offline')." (".$row_log["idle"]." ". $AppUI->_('hrs.')." ".$AppUI->_('idle'). ")";
} else {
echo '<span style="color: green">'.$row_log["hours"]." ".$AppUI->_('hrs.'). "( ".$row_log["idle"]." ". $AppUI->_('hrs.')." ".$AppUI->_('idle'). ") - " . $AppUI->_('Online');
}
} else {
echo '<span style="color: red">'.$AppUI->_('Offline');
}
}
So that the modified file $DOTPROJECT/modules/admin/vw_usr.php will look like this:
<?php /* ADMIN $Id: vw_usr.php,v 1.19 2005/03/11 00:46:46 gregorerhardt Exp $ */ ?>
<table cellpadding="2" cellspacing="1" border="0" width="100%" class="tbl">
<tr>
<td width="60" align="right">
<?php echo $AppUI->_('sort by');?>:
</td>
<?php if (dPgetParam($_REQUEST, "tab", 0) == 0){ ?>
<th width="125">
<?php echo $AppUI->_('Login History');?>
</th>
<?php } ?>
<th width="150">
<a href="?m=admin&a=index&orderby=user_username" class="hdr"><?php echo $AppUI->_('Login Name');?></a>
</th>
<th>
<a href="?m=admin&a=index&orderby=contact_last_name" class="hdr"><?php echo $AppUI->_('Real Name');?></a>
</th>
<th>
<a href="?m=admin&a=index&orderby=contact_company" class="hdr"><?php echo $AppUI->_('Company');?></a>
</th>
</tr>
<?php
$max_idle_time_hours = dPsessionConvertTime('idle_time') / 3600;
$perms =& $AppUI->acl();
foreach ($users as $row) {
if ($perms->isUserPermitted($row['user_id']) != $canLogin)
continue;
?>
<tr>
<td align="right" nowrap="nowrap">
<?php if ($canEdit) { ?>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
<a href="./index.php?m=admin&a=addedituser&user_id=<?php echo $row["user_id"];?>" title="<?php echo $AppUI->_('edit');?>">
<?php echo dPshowImage( './images/icons/stock_edit-16.png', 16, 16, '' ); ?>
</a>
</td>
<td>
<a href="?m=admin&a=viewuser&user_id=<?php echo $row["user_id"];?>&tab=2" title="">
<img src="images/obj/lock.gif" width="16" height="16" border="0" alt="<?php echo $AppUI->_('edit permissions');?>">
</a>
</td>
<td>
<?php
$user_display = addslashes($row["contact_first_name"] . " " . $row["contact_last_name"]);
$user_display = trim($user_display);
if (empty($user_display))
$user_display = $row['user_username'];
?>
<a href="javascript:delMe(<?php echo $row["user_id"];?>, '<?php echo $user_display;?>')" title="<?php echo $AppUI->_('delete');?>">
<?php echo dPshowImage( './images/icons/stock_delete-16.png', 16, 16, '' ); ?>
</a>
</td>
</tr>
</table>
<?php } ?>
</td>
<?php if (dPgetParam($_REQUEST, "tab", 0) == 0){ ?>
<td>
<?php
$q = new DBQuery;
$q->addTable('user_access_log', 'ual');
$q->addQuery("
user_access_log_id,
( unix_timestamp( now( ) ) - unix_timestamp( date_time_in ) ) / 3600 as hours,
( unix_timestamp( now( ) ) - unix_timestamp( date_time_last_action ) ) / 3600 as idle,
if(isnull(date_time_out) or date_time_out ='0000-00-00 00:00:00','1','0') as online");
$q->addWhere("user_id ='". $row["user_id"]."'");
$q->addOrder('user_access_log_id DESC');
$q->setLimit(1);
$user_logs = $q->loadList();
if ($user_logs)
foreach ($user_logs as $row_log) {
if ($row_log["online"] == '1'){
if ($row_log['idle'] > $max_idle_time_hours) {
echo '<span style="color: red">'.$AppUI->_('Offline')." (".$row_log["idle"]." ". $AppUI->_('hrs.')." ".$AppUI->_('idle'). ")";
} else {
echo '<span style="color: green">'.$row_log["hours"]." ".$AppUI->_('hrs.'). "( ".$row_log["idle"]." ". $AppUI->_('hrs.')." ".$AppUI->_('idle'). ") - " . $AppUI->_('Online');
}
} else {
echo '<span style="color: red">'.$AppUI->_('Offline');
}
}
else
echo '<span style="color: grey">'.$AppUI->_('Never Visited');
echo '</span>';
}?>
</td>
<td>
<a href="./index.php?m=admin&a=viewuser&user_id=<?php echo $row["user_id"];?>"><?php echo $row["user_username"];?></a>
</td>
<td>
<a href="mailto:<?php echo $row["contact_email"];?>"><img src="images/obj/email.gif" width="16" height="16" border="0" alt="email"></a>
<?php
if ($row['contact_last_name'] && $row['contact_first_name'])
echo $row["contact_last_name"].', '.$row["contact_first_name"];
else
echo '<span style="font-style: italic">unknown</span>';
?>
</td>
<td>
<a href="./index.php?m=companies&a=view&company_id=<?php echo $row["contact_company"];?>"><?php echo $row["company_name"];?></a>
</td>
</tr>
<?php }?>
</table>
I hope, it will help you a little
Good luck
Miso
DotVince
03-10-06, 09:51 PM
Hi,
Did this hack work for anyone, and is it still applicable in 2.0.4?
Thanks,
- Vince
MacOfTheEast
03-10-06, 10:14 PM
Did this hack work for anyone, and is it still applicable in 2.0.4?
Did you checkout the new feature added to stable_2 which not only shows you who's online but also allows you to end their session or log them out?
MOTE
DotVince
03-10-06, 11:05 PM
Did you checkout the new feature added to stable_2 which not only shows you who's online but also allows you to end their session or log them out?
MOTE
Hi MOTE,
No, I wasn't aware - sounds cool.
Can I add this to 2.0.4, and if yes, would you point out the files necessary pretty please?
Many thanks,
- Vince
caseydk
03-10-06, 11:31 PM
You don't need to do anything to add this to 2.0.4...
Go to User Admin -> the Active Sessions tab -> click to log out whoever.
DotVince
04-10-06, 12:05 AM
You don't need to do anything to add this to 2.0.4...
Go to User Admin -> the Active Sessions tab -> click to log out whoever.
Hi Casey,
I don't see anything for this.
Have 3 tabs; Active users, Inactive users, and User Log
The options (icons) on the active users tab are; edit, edit permissions, and delete.
Am I missing a file, module, setting ... ??
Thanks,
- vince
MacOfTheEast
04-10-06, 05:47 AM
caseydk forgot that it's not in v2.0.4 but in stable_2. DotVince: go ahead and take the plunge. Backup and then upgrade to stable_2. You've been around long enough to know how to get help if you run into problems :)
MOTE
DotVince
04-10-06, 08:09 AM
Hey MOTE,
Yes, long time since I first tried DP (1.2), but had to leave it because of the lack of a permissions system that was not agreeable by my employers.
So only just come back to using it, and trying to get it accepted company-wide.
Therefore, cannot take any risks with current installation where we have our first 3 'trial' projects, as the users are all managers and directors. ;)
I may give it a try on a seperate test install though, as I'm curious to see what's on the way.
In the meantime, I'd appreciate understanding the following:
1. Has this logout issue been solved in version 2.0.5
2. Does the above solution from Miso solve it for DP 2.0.4?
Any idea how long for 2.0.5 release?
All the best,
- Vince
MacOfTheEast
04-10-06, 02:04 PM
1. Has this logout issue been solved in version 2.0.5
I believe it has been addressed in HEAD but not yet in stable_2. (It's the stable_2 code that will eventually become 2.0.5: HEAD code will become v 3.0)[/quote]
2. Does the above solution from Miso solve it for DP 2.0.4?
Haven't tried it but it looks like it should work. I'm sure you'll let us know after you've tried it :)
Any idea how long for 2.0.5 release?
Shouldn't be too much longer.
MOTE
twhite56
04-10-06, 03:22 PM
Mac is 2.0.5 the code with debugging and timing or is that other code? I haven't looked at stable_2, where do I find it? I've only checked out DP HEAD which allowed me to do some pagination implementation. I don't really need smarty templates tho, and since our companies database is so customized it's nice to use my own feature sets :)
-T
MacOfTheEast
04-10-06, 09:31 PM
Mac is 2.0.5 the code with debugging and timing or is that other code?
The timing routines are built into HEAD
I haven't looked at stable_2, where do I find it?
Sourceforge.
Regards,
MOTE
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.