Object objWebsiteUser

From Snapp CMS Developer Documentation

Jump to: navigation, search

provides Information about Website Users and Updating user Details

Contents

Associated Objects

objOrderAddress

Usage in CMS

Example

PHP:

$user = new objWebsiteUser(1);



Construction Configuration Options

Config Options Description
fields or id : array or int (required) ID of User or User Fields from Database

Avaliable Variables

name Description
id : int User ID
firstName : string User First Name
lastName : string User Last Name
companyName : string User Company Name
email : string User Email Address
phone : string Users Contact Phone Number
fax : string Users Contact Fax Number
mobile : string Users Contact Mobile Number
billing : object (objOrderAddress) User Billing Address Details
delivery : object (objOrderAddress) User Delivery Address Details
expires : unix timestamp Time stamp of Users Membership Expires

Available Functions

save()

Saves all information stored in the object to the website user table

Note: Same function works for both creating new and existing users

setPassword(password:string)

Sets Password value, if no value is password one is automatically generated

Note: you will need to save the user to update the database

resetPassword()

Generates a new Random Password and automatically updated the database

sendPassword(cfg:array)

Config Options

  • to : string (optional)
  • toName : string (optional)
  • from : string (optional)
  • fromName : string (optional)
  • subject : string (optional)
  • htmlBody : string (optional)
  • textBody : string (optional)

If no HTML Body is passed it will look for myaccount_new_password_html_email.php in the the sites custom directory and then the global template directory

If no Text Body is passed it will look for myaccount_new_password_text_email.php in the the sites custom directory and then the global template directory

sendRegistration(cfg:array)

Config Options

  • to : string (optional)
  • toName : string (optional)
  • from : string (optional)
  • fromName : string (optional)
  • subject : string (optional)
  • htmlBody : string (optional)
  • textBody : string (optional)

If no HTML Body is passed it will look for myaccount_registration_html_email.php in the the sites custom directory and then the global template directory

If no Text Body is passed it will look for myaccount_registration_text_email.php in the the sites custom directory and then the global template directory

generatePassword(length:int)

Generates a Random Password String to the length password (default: 8 chars)

Personal tools
Core Components
Standalone Installs