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.
$TIMEOUT
All timeouts are in seconds. The default timeout is 10 minutes.
Usually called from WE::DB.
WE::DB
Log in the specified $user to the online user database.
$user
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:
$timeout
$result
$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);
The $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 - slaven@rezic.de
WE::DB::User.
To install WE::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WE::DB
CPAN shell
perl -MCPAN -e shell install WE::DB
For more information on module installation, please visit the detailed CPAN module installation guide.