Slaven Rezić > WE_Framework-0.097_03 > WE::DB::OnlineUser

Download:
WE_Framework-0.097_03.tar.gz

Dependencies

Annotate this POD

Module Version: 1.08   Source  

NAME ^

WE::DB::OnlineUser - methods for users who are currently online

SYNOPSIS ^

    new WE::DB::OnlineUser $rootdb, $databasefilename, -timeout => 30*60;

DESCRIPTION ^

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.

CONSTRUCTOR new($class, $root, $file, %args)

Usually called from WE::DB.

METHODS

login($user)

Log in the specified $user to the online user database.

logout($user)

Log out the specified $user from the online user database.

check_logged($user, [$timeout], [$result])

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);
ping($user)

The $user marks himself as alive in the online database.

cleanup([$timeout])

Delete all non-logged-in users from the online user database. The $timeout parameter is optional.

delete_db_contents

Delete all database contents

disconnect

Disconnect the database. No further access on the database may be done.

AUTHOR ^

Slaven Rezic - slaven@rezic.de

SEE ALSO ^

WE::DB::User.

syntax highlighting: