4.11. Users

Top  Previous  Next
activate_account - activates user account
Parameters:
username - the username
activation_key - activation key
Used templates:
activate_account.tpl

 

change_password - changes user password
Parameters:
username - a name of a user
verification_key - verification key
password - new password
confirm_password - password confirmation
Used templates:
change_password.tpl
successful_password_change.tpl

 

delete_uploaded_file - deleting an uploaded file of a current user
Parameters:
field_id - ID of a user profile field. A file will be deleted from the user profile field.
Used templates:
delete_uploaded_file.tpl

 

edit_profile - edits user profile
Parameters: None
Used templates:
edit_profile.tpl

 

init_current_user_structure - gets current user information and initialize the $GLOBALS.current_user variable for templates
Parameters: None
Used templates: None

 

login - displays login form
Parameters:
username - a name of a user
password - user password
keep - this flag shows if login information should be saved or not
Used templates:
already_logged_in.tpl
login.tpl

 

logout - logs out users and redirects them to the main page
Parameters: None
Used templates: None

 

password_recovery - recovers user password
Parameters:
username - the username
Used templates:
password_recovery.tpl
password_change_email_successfully_sent.tpl

 

registration - allows users to register in the system
Parameters:
user_group_id - the optional parameter specifies a user group ID; if it doesn't specify, then this function returns the list of all available user groups to choose.
reg_form_template - registration form template
Used templates:
registration_success.tpl
registration_confirm.tpl
registration_failed_to_send_activation_email.tpl
registration_form.tpl or the template specified in the property of the registration form template group.
registration_choose_user_group.tpl

 

search_users – implements user search functionality
Parameters:
user_group_id – contains the User Group Id of the group to search within. If left empty, users of all groups are included in the search.
search_form_template – contain the name of the templates used to display the search form. If left empty, the default template named “user_search_form.tpl” is used. This template displays search form for user profile’s field listed in the “fields” parameter.
fields – enumerates fields to be used in search criteria. List fields separated by comma. This parameter is used only together with the default search template (“user_search_form.tpl”).
result_template – contains the name of the templates used to display search results. If left empty, the default “user_search_results.tpl” template is used.
Templates used:
user_search_form.tpl
user_search_results.tpl

 

When setting up a user search page, please keep the following in mind:

1.The list of fields in the “fields” parameter is used inside the default search form template (user_search_form.tpl). If you use a different template for user search form (by setting a value to the search_form_template parameter) the list in “fields” parameter may be disregarded by the creator of the search form template. Creator of the search template has the choice either to disregard the list from the “fields” parameter or use it.
2.Only those fields that are available in the profile of the user group “user_group_id” make sense as a search criteria. For example if site visitor is looking for the company named “Alpha” in user search, but the group within which search is done does not have the “company name” field no users will be found (empty result). Please take keep this consideration in mind when setting up user search page and creating a custom search form template.

 

contact_form - displays contact user form and sends contents of the form to the user after submissions.
Parameters:
display_template - the optional parameter, the template for contact user form. If left blank, the default “contact_form.tpl” template is used.
Templates used:
contact_form.tpl – form template
contact_form_message.tpl – email template

 

user_details - displays user details from user profile.
Used templates:
display_template - the optional parameter, the template for the user details. If left blank, the default “user_details” template is used.
Templates used:
user_details.tpl – default template, used when display_template parameter is left blank. This templates is used for “View User Profile” page.
user_details_with_all_ads.tpl – used for "All User Listings Page” page.

 

If you have multiple user groups on your website and wish to have user profiles for different groups display differently you have two options:

1.Set up a several user pages for user groups and several display templates for them. (i.e. create page with uri = /agents/ and display_template = agent_profile_details.tpl for agents and another page with uri = /users/ and display_template = private_seller_info.tpl for private sellers),
2.Inside user_details.tpl, include several if blocks for each user group with desired profile fields and layout. ({if $user.group.id eq “ProvateSeller”} … {elseif $user.group.id eq “ProvateSeller”} … {else} … {/if}).

 

user_notifications - user notifications management (turn on / turn off)
Parameters: None
Used templates:
user_notifications.tpl