Subversion Repositories ALCASAR

Rev

Rev 606 | Rev 912 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 606 Rev 613
Line 68... Line 68...
68
if ($clear_sessions == 1)
68
if ($clear_sessions == 1)
69
	{
69
	{
70
# close active sessions
70
# close active sessions
71
	exec ("sudo /usr/local/sbin/alcasar-logout.sh $login");
71
	exec ("sudo /usr/local/sbin/alcasar-logout.sh $login");
72
# delete open accounting sessions
72
# delete open accounting sessions
-
 
73
	$now = time();
-
 
74
	$today_now = date("Y-m-d H:i:s",$now);
73
	$link = @da_sql_pconnect($config);
75
	$link = @da_sql_pconnect($config);
74
	if ($link)
76
	if ($link)
75
		{
77
		{
76
		$res = @da_sql_query($link,$config,
78
		$res = @da_sql_query($link,$config,
77
		"DELETE FROM $config[sql_accounting_table]
79
		"UPDATE $config[sql_accounting_table] SET acctstoptime = '$today_now', acctterminatecause='Admin-Reset'
78
		WHERE username='$login' AND acctstoptime IS NULL;");
80
		WHERE username='$login' AND acctstoptime IS NULL;");
79
		if (! $res)
81
		if (! $res)
80
			echo "<b>Error deleting open sessions for user" . da_sql_error($link,$config) . "</b><br>\n";
82
			echo "<b>Error deleting open sessions for user" . da_sql_error($link,$config) . "</b><br>\n";
81
		}
83
		}
82
	else
84
	else