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

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
IDnumberA valid ID Required. The ID of an indivual who's password should be set to the passed value
newPasswordstring3-64 characters Required. The new password for this individual
passwordTypebool1-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 integerID 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");
	  }
	
Whitebeam release 1.3.36
(loadtime : 113ms)