CRM_Utils_System_DrupalBase
class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base
Drupal specific stuff goes here
Properties
bool | $is_drupal | Deprecated property to check if this is a drupal install. | from CRM_Utils_System_Base |
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 | from CRM_Utils_System_Base |
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 | from CRM_Utils_System_Base |
bool | $supports_UF_Logging | Does this CMS / UF support a CMS specific logging mechanism? | |
bool | $supports_form_extensions | from CRM_Utils_System_Base |
Methods
Append an additional breadcrumb tag to the existing breadcrumb.
Reset an additional breadcrumb tag to the existing breadcrumb.
Fixme: Why are we overriding the parent function? Seems inconsistent.
Generate an internal CiviCRM URL (copied from DRUPAL/includes/common.inc#url)
Authenticate the user against the CMS db.
No description
No description
Immediately stop script execution, log out the user and redirect to the home page.
No description
No description
If we are using a theming system, invoke theme, else just print the content.
Get the absolute path to the site's base url.
No description
No description
Create a user in the CMS.
Update a user's email address in the CMS.
Get user login URL for hosting CMS (method declared in each CMS system class)
No description
No description
No description
Sets the title of the page.
No description
Determine the default location for file storage.
Determine the location of the CiviCRM source tree.
Perform any post login activities required by the UF - 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.
Set timezone in mysql so that timestamp fields show the correct time.
No description
No description
Get an array of user details for a contact, containing at minimum the user ID & name.
No description
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.
No description
No description
No description
No description
Append Drupal js to coreResourcesList.
No description
Check if a resource url is within the drupal directory and format appropriately.
In instance where civicrm folder has a drupal folder & a civicrm core folder @ the same level append the civicrm folder name to the url See CRM-13737 for discussion of how this allows implementers to alter the folder structure
Find any users/roles/security-principals with the given permission and replace it with one or more permissions.
Load the user object.
Parse the name of the drupal site.
Details
in CRM_Utils_System_Base at line 53
initialize()
in CRM_Utils_System_Base at line 64
appendBreadCrumb(array $breadCrumbs)
Append an additional breadcrumb tag to the existing breadcrumb.
in CRM_Utils_System_Base at line 70
resetBreadCrumb()
Reset an additional breadcrumb tag to the existing breadcrumb.
in CRM_Utils_System_Base at line 79
addHTMLHead(string $head)
Append a string to the head of the html file.
in CRM_Utils_System_Base at line 85
mapConfigToSSL()
Rewrite various system urls to https.
at line 510
string
postURL(string $action)
Fixme: Why are we overriding the parent function? Seems inconsistent.
This version supplies slightly different params to $this->url (not absolute and html encoded) but why?
at line 149
string
url(string $path = NULL, string $query = NULL, bool $absolute = FALSE, string $fragment = NULL, bool $frontend = FALSE, bool $forceBackend = FALSE)
Generate an internal CiviCRM URL (copied from DRUPAL/includes/common.inc#url)
in CRM_Utils_System_Base 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 218
setMessage(string $message)
in CRM_Utils_System_Base at line 174
bool
loadUser(obj $user)
Load user into session.
at line 240
permissionDenied()
in CRM_Utils_System_Base at line 191
logout()
deprecated
deprecated
Immediately stop script execution, log out the user and redirect to the home page.
at line 399
updateCategories()
at line 408
string|null
getUFLocale()
in CRM_Utils_System_Base 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.
in CRM_Utils_System_Base at line 286
string
getDefaultBlockLocation()
in CRM_Utils_System_Base at line 295
bool|mixed|string
getAbsoluteBaseURL()
Get the absolute path to the site's base url.
in CRM_Utils_System_Base at line 317
bool
getRelativeBaseURL()
Get the relative path to the sites base url.
at line 392
string
getVersion()
at line 333
string
languageNegotiationURL(string $url, bool $addLanguagePart = TRUE, bool $removeLanguagePart = FALSE)
in CRM_Utils_System_Base at line 360
string|null
cmsRootPath()
Determine the location of the CMS root.
in CRM_Utils_System_Base at line 374
int|bool
createUser(array $params, string $mail)
Create a user in the CMS.
in CRM_Utils_System_Base at line 386
updateCMSName(int $ufID, string $email)
Update a user's email address in the CMS.
in CRM_Utils_System_Base at line 394
bool
isUserLoggedIn()
Check if user is logged in to the CMS.
in CRM_Utils_System_Base at line 407
abstract string
getLoginURL(string $destination = '')
Get user login URL for hosting CMS (method declared in each CMS system class)
at line 472
string|NULL
getLoginDestination(CRM_Core_Form $form)
in CRM_Utils_System_Base at line 431
getUfId(string $username)
Determine the native ID of the CMS user.
at line 436
bool
setUFLocale(string $civicrm_language)
in CRM_Utils_System_Base at line 453
setUserSession(array $data)
Set a init session with user object.
at line 294
flush()
at line 278
clearResourceCache()
in CRM_Utils_System_Base at line 487
bool
addScriptUrl(string $url, string $region)
Add a script file.
Note: This function is not to be called directly
in CRM_Utils_System_Base at line 504
bool
addScript(string $code, string $region)
Add an inline script.
Note: This function is not to be called directly
in CRM_Utils_System_Base at line 521
bool
addStyleUrl(string $url, string $region)
Add a css file.
Note: This function is not to be called directly
in CRM_Utils_System_Base at line 538
bool
addStyle(string $code, string $region)
Add an inline style.
Note: This function is not to be called directly
in CRM_Utils_System_Base at line 550
setTitle(string $title, string|null $pageTitle = NULL)
Sets the title of the page.
at line 64
array
getDefaultSiteSettings(string $dir)
in CRM_Utils_System_Base 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.
in CRM_Utils_System_Base 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 465
userLoginFinalize(array $params = array())
Perform any post login activities required by the UF - 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.
in CRM_Utils_System_Base at line 694
setMySQLTimeZone()
Set timezone in mysql so that timestamp fields show the correct time.
in CRM_Utils_System_Base at line 708
string|false|null
getTimeZoneOffset()
Get timezone from CMS.
in CRM_Utils_System_Base at line 738
string
getTimeZoneString()
Get timezone as a string.
at line 225
mixed
getUniqueIdentifierFromUserObject(object $user)
at line 211
null|int
getUserIDFromUserObject(object $user)
at line 527
array
getUser(int $contactID)
Get an array of user details for a contact, containing at minimum the user ID & name.
in CRM_Utils_System_Base at line 794
int|null
getLoggedInUfID()
Get currently logged in user uf id.
at line 232
string|null
getLoggedInUniqueIdentifier()
in CRM_Utils_System_Base 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.
in CRM_Utils_System_Base 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 301
array
getModules()
at line 247
string|null
getUserRecordUrl(int $contactID)
at line 262
bool
checkPermissionAddUser()
in CRM_Utils_System_Base at line 887
outputError(string $content)
Output code from error function.
at line 269
logger(string $message)
at line 287
appendCoreResources(array $list)
Append Drupal js to coreResourcesList.
in CRM_Utils_System_Base at line 911
setHttpHeader(string $name, string $value)
in CRM_Utils_System_Base at line 921
array
synchronizeUsers()
Create CRM contacts for all existing CMS users
at line 50
__construct()
at line 95
bool
formatResourceUrl($url)
Check if a resource url is within the drupal directory and format appropriately.
at line 135
string
appendCoreDirectoryToResourceBase(string $url)
In instance where civicrm folder has a drupal folder & a civicrm core folder @ the same level append the civicrm folder name to the url See CRM-13737 for discussion of how this allows implementers to alter the folder structure
at line 320
void
replacePermission(string $oldPerm, array $newPerms)
Find any users/roles/security-principals with the given permission and replace it with one or more permissions.
at line 544
object
getUserObject($userID)
Load the user object.
Note this function still works in drupal 6, 7 & 8 but is deprecated in Drupal 8.
at line 555
null|string
parseDrupalSiteName(string $civicrm_root)
Parse the name of the drupal site.