/include/user.php

Description

User data functions (including application session data).

$Id: user.php 611 2006-06-29 10:43:58Z martijnw $

Functions
getParams (line 54)

Returns application specific session data.

This functions returns a reference to a hash object that can be used to store application related data. All data stored will be preserved inbetween page views, by use of the $_SESSION variable.

Note that this function returns a reference; this means that you need to reference-assign it in order to make use of it. I.e. the following code works:

  1. $config =& getParams("app");
  2. $config["foo"] = "bar";

but the following code will not set the right value:

  1. $config = getParams("app");
  2. $config["foo"] = "bar";

Note the missing & in the assignment.

Applications need to provide a disctinct application key to this function. It is suggested that this key also contains the path to this application, so as to allow multiple instances of the same SWS application to coexist on the same host.

  • return: the application session data hash for this application
array &getParams (string $app)
  • string $app: the application key
hasParams (line 16)

Determines whether the specified application has data stored in the application specific session variable.

  • return: true if the application uses session data, false if not
bool hasParams (string $app)
  • string $app: application identifier
resetParams (line 68)

Resets the application session data.

void resetParams (string $app)
  • string $app: the application key
userEmail (line 119)

Return the email address of either the currently authenticated or the specified user.

  • return: the email address of the user
string userEmail ([int $id = -1])
  • int $id: the user to return the email address for (default: current user)
userId (line 80)

Return the id of the currently authenticated user.

  • return: the id of the currently authenticated user, or -1 for guests
int userId ()
userLogin (line 92)

Return the login name of either the currently authenticated or the specified user.

  • return: the login name of the user or -1 if the userid was not found
mixed userLogin ([int $id = -1])
  • int $id: the user to return the login name for (default: current user)

Documentation generated on Fri, 30 Jun 2006 10:31:38 +0200 by phpDocumentor 1.3.0RC3