WE::DB::OnlineUser - methods for users who are currently online
new WE::DB::OnlineUser $rootdb, $databasefilename, -timeout => 30*60;
This class holds methods for users who are currently online. Users may login and logout and should in intervals smaller than
$TIMEOUT ping back to the server so they signal that they are still logged in.
All timeouts are in seconds. The default timeout is 10 minutes.
Usually called from
Log in the specified
$user to the online user database.
Log out the specified
$user from the online user database.
Check whether the specified user is still logged in. Return either a true or false value. The
$timeout parameter is optional. If
$result is specified, it has to be a reference to a scalar value and will hold the exact result string (e.g. "Not logged in", "Timed out" or "Logged in") after the method returns. Some usage examples:
$bool = $onlineuserdb->check_logged("eserte"); $bool = $onlineuserdb->check_logged("eserte", undef, \$result); print "Result is: $result\n"; $bool = $onlineuserdb->check_logged("eserte", 10*60, \$result);
$user marks himself as alive in the online database.
Delete all non-logged-in users from the online user database. The
$timeout parameter is optional.
Delete all database contents
Disconnect the database. No further access on the database may be done.
Slaven Rezic - firstname.lastname@example.org