Class UserLoginValidator

Description

The UserLoginValidator control class.

This control can be used to automatically redirect unauthorized visitors from a validation protected page to another URL.

The control can be added to the page with the PHP and JavaScript add functions, but is not added to the Wigbi control collection. It requires the User seed.

The control requires a logged in user, using the built-in login functionality of the User seed. Additional constraints can also be set with the validationExpressions property. For instance, if a page should only be available to administrator users with an authorization level above 5, validationExpressions can be set to ["isAdministrator()", "autorizationLevel() > 5"].

Besides validating the user when the page first loads, it is also possible to apply a validation interval that revalidates the user at a given interval. This makes it possible for a page to logout a user automatically as soon a the login session expires. Disable this feature by setting the interval to 0 or less.

JAVASCRIPT ********************************

Functions:

  • public static void add(string controlId, string redirectPage, int validationInterval, array validationExpressions)
  • [ASYNC] public static void validate(string redirectPage, array validationExpressions)

Located in /wigbi_controls/UserLoginValidator.php (line 61)

BaseControl
   |
   --UserLoginValidator
Method Summary
 static void add (string $controlId, [string $redirectPage = null], [int $validationInterval = 5], [array $validationExpressions = null])
 static bool validate ([array $validationExpressions = null])
 UserLoginValidator __construct ()
Methods
static add (line 123)

Add a UserLoginValidator control to the page.

  • access: public
static void add (string $controlId, [string $redirectPage = null], [int $validationInterval = 5], [array $validationExpressions = null])
  • string $controlId: The unique control ID.
  • string $redirectPage: The page to redirect to upon a successful login; default null.
  • int $validationInterval: The time, in minutes, between each AJAX validation; default 5.
  • array $validationExpressions: Optional validation expressions; default null.
static validate (line 146)

Validate the current login status.

  • access: public
static bool validate ([array $validationExpressions = null])
  • array $validationExpressions: The optional validation expressions to apply to the validation; default null.
Constructor __construct (line 72)

Create an instance of the control.

This constructor is only intended to be used by Wigbi at startup.

  • access: public
UserLoginValidator __construct ()

Redefinition of:
BaseControl::__construct()
Create an instance of the class.

Inherited Methods

Inherited From BaseControl

 BaseControl::__construct()
 BaseControl::closeForm()
 BaseControl::controlId()
 BaseControl::isPostBackSource()
 BaseControl::javaScript()
 BaseControl::openForm()
 BaseControl::registerJavaScript()
 BaseControl::submit()

Documentation generated on Sun, 27 Dec 2009 20:12:08 +0100 by phpDocumentor 1.4.1