CRM_Utils_System_Base
class CRM_Utils_System_Base
Base class for UF system integrations
Properties
bool | $is_drupal | Deprecated property to check if this is a drupal install. | |
bool | $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 | |
bool | $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 | |
bool | $supports_UF_Logging | Does this CMS / UF support a CMS specific logging mechanism? | |
bool | $supports_form_extensions |
Methods
No description
Append an additional breadcrumb tag to the existing breadcrumb.
Reset an additional breadcrumb tag to the existing breadcrumb.
Append a string to the head of the html file.
Rewrite various system urls to https.
Figure out the post url for QuickForm.
Generate the url string to a CiviCRM path.
Authenticate the user against the CMS db.
Set a message in the CMS to display to a user.
Load user into session.
Immediately stop script execution and display a 401 "Access Denied" page.
Immediately stop script execution, log out the user and redirect to the home page.
Clear CMS caches related to the user registration/profile forms.
Get the locale set in the CMS.
If we are using a theming system, invoke theme, else just print the content.
No description
Get the absolute path to the site's base url.
Get the relative path to the sites base url.
Get CMS Version.
Format the url as per language Negotiation.
Determine the location of the CMS root.
Create a user in the CMS.
Update a user's email address in the CMS.
Check if user is logged in to the CMS.
Get user login URL for hosting CMS (method declared in each CMS system class)
Determine the native ID of the CMS user.
Set the localisation from the user framework.
Set a init session with user object.
Reset any system caches that may be required for proper CiviCRM integration.
Flush css/js caches.
Add a script file.
Add an inline script.
Add a css file.
Add an inline style.
Sets the title of the page.
Return default Site Settings.
Determine the default location for file storage.
Determine the location of the CiviCRM source tree.
Perform any post login activities required by the CMS.
Set timezone in mysql so that timestamp fields show the correct time.
Get timezone from CMS.
Get timezone as a string.
Get Unique Identifier from UserFramework system (CMS).
Get User ID from UserFramework system (CMS).
Get an array of user details for a contact, containing at minimum the user ID & name.
Get currently logged in user uf id.
Get currently logged in user unique identifier - this tends to be the email address or user name.
Return a UFID (user account ID from the UserFramework / CMS system.
Return a unique identifier (usually an email address or username) from the UserFramework / CMS system.
List modules installed in the CMS, including enabled and disabled ones.
Get Url to view user record.
Is the current user permitted to add a user.
Output code from error function.
Log error to CMS.
Append to coreResourcesList.
No description
Create CRM contacts for all existing CMS users
Details
at line 53
initialize()
at line 64
appendBreadCrumb(array $breadCrumbs)
Append an additional breadcrumb tag to the existing breadcrumb.
at line 70
resetBreadCrumb()
Reset an additional breadcrumb tag to the existing breadcrumb.
at line 79
addHTMLHead(string $head)
Append a string to the head of the html file.
at line 85
mapConfigToSSL()
Rewrite various system urls to https.
at line 98
string
postURL(string $action)
Figure out the post url for QuickForm.
at line 128
string
url(string $path = NULL, string $query = NULL, bool $absolute = FALSE, string $fragment = NULL, bool $frontend = FALSE, bool $forceBackend = FALSE)
Generate the url string to a CiviCRM path.
at line 154
array|bool
authenticate(string $name, string $password, bool $loadCMSBootstrap = FALSE, string $realPath = NULL)
Authenticate the user against the CMS db.
at line 164
setMessage(string $message)
Set a message in the CMS to display to a user.
at line 174
bool
loadUser(obj $user)
Load user into session.
at line 181
permissionDenied()
Immediately stop script execution and display a 401 "Access Denied" page.
at line 191
logout()
deprecated
deprecated
Immediately stop script execution, log out the user and redirect to the home page.
at line 199
updateCategories()
Clear CMS caches related to the user registration/profile forms.
Used when updating/embedding profiles on CMS user forms.
at line 208
string|null
getUFLocale()
Get the locale set in the CMS.
at line 230
string|null
theme(string $content, bool $print = FALSE, bool $maintenance = FALSE)
If we are using a theming system, invoke theme, else just print the content.
at line 286
string
getDefaultBlockLocation()
at line 295
bool|mixed|string
getAbsoluteBaseURL()
Get the absolute path to the site's base url.
at line 317
bool
getRelativeBaseURL()
Get the relative path to the sites base url.
at line 332
string
getVersion()
Get CMS Version.
at line 346
string
languageNegotiationURL(string $url, bool $addLanguagePart = TRUE, bool $removeLanguagePart = FALSE)
Format the url as per language Negotiation.
at line 360
string|null
cmsRootPath()
Determine the location of the CMS root.
at line 374
int|bool
createUser(array $params, string $mail)
Create a user in the CMS.
at line 386
updateCMSName(int $ufID, string $email)
Update a user's email address in the CMS.
at line 394
bool
isUserLoggedIn()
Check if user is logged in to the CMS.
at line 407
abstract string
getLoginURL(string $destination = '')
Get user login URL for hosting CMS (method declared in each CMS system class)
at line 420
string|NULL
getLoginDestination(CRM_Core_Form $form)
Get the login destination string.
When this is passed in the URL the user will be directed to it after filling in the CMS form.
at line 431
getUfId(string $username)
Determine the native ID of the CMS user.
at line 443
bool
setUFLocale(string $civicrm_language)
Set the localisation from the user framework.
at line 453
setUserSession(array $data)
Set a init session with user object.
at line 463
flush()
Reset any system caches that may be required for proper CiviCRM integration.
at line 470
clearResourceCache()
Flush css/js caches.
at line 487
bool
addScriptUrl(string $url, string $region)
Add a script file.
Note: This function is not to be called directly
at line 504
bool
addScript(string $code, string $region)
Add an inline script.
Note: This function is not to be called directly
at line 521
bool
addStyleUrl(string $url, string $region)
Add a css file.
Note: This function is not to be called directly
at line 538
bool
addStyle(string $code, string $region)
Add an inline style.
Note: This function is not to be called directly
at line 550
setTitle(string $title, string|null $pageTitle = NULL)
Sets the title of the page.
at line 563
array
getDefaultSiteSettings(string $dir)
Return default Site Settings.
at line 582
array
getDefaultFileStorage()
Determine the default location for file storage.
FIXME: 1. This was pulled out from a bigger function. It should be split into even smaller pieces and marked abstract. 2. This would be easier to compute by a calling a CMS API, but for whatever reason Civi gets it from config data.
at line 631
array
getCiviSourceStorage()
Determine the location of the CiviCRM source tree.
FIXME: 1. This was pulled out from a bigger function. It should be split into even smaller pieces and marked abstract. 2. This would be easier to compute by a calling a CMS API, but for whatever reason we take the hard way.
at line 688
userLoginFinalize(array $params = array())
Perform any post login activities required by the CMS.
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.
at line 694
setMySQLTimeZone()
Set timezone in mysql so that timestamp fields show the correct time.
at line 708
string|false|null
getTimeZoneOffset()
Get timezone from CMS.
at line 738
string
getTimeZoneString()
Get timezone as a string.
at line 751
mixed
getUniqueIdentifierFromUserObject(object $user)
Get Unique Identifier from UserFramework system (CMS).
at line 763
null|int
getUserIDFromUserObject(object $user)
Get User ID from UserFramework system (CMS).
at line 777
array
getUser(int $contactID)
Get an array of user details for a contact, containing at minimum the user ID & name.
at line 794
int|null
getLoggedInUfID()
Get currently logged in user uf id.
at line 804
string|null
getLoggedInUniqueIdentifier()
Get currently logged in user unique identifier - this tends to be the email address or user name.
at line 824
int
getBestUFID(object $user = NULL)
Return a UFID (user account ID from the UserFramework / CMS system.
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.
at line 844
string
getBestUFUniqueIdentifier(object $user = NULL)
Return a unique identifier (usually an email address or username) from the UserFramework / CMS system.
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.
at line 857
array
getModules()
List modules installed in the CMS, including enabled and disabled ones.
at line 869
string|null
getUserRecordUrl(int $contactID)
Get Url to view user record.
at line 878
bool
checkPermissionAddUser()
Is the current user permitted to add a user.
at line 887
outputError(string $content)
Output code from error function.
at line 896
logger(string $message)
Log error to CMS.
at line 904
appendCoreResources(array $list)
Append to coreResourcesList.
at line 911
setHttpHeader(string $name, string $value)
at line 921
array
synchronizeUsers()
Create CRM contacts for all existing CMS users