|
Whitebeam Template Reference Documentation
|
Contact Template
setPassword()
Sets the password for an Individual
Syntax
number = rb.contact.setPassword(ID, newPassword, passwordType)
Parameters
The 'setPassword' method takes 3 parameters:
Name | Type/Value | Range/Length | Description | ID | number | A valid ID | Required. The ID of an indivual who's password should be set to the passed value | newPassword | string | 3-64 characters | Required. The new password for this individual | passwordType | bool | 1-2 | Optional. A value of one (or parameter not provided) takes the previously default behaviour of taking the plain-text password and creating the hash. Setting this value to '2' marks the password parameter as being the hashed value which should be stored with no modification. Available from version : 1.3.9 |
Results
The 'setPassword' method returns number:
Type/Value | Range/Length | Description |
number |
-1, positive integer | ID of the modified record, or -1 if the record couldn't be modified.
|
Remarks Note that the Whitebeam contact management system implements a one-way password encryption algorithm. This means that passwords can only be set for individuals, the plain text password cannot be read or recovered once it has been set. The only way to recover from a lost password is to set it to a known value. Example The following example sets the password for "fred" to "fred"
var fred = rb.contact.individualInfo(-1, "fred")
if(fred != null){
rb.contact.setPassword(fred.ID, "fred");
}
|
|
(loadtime : 86ms) |