CRM_Utils_System_Base
in package
Base class for UF system integrations
Table of Contents
Properties
- $is_drupal : bool
- Deprecated property to check if this is a drupal install.
- $is_joomla : bool
- Deprecated property to check if this is a joomla install. The correct method is to have functions on the UF classes for all UF specific functions and leave the codebase oblivious to the type of CMS
- $is_wordpress : bool
- deprecated property to check if this is a wordpress install. The correct method is to have functions on the UF classes for all UF specific functions and leave the codebase oblivious to the type of CMS
- $supports_form_extensions : bool
- $supports_UF_Logging : bool
- Does this CMS / UF support a CMS specific logging mechanism?
Methods
- addHTMLHead() : mixed
- Append a string to the head of the html file.
- addScript() : bool
- Add an inline script.
- addScriptUrl() : bool
- Add a script file.
- addStyle() : bool
- Add an inline style.
- addStyleUrl() : bool
- Add a css file.
- allowSynchronizeUsers() : bool
- Whether to allow access to CMS user sync action
- alterAssetUrl() : mixed
- Modify dynamic assets.
- appendBreadCrumb() : mixed
- Append an additional breadcrumb tag to the existing breadcrumb.
- appendCoreResources() : mixed
- Append to coreResourcesList.
- authenticate() : array<string|int, mixed>|bool
- Authenticate the user against the CMS db.
- canSetBasePage() : bool
- Can set base page for CiviCRM By default, CiviCRM will generate front-facing pages using the home page. This allows a different template for CiviCRM pages.
- checkCleanurls() : mixed
- checkPermissionAddUser() : bool
- Is the current user permitted to add a user.
- checkUserNameEmailExists() : mixed
- Check if username and email exists in the CMS.
- clearResourceCache() : mixed
- Flush css/js caches.
- cmsRootPath() : string|null
- Determine the location of the CMS root.
- createUser() : int|bool
- Create a user in the CMS.
- currentPath() : string|null
- Path of the current page e.g. 'civicrm/contact/view'
- flush() : mixed
- Reset any system caches that may be required for proper CiviCRM integration.
- getAbsoluteBaseURL() : bool|mixed|string
- Get the absolute path to the site's base url.
- getBestUFID() : int
- Return a UFID (user account ID from the UserFramework / CMS system.
- getBestUFUniqueIdentifier() : string
- Return a unique identifier (usually an email address or username) from the UserFramework / CMS system.
- getCiviSourceStorage() : array<string|int, mixed>
- Determine the location of the CiviCRM source tree.
- getCMSPermissionsUrlParams() : array<string|int, mixed>
- Return the CMS-specific url for its permissions page
- getContactDetailsFromUser() : array<string|int, mixed>
- Get Contact details from User The contact parameters here will be used to create a Contact record to match the user record.
- getContentTemplate() : string
- Returns the Smarty template path to the main template that renders the content.
- getCRMDatabasePrefix() : string
- Get the CRM database as a 'prefix'.
- getDefaultBlockLocation() : string
- getDefaultFileStorage() : array<string|int, mixed>
- Determine the default location for file storage.
- getDefaultSiteSettings() : array<string|int, mixed>
- Return default Site Settings.
- getEmailFieldName() : string
- Get email field name from form values
- getLoggedInUfID() : int|null
- Get currently logged in user uf id.
- getLoggedInUniqueIdentifier() : string|null
- Get currently logged in user unique identifier - this tends to be the email address or user name.
- getLoginDestination() : string|null
- Get the login destination string.
- getLoginURL() : string
- Get user login URL for hosting CMS (method declared in each CMS system class)
- getModules() : array<string|int, mixed>
- List modules installed in the CMS, including enabled and disabled ones.
- getNotifyUrl() : string
- Return the Notification URL for Payments.
- getRelativeBaseURL() : string|false
- Get the relative path to the sites base url.
- getRoleNames() : array<string|int, mixed>|null
- Get role names
- getSessionId() : mixed
- This exists because of https://www.drupal.org/node/3006306 where they changed so that they don't start sessions for anonymous, but we want that.
- getTimeZoneOffset() : string|false|null
- Get timezone offset from CMS
- getTimeZoneString() : string
- Get timezone from CMS as a string.
- getUfGroupTypes() : array<string|int, mixed>
- Return the CMS-specific UF Group Types for profiles.
- getUfId() : mixed
- Determine the native ID of the CMS user.
- getUFLocale() : string|null
- Get the locale set in the CMS.
- getUniqueIdentifierFromUserObject() : mixed
- Get Unique Identifier from UserFramework system (CMS).
- getUser() : array<string|int, mixed>
- Get an array of user details for a contact, containing at minimum the user ID & name.
- getUserIDFromUserObject() : null|int
- Get User ID from UserFramework system (CMS).
- getUserRecordUrl() : string|null
- Get Url to view user record.
- getVersion() : string
- Get CMS Version.
- hasUsersTable() : bool
- Has CMS users table
- initialize() : mixed
- invalidateRouteCache() : mixed
- Invalidates the cache of dynamic routes and forces a rebuild.
- ipAddress() : string
- Get the client's IP address.
- isFrontEndPage() : bool
- Is a front end page being accessed.
- isPasswordUserGenerated() : bool
- Check if user can create passwords or is initially assigned a system-generated one.
- isUserLoggedIn() : bool
- Check if user is logged in to the CMS.
- isUserRegistrationPermitted() : bool
- Check if user registration is permitted.
- languageNegotiationURL() : string
- Format the url as per language Negotiation.
- loadBootStrap() : mixed
- loadUser() : bool
- Load user into session.
- logger() : mixed
- Log error to CMS.
- logout() : mixed
- Immediately stop script execution, log out the user and redirect to the home page.
- mailingWorkflowIsEnabled() : bool
- Check if mailing workflow is enabled
- mapConfigToSSL() : mixed
- Rewrite various system urls to https.
- modifyStandaloneProfile() : string
- Modify standalone profile
- outputError() : mixed
- Output code from error function.
- permissionDenied() : mixed
- Immediately stop script execution and display a 401 "Access Denied" page.
- postContainerBoot() : void
- Hook for further system boot once the main CiviCRM Container is up (only used in Standalone currently)
- postURL() : string
- Figure out the post url for QuickForm.
- prePostRedirect() : mixed
- Perform any necessary actions prior to redirecting via POST.
- resetBreadCrumb() : mixed
- Reset an additional breadcrumb tag to the existing breadcrumb.
- sendResponse() : mixed
- Send an HTTP Response base on PSR HTTP RespnseInterface response.
- sessionStart() : mixed
- Start a new session.
- setHttpHeader() : mixed
- setMessage() : mixed
- Set a message in the CMS to display to a user.
- setMySQLTimeZone() : mixed
- Set MySQL timezone so that timestamp fields show the correct time.
- setPhpTimeZone() : mixed
- Set PHP timezone
- setTimeZone() : mixed
- Set system timezone (both PHP + MySQL)
- setTitle() : mixed
- Sets the title of the page.
- setUFLocale() : bool
- Set the localisation from the user framework.
- setUserSession() : mixed
- Set a init session with user object.
- showPasswordFieldWhenAdminCreatesUser() : mixed
- Should the admin be able to set the password when creating a user or does the CMS want it a different way.
- suppressProfileFormErrors() : bool
- Suppress profile form errors
- synchronizeUsers() : array<string|int, mixed>
- Create CRM contacts for all existing CMS users
- synchronizeUsersIfAllowed() : array<string|int, mixed>
- Run CMS user sync if allowed, otherwise just returns empty array
- theme() : string|null
- If we are using a theming system, invoke theme, else just print the content.
- updateCategories() : mixed
- Clear CMS caches related to the user registration/profile forms.
- updateCMSName() : mixed
- Update a user's email address in the CMS.
- url() : string
- Generate the url string to a CiviCRM path.
- userLoginFinalize() : mixed
- Perform any post login activities required by the CMS.
- verifyPassword() : mixed
- Verify password
- viewsExists() : bool
- Determine if the Views module exists.
- viewsIntegration() : string
- CiviCRM Table prefixes To display for CMS integration.
Properties
$is_drupal
Deprecated property to check if this is a drupal install.
TRUE, if the CMS is Drupal.
public
bool
$is_drupal
= \FALSE
The correct method is to have functions on the UF classes for all UF specific functions and leave the codebase oblivious to the type of CMS
$is_joomla
Deprecated property to check if this is a joomla install. The correct method is to have functions on the UF classes for all UF specific functions and leave the codebase oblivious to the type of CMS
TRUE, if the CMS is Joomla!.
public
bool
$is_joomla
= \FALSE
$is_wordpress
deprecated property to check if this is a wordpress install. The correct method is to have functions on the UF classes for all UF specific functions and leave the codebase oblivious to the type of CMS
TRUE, if the CMS is WordPress.
public
bool
$is_wordpress
= \FALSE
$supports_form_extensions
public
bool
$supports_form_extensions
= \FALSE
TRUE, if the CMS allows CMS forms to be extended by hooks.
$supports_UF_Logging
Does this CMS / UF support a CMS specific logging mechanism?
public
bool
$supports_UF_Logging
= \FALSE
Tags
Methods
addHTMLHead()
Append a string to the head of the html file.
public
addHTMLHead(string $head) : mixed
Parameters
- $head : string
-
The new string to be appended.
addScript()
Add an inline script.
public
addScript(string $code, string $region) : bool
Note: This function is not to be called directly
Parameters
- $code : string
-
javascript code
- $region : string
-
location within the document: 'html-header', 'page-header', 'page-footer'.
Tags
Return values
bool —TRUE if we support this operation in this CMS, FALSE otherwise
addScriptUrl()
Add a script file.
public
addScriptUrl(string $url, string $region) : bool
Note: This function is not to be called directly
Parameters
- $url : string
-
absolute path to file
- $region : string
-
location within the document: 'html-header', 'page-header', 'page-footer'.
Tags
Return values
bool —TRUE if we support this operation in this CMS, FALSE otherwise
addStyle()
Add an inline style.
public
addStyle(string $code, string $region) : bool
Note: This function is not to be called directly
Parameters
- $code : string
-
css code
- $region : string
-
location within the document: 'html-header', 'page-header', 'page-footer'.
Tags
Return values
bool —TRUE if we support this operation in this CMS, FALSE otherwise
addStyleUrl()
Add a css file.
public
addStyleUrl(string $url, string $region) : bool
Note: This function is not to be called directly
Parameters
- $url : string
-
absolute path to file
- $region : string
-
location within the document: 'html-header', 'page-header', 'page-footer'.
Tags
Return values
bool —TRUE if we support this operation in this CMS, FALSE otherwise
allowSynchronizeUsers()
Whether to allow access to CMS user sync action
public
allowSynchronizeUsers() : bool
Return values
boolalterAssetUrl()
Modify dynamic assets.
public
alterAssetUrl(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent
appendBreadCrumb()
Append an additional breadcrumb tag to the existing breadcrumb.
public
appendBreadCrumb(array<string|int, mixed> $breadCrumbs) : mixed
Parameters
- $breadCrumbs : array<string|int, mixed>
appendCoreResources()
Append to coreResourcesList.
public
appendCoreResources(GenericHookEvent $e) : mixed
Parameters
- $e : GenericHookEvent
authenticate()
Authenticate the user against the CMS db.
public
authenticate(string $name, string $password[, bool $loadCMSBootstrap = FALSE ][, string $realPath = NULL ]) : array<string|int, mixed>|bool
Parameters
- $name : string
-
The user name.
- $password : string
-
The password for the above user.
- $loadCMSBootstrap : bool = FALSE
-
Load cms bootstrap?.
- $realPath : string = NULL
-
Filename of script
Tags
Return values
array<string|int, mixed>|bool —[contactID, ufID, unique string] else false if no auth
canSetBasePage()
Can set base page for CiviCRM By default, CiviCRM will generate front-facing pages using the home page. This allows a different template for CiviCRM pages.
public
canSetBasePage() : bool
Return values
boolcheckCleanurls()
public
checkCleanurls() : mixed
checkPermissionAddUser()
Is the current user permitted to add a user.
public
checkPermissionAddUser() : bool
Return values
boolcheckUserNameEmailExists()
Check if username and email exists in the CMS.
public
checkUserNameEmailExists(array<string|int, mixed> &$params, array<string|int, mixed> &$errors[, string $emailName = 'email' ]) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of name and mail values.
- $errors : array<string|int, mixed>
-
Array of errors.
- $emailName : string = 'email'
-
Field label for the 'email'.
clearResourceCache()
Flush css/js caches.
public
clearResourceCache() : mixed
cmsRootPath()
Determine the location of the CMS root.
public
cmsRootPath() : string|null
Return values
string|null —Local file system path to CMS root, or NULL if it cannot be determined
createUser()
Create a user in the CMS.
public
createUser(array<string|int, mixed> &$params, string $mailParam) : int|bool
Parameters
- $params : array<string|int, mixed>
- $mailParam : string
-
Name of the $param which contains the email address. Because. Right. OK. That's what it is.
Return values
int|bool —uid if user exists, false otherwise
currentPath()
Path of the current page e.g. 'civicrm/contact/view'
public
static currentPath() : string|null
Return values
string|null —the current menu path
flush()
Reset any system caches that may be required for proper CiviCRM integration.
public
flush() : mixed
getAbsoluteBaseURL()
Get the absolute path to the site's base url.
public
getAbsoluteBaseURL() : bool|mixed|string
Return values
bool|mixed|stringgetBestUFID()
Return a UFID (user account ID from the UserFramework / CMS system.
public
getBestUFID([object $user = NULL ]) : int
ID is based on the user object passed, defaulting to the logged in user if not passed.
Note that ambiguous situation occurs in CRM_Core_BAO_UFMatch::synchronize - a cleaner approach would seem to be resolving the user id before calling the function.
Note there is already a function getUFId which takes $username as a param - we could add $user as a second param to it but it seems messy - just overloading it because the name is taken.
Parameters
- $user : object = NULL
Return values
int —User ID of UF System
getBestUFUniqueIdentifier()
Return a unique identifier (usually an email address or username) from the UserFramework / CMS system.
public
getBestUFUniqueIdentifier([object $user = NULL ]) : string
This is based on the user object passed, defaulting to the logged in user if not passed.
Note that ambiguous situation occurs in CRM_Core_BAO_UFMatch::synchronize - a cleaner approach would seem to be resolving the unique identifier before calling the function.
Parameters
- $user : object = NULL
Return values
string —unique identifier from the UF System
getCiviSourceStorage()
Determine the location of the CiviCRM source tree.
public
abstract getCiviSourceStorage() : array<string|int, mixed>
Return values
array<string|int, mixed> —- url: string. ex: "http://example.com/sites/all/modules/civicrm"
- path: string. ex: "/var/www/sites/all/modules/civicrm"
getCMSPermissionsUrlParams()
Return the CMS-specific url for its permissions page
public
getCMSPermissionsUrlParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getContactDetailsFromUser()
Get Contact details from User The contact parameters here will be used to create a Contact record to match the user record.
public
getContactDetailsFromUser(array<string|int, mixed> $uf_match) : array<string|int, mixed>
Parameters
- $uf_match : array<string|int, mixed>
-
Array of user object, unique ID.
Return values
array<string|int, mixed> —Array of contact parameters.
getContentTemplate()
Returns the Smarty template path to the main template that renders the content.
public
static getContentTemplate([mixed $print = 0 ]) : string
In CMS contexts, this goes inside their theme, but Standalone needs to render the full HTML page.
Parameters
- $print : mixed = 0
Return values
stringgetCRMDatabasePrefix()
Get the CRM database as a 'prefix'.
public
getCRMDatabasePrefix() : string
This returns a string that can be prepended to a query to include a CRM table.
However, this string should contain backticks, or not, in accordance with the CMS's drupal views expectations, if any.
Return values
stringgetDefaultBlockLocation()
public
getDefaultBlockLocation() : string
Return values
stringgetDefaultFileStorage()
Determine the default location for file storage.
public
getDefaultFileStorage() : array<string|int, mixed>
FIXME:
- This was pulled out from a bigger function. It should be split into even smaller pieces and marked abstract.
- This would be easier to compute by a calling a CMS API, but for whatever reason Civi gets it from config data.
Return values
array<string|int, mixed> —- url: string. ex: "http://example.com/sites/foo.com/files/civicrm"
- path: string. ex: "/var/www/sites/foo.com/files/civicrm"
getDefaultSiteSettings()
Return default Site Settings.
public
getDefaultSiteSettings(string $dir) : array<string|int, mixed>
Parameters
- $dir : string
Return values
array<string|int, mixed> —- $url, (Joomla - non admin url)
- $siteName,
- $siteRoot
getEmailFieldName()
Get email field name from form values
public
getEmailFieldName(CRM_Core_Form $form, array<string|int, mixed> $fields) : string
Parameters
- $form : CRM_Core_Form
- $fields : array<string|int, mixed>
Return values
stringgetLoggedInUfID()
Get currently logged in user uf id.
public
getLoggedInUfID() : int|null
Return values
int|null —logged in user uf id.
getLoggedInUniqueIdentifier()
Get currently logged in user unique identifier - this tends to be the email address or user name.
public
getLoggedInUniqueIdentifier() : string|null
Return values
string|null —logged in user unique identifier
getLoginDestination()
Get the login destination string.
public
getLoginDestination(CRM_Core_Form &$form) : string|null
When this is passed in the URL the user will be directed to it after filling in the CMS form.
Parameters
- $form : CRM_Core_Form
-
Form object representing the 'current' form - to which the user will be returned.
Return values
string|null —destination value for URL
getLoginURL()
Get user login URL for hosting CMS (method declared in each CMS system class)
public
abstract getLoginURL([string $destination = '' ]) : string
Parameters
- $destination : string = ''
-
If present, add destination to querystring (works for Drupal and WordPress only).
Return values
string —loginURL for the current CMS
getModules()
List modules installed in the CMS, including enabled and disabled ones.
public
getModules() : array<string|int, mixed>
Return values
array<string|int, mixed> —[CRM_Core_Module]
getNotifyUrl()
Return the Notification URL for Payments.
public
getNotifyUrl([string $path = NULL ][, string $query = NULL ][, bool $absolute = FALSE ][, string $fragment = NULL ][, bool $frontend = FALSE ][, bool $forceBackend = FALSE ]) : string
The default is to pass the params through to url()
. However the WordPress
CMS class overrides this method because Notification URLs must always target
the Base Page to avoid IPN failures when Forms are embedded in pages that
require authentication.
Parameters
- $path : string = NULL
-
The path being linked to, such as "civicrm/add".
- $query : string = NULL
-
A query string to append to the link.
- $absolute : bool = FALSE
-
Whether to force the output to be an absolute link (beginning with http). Useful for links that will be displayed outside the site, such as in an RSS feed.
- $fragment : string = NULL
-
A fragment identifier (named anchor) to append to the link.
- $frontend : bool = FALSE
-
This link should be to the CMS front end (applies to WP & Joomla).
- $forceBackend : bool = FALSE
-
This link should be to the CMS back end (applies to WP & Joomla).
Return values
string —The Notification URL.
getRelativeBaseURL()
Get the relative path to the sites base url.
public
getRelativeBaseURL() : string|false
Return values
string|falsegetRoleNames()
Get role names
public
getRoleNames() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetSessionId()
This exists because of https://www.drupal.org/node/3006306 where they changed so that they don't start sessions for anonymous, but we want that.
public
getSessionId() : mixed
getTimeZoneOffset()
Get timezone offset from CMS
public
getTimeZoneOffset() : string|false|null
Return values
string|false|nullgetTimeZoneString()
Get timezone from CMS as a string.
public
getTimeZoneString() : string
Return values
string —Timezone string e.g. 'America/Los_Angeles'
getUfGroupTypes()
Return the CMS-specific UF Group Types for profiles.
public
getUfGroupTypes() : array<string|int, mixed>
Return values
array<string|int, mixed>getUfId()
Determine the native ID of the CMS user.
public
getUfId(string $username) : mixed
Parameters
- $username : string
Tags
getUFLocale()
Get the locale set in the CMS.
public
getUFLocale() : string|null
Return values
string|null —Locale or null for none
getUniqueIdentifierFromUserObject()
Get Unique Identifier from UserFramework system (CMS).
public
getUniqueIdentifierFromUserObject(object $user) : mixed
Parameters
- $user : object
-
Object as described by the User Framework.
Return values
mixed —Unique identifier from the user Framework system
getUser()
Get an array of user details for a contact, containing at minimum the user ID & name.
public
getUser(int $contactID) : array<string|int, mixed>
Parameters
- $contactID : int
Return values
array<string|int, mixed> —CMS user details including
- id
- name (ie the system user name.
getUserIDFromUserObject()
Get User ID from UserFramework system (CMS).
public
getUserIDFromUserObject(object $user) : null|int
Parameters
- $user : object
-
Object as described by the User Framework.
Return values
null|intgetUserRecordUrl()
Get Url to view user record.
public
getUserRecordUrl(int $contactID) : string|null
Parameters
- $contactID : int
-
Contact ID.
Return values
string|nullgetVersion()
Get CMS Version.
public
getVersion() : string
Return values
stringhasUsersTable()
Has CMS users table
public
hasUsersTable() : bool
Return values
boolinitialize()
public
initialize() : mixed
invalidateRouteCache()
Invalidates the cache of dynamic routes and forces a rebuild.
public
invalidateRouteCache() : mixed
ipAddress()
Get the client's IP address.
public
ipAddress() : string
Return values
string —IP address
isFrontEndPage()
Is a front end page being accessed.
public
isFrontEndPage() : bool
Generally this would be a contribution form or other public page as opposed to a backoffice page (like contact edit).
Tags
Return values
boolisPasswordUserGenerated()
Check if user can create passwords or is initially assigned a system-generated one.
public
isPasswordUserGenerated() : bool
Return values
boolisUserLoggedIn()
Check if user is logged in to the CMS.
public
isUserLoggedIn() : bool
Return values
boolisUserRegistrationPermitted()
Check if user registration is permitted.
public
isUserRegistrationPermitted() : bool
Return values
boollanguageNegotiationURL()
Format the url as per language Negotiation.
public
languageNegotiationURL(string $url[, bool $addLanguagePart = TRUE ][, bool $removeLanguagePart = FALSE ]) : string
Parameters
- $url : string
- $addLanguagePart : bool = TRUE
- $removeLanguagePart : bool = FALSE
Return values
string —Formatted url.
loadBootStrap()
public
abstract loadBootStrap([mixed $params = [] ][, mixed $loadUser = TRUE ][, mixed $throwError = TRUE ][, mixed $realPath = NULL ]) : mixed
Parameters
- $params : mixed = []
- $loadUser : mixed = TRUE
- $throwError : mixed = TRUE
- $realPath : mixed = NULL
loadUser()
Load user into session.
public
loadUser(string $username) : bool
Parameters
- $username : string
Return values
boollogger()
Log error to CMS.
public
logger(string $message[, string|null $priority = NULL ]) : mixed
Parameters
- $message : string
- $priority : string|null = NULL
logout()
Immediately stop script execution, log out the user and redirect to the home page.
public
logout() : mixed
This function should be removed in favor of linking to the CMS's logout page
mailingWorkflowIsEnabled()
Check if mailing workflow is enabled
public
mailingWorkflowIsEnabled() : bool
Return values
boolmapConfigToSSL()
Rewrite various system urls to https.
public
mapConfigToSSL() : mixed
modifyStandaloneProfile()
Modify standalone profile
public
modifyStandaloneProfile(string $profile, array<string|int, mixed> $params) : string
Parameters
- $profile : string
- $params : array<string|int, mixed>
Return values
stringoutputError()
Output code from error function.
public
outputError(string $content) : mixed
Parameters
- $content : string
permissionDenied()
Immediately stop script execution and display a 401 "Access Denied" page.
public
permissionDenied() : mixed
Tags
postContainerBoot()
Hook for further system boot once the main CiviCRM Container is up (only used in Standalone currently)
public
postContainerBoot() : void
postURL()
Figure out the post url for QuickForm.
public
postURL(string $action) : string
Parameters
- $action : string
-
The default url if one is pre-specified.
Return values
string —The url to post the form.
prePostRedirect()
Perform any necessary actions prior to redirecting via POST.
public
prePostRedirect() : mixed
resetBreadCrumb()
Reset an additional breadcrumb tag to the existing breadcrumb.
public
resetBreadCrumb() : mixed
sendResponse()
Send an HTTP Response base on PSR HTTP RespnseInterface response.
public
sendResponse(ResponseInterface $response) : mixed
Parameters
- $response : ResponseInterface
sessionStart()
Start a new session.
public
sessionStart() : mixed
setHttpHeader()
public
setHttpHeader(string $name, string $value) : mixed
Parameters
- $name : string
- $value : string
setMessage()
Set a message in the CMS to display to a user.
public
setMessage(string $message) : mixed
Parameters
- $message : string
-
The message to set.
setMySQLTimeZone()
Set MySQL timezone so that timestamp fields show the correct time.
public
setMySQLTimeZone([string|null $timeZone = NULL ]) : mixed
Parameters
- $timeZone : string|null = NULL
-
Timezone string - if none provided will be fetched from system
setPhpTimeZone()
Set PHP timezone
public
setPhpTimeZone([string|null $timeZone = NULL ]) : mixed
Parameters
- $timeZone : string|null = NULL
-
Timezone string - default value will be fetched using getTimeZoneString if not provided or falsey
setTimeZone()
Set system timezone (both PHP + MySQL)
public
setTimeZone([string|null $timeZone = NULL ]) : mixed
Parameters
- $timeZone : string|null = NULL
setTitle()
Sets the title of the page.
public
setTitle(string $title[, string|null $pageTitle = NULL ]) : mixed
Parameters
- $title : string
-
Title to set in html header
- $pageTitle : string|null = NULL
-
Title to set in html body (if different)
setUFLocale()
Set the localisation from the user framework.
public
setUFLocale(string $civicrm_language) : bool
Parameters
- $civicrm_language : string
Return values
boolsetUserSession()
Set a init session with user object.
public
setUserSession(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
-
Array with user specific data
showPasswordFieldWhenAdminCreatesUser()
Should the admin be able to set the password when creating a user or does the CMS want it a different way.
public
showPasswordFieldWhenAdminCreatesUser() : mixed
suppressProfileFormErrors()
Suppress profile form errors
public
suppressProfileFormErrors() : bool
Return values
boolsynchronizeUsers()
Create CRM contacts for all existing CMS users
public
synchronizeUsers() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>synchronizeUsersIfAllowed()
Run CMS user sync if allowed, otherwise just returns empty array
public
synchronizeUsersIfAllowed() : array<string|int, mixed>
Return values
array<string|int, mixed>theme()
If we are using a theming system, invoke theme, else just print the content.
public
theme(string &$content[, bool $print = FALSE ][, bool $maintenance = FALSE ]) : string|null
Parameters
- $content : string
-
The content that will be themed.
- $print : bool = FALSE
-
Are we displaying to the screen or bypassing theming?.
- $maintenance : bool = FALSE
-
For maintenance mode.
Tags
Return values
string|null —NULL, If $print is FALSE, and some other criteria match up. The themed string, otherwise.
updateCategories()
Clear CMS caches related to the user registration/profile forms.
public
updateCategories() : mixed
Used when updating/embedding profiles on CMS user forms.
Tags
updateCMSName()
Update a user's email address in the CMS.
public
updateCMSName(int $ufID, string $email) : mixed
Parameters
- $ufID : int
-
User ID in CMS.
- $email : string
-
Primary contact email address.
url()
Generate the url string to a CiviCRM path.
public
abstract url([string $path = NULL ][, string $query = NULL ][, bool $absolute = FALSE ][, string $fragment = NULL ][, bool $frontend = FALSE ][, bool $forceBackend = FALSE ]) : string
Parameters
- $path : string = NULL
-
The path being linked to, such as "civicrm/add".
- $query : string = NULL
-
A query string to append to the link.
- $absolute : bool = FALSE
-
Whether to force the output to be an absolute link (beginning with http). Useful for links that will be displayed outside the site, such as in an RSS feed.
- $fragment : string = NULL
-
A fragment identifier (named anchor) to append to the link.
- $frontend : bool = FALSE
-
This link should be to the CMS front end (applies to WP & Joomla).
- $forceBackend : bool = FALSE
-
This link should be to the CMS back end (applies to WP & Joomla).
Return values
stringuserLoginFinalize()
Perform any post login activities required by the CMS.
public
userLoginFinalize([array<string|int, mixed> $params = [] ]) : mixed
e.g. for drupal: records a watchdog message about the new session, saves the login timestamp, calls hook_user op 'login' and generates a new session.
Parameters
- $params : array<string|int, mixed> = []
-
FIXME: Document values accepted/required by $params
verifyPassword()
Verify password
public
verifyPassword(array<string|int, mixed> $params, array<string|int, mixed> &$errors) : mixed
Parameters
- $params : array<string|int, mixed>
-
Array of name, mail and password values.
- $errors : array<string|int, mixed>
-
Array of errors.
viewsExists()
Determine if the Views module exists.
public
viewsExists() : bool
Return values
boolviewsIntegration()
CiviCRM Table prefixes To display for CMS integration.
public
viewsIntegration() : string