|
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 | 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. |
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");
|
|
(loadtime : 91ms) |