[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/cron/stalesessions.php, 1.4
From: |
nomail |
Subject: |
[Phpgroupware-cvs] phpgwapi/cron/stalesessions.php, 1.4 |
Date: |
Thu, 30 Dec 2004 07:47:26 +0100 |
Update of /phpgwapi/cron
Added Files:
Branch:
stalesessions.php
date: 2004/12/30 06:47:26; author: skwashd; state: Exp; lines: +0 -0
Log Message:
new HEAD
=====================================================================
<?php
/**************************************************************************\
* phpGroupWare *
* http://www.phpgroupware.org *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id: stalesessions.php,v 1.4 2004/12/30 06:47:26 skwashd Exp $ */
// stalesession.php - to use instead of stalesession.pl
// may be invoked via cron with "php stalesession.php"
// config start
$purgedelay = "3600"; // define allowed idle time before deletion in seconds
$purgetime = time() - $purgedelay;
$db_user = $ARGV[1];
$db_pwd = "my_pass";
$db_server = "localhost";
$db_db = "phpGroupWare";
// config end - do not edit after here unless you really know what you do!
// establish link:
$link = mysql_connect("$db_server","$db_user","$db_pwd");
mysql_query("use $db_db", $link);
// delete old (timed out) sessions
$query = sprintf("delete from phpgw_sessions where session_dla <=
'$purgetime'");
$res = mysql_query($query, $link);
?>
- [Phpgroupware-cvs] phpgwapi/cron/stalesessions.php, 1.4,
nomail <=