User::set - jcobban/Genealogy GitHub Wiki

$user->set($fieldname, $value)

Up: class User

This changes the value of the identified field and returns the former value. It has two parameters:

parameter description
$field The field name is case insensitive and may be a synonym defined to facilitate readability. Late static binding is used so this method takes advantage of field name definitions in the derived class. The field name may also be a temporary field defined by assigning a value to it in this method. This method creates a trace entry if the field name does not correspond to any field in the record and debugging is enabled.
$value The new value to assign to the field.

It overloads the base implementation as follows:

field name description
'password' The supplied password is converted into a hash value and that value is stored in the field 'shapassword'.
'usemail' If the supplied value is non-zero the flag User::OPT_USEMAIL_ON is set in the options field. Otherwise that flag is turned off.
'auth' If the new value is 'pending' and the old value was not 'pending' then a confirmation identifier is set in field 'confirmid'. Otherwise the field 'confirmid' is set to null. The new authorization is always set.
'email' The new value is used to update the field 'email' only if it does not match the value of that field for any other User. If the new value is a duplicate an error message is added and the method returns false instead of the former value of the field.

Next: $user->setPassword($password)