Whitebeam Template Reference Documentation
Validates access control for an individual
number = rb.contact.validate(uName, password, communityName)
The 'validate' method takes 3 parameters:
|Name ||Type/Value ||Range/Length ||Description |
|uName||string||2-31 characters ||Required. uName of an individual who's password is to be validated|
|password||string||3-64 characters ||Required. Clear text password of Individual|
|communityName||string||2-31 characters ||Required. A valid uName for a Community, OU, or Individual which should contain or be identical to the above user.|
The 'validate' method returns number:
|Type/Value ||Range/Length ||Description |
0 (FALSE) to indicate that some aspect of the validation failed.
1 (TRUE) to indicate that the validation suceeded.
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.
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");
(loadtime : 180ms)