Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

Contact Template

validate()

Validates access control for an individual

Syntax

number = rb.contact.validate(uName, password, communityName)

Parameters

The 'validate' method takes 3 parameters:

Name Type/Value Range/Length Description
uNamestring2-31 characters Required. uName of an individual who's password is to be validated
passwordstring3-64 characters Required. Clear text password of Individual
communityNamestring2-31 characters Required. A valid uName for a Community, OU, or Individual which should contain or be identical to the above user.

Results

The 'validate' method returns number:

Type/Value Range/Length Description
number 0,1

0 (FALSE) to indicate that some aspect of the validation failed.

1 (TRUE) to indicate that the validation suceeded.


Remarks

In order for validation to suceed, all of the following must be true:

  • The uName must match exactly the uName field of exactly one Individual record
  • The password must encrypt to the same value as previously set for the individual by setPassword
  • The communityName must match exactly the uName field of exactly one Community, OU, or Individual record.
  • The Individual record specified by uName must be:
    a child of the OU if communityName is that of an OU OR
    a member of the Community if communityName is that of a Community OR
    identical to the uName if communityName is that of an Individual.

Example

The following example validates that user "fred", password "fred" is a member of community "friends"

	  if (rb.contact.validate("fred", "fred", "friends")
	  rb.page.write("OK, you're in friends");
	
Whitebeam release 1.3.36
(loadtime : 187ms)