CRM_Utils_System_Backdrop
class CRM_Utils_System_Backdrop extends CRM_Utils_System_DrupalBase
Backdrop-specific logic that differs from Drupal.
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? | from CRM_Utils_System_DrupalBase |
bool | $supports_form_extensions | from CRM_Utils_System_Base |
Methods
Load Backdrop bootstrap.
No description
No description
No description
No description
Fixme: Why are we overriding the parent function? Seems inconsistent.
Generate an internal CiviCRM URL (copied from DRUPAL/includes/common.inc#url)
No description
No description
No description
No description
No description
No description
If we are using a theming system, invoke theme, else just print the content.
Get the default location for CiviCRM blocks.
Get the absolute path to the site's base url.
No description
No description
No description
No description
No description
No description
No description
No description
Determine the native ID of the CMS user.
No description
No description
No description
No description
No description
No description
No description
No description
No description
Determine the location of the CiviCRM source tree.
Perform any post login activities required by the UF - For Backdrop this could mean recording a watchdog message about the new session, saving the login timestamp, calling hook_user_login(), etc.
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
Send an HTTP Response base on PSR HTTP RespnseInterface response.
Check if a resource url is within the Backdrop 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.
Function to return current language of Drupal
Check if username and email exists in the Backdrop db.
Get the name of the table that stores the user details.
Wrapper for og_membership creation.
Wrapper for og_membership deletion.
Get all the contact emails for users that have a specific permission.
Details
in CRM_Utils_System_Base at line 53
initialize()
at line 530
loadBootStrap($params = [], $loadUser = TRUE, $throwError = TRUE, $realPath = NULL)
Load Backdrop bootstrap.
at line 174
appendBreadCrumb(array $breadCrumbs)
at line 199
resetBreadCrumb()
at line 207
addHTMLHead($header)
at line 286
mapConfigToSSL()
in CRM_Utils_System_DrupalBase at line 540
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?
in CRM_Utils_System_DrupalBase at line 168
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)
at line 307
array|bool
authenticate(string $name, string $password, bool $loadCMSBootstrap = FALSE, string $realPath = NULL)
at line 974
setMessage(string $message)
at line 384
bool
loadUser($username)
at line 981
permissionDenied()
at line 503
logout()
in CRM_Utils_System_DrupalBase at line 429
updateCategories()
at line 438
string|null
getUFLocale()
in CRM_Utils_System_Base at line 232
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 513
string
getDefaultBlockLocation()
Get the default location for CiviCRM blocks.
in CRM_Utils_System_Base at line 296
bool|mixed|string
getAbsoluteBaseURL()
Get the absolute path to the site's base url.
in CRM_Utils_System_Base at line 318
bool
getRelativeBaseURL()
Get the relative path to the sites base url.
in CRM_Utils_System_DrupalBase at line 402
string
getVersion()
at line 706
string
languageNegotiationURL(string $url, bool $addLanguagePart = TRUE, bool $removeLanguagePart = FALSE)
at line 631
string|null
cmsRootPath($scriptFilename = NULL)
at line 42
int|bool
createUser(array $params, string $mail)
at line 94
updateCMSName(int $ufID, string $email)
at line 679
bool
isUserLoggedIn()
at line 418
bool
isUserRegistrationPermitted()
at line 428
bool
isPasswordUserGenerated()
in CRM_Utils_System_DrupalBase at line 675
bool
isFrontEndPage()
Is a front end page being accessed.
Generally this would be a contribution form or other public page as opposed to a backoffice page (like contact edit).
See https://github.com/civicrm/civicrm-drupal/pull/546/files
at line 153
string
getLoginURL(string $destination = '')
in CRM_Utils_System_DrupalBase at line 502
string|NULL
getLoginDestination(CRM_Core_Form $form)
at line 492
getUfId(string $username)
Determine the native ID of the CMS user.
at line 466
bool
setUFLocale(string $civicrm_language)
in CRM_Utils_System_Base at line 485
setUserSession(array $data)
Set a init session with user object.
at line 988
flush()
at line 895
clearResourceCache()
at line 222
bool
addScriptUrl(string $url, string $region)
at line 242
bool
addScript(string $code, string $region)
at line 260
bool
addStyleUrl(string $url, string $region)
at line 274
bool
addStyle(string $code, string $region)
at line 161
setTitle(string $title, string|null $pageTitle = NULL)
in CRM_Utils_System_DrupalBase at line 85
array
getDefaultSiteSettings(string $dir)
at line 916
array
getDefaultFileStorage()
in CRM_Utils_System_Base at line 654
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 411
userLoginFinalize(array $params = [])
Perform any post login activities required by the UF - For Backdrop this could mean recording a watchdog message about the new session, saving the login timestamp, calling hook_user_login(), etc.
in CRM_Utils_System_Base at line 717
setMySQLTimeZone()
Set timezone in mysql so that timestamp fields show the correct time.
in CRM_Utils_System_Base at line 730
string|false|null
getTimeZoneOffset()
Get timezone from CMS.
at line 831
string
getTimeZoneString()
in CRM_Utils_System_DrupalBase at line 244
mixed
getUniqueIdentifierFromUserObject(object $user)
in CRM_Utils_System_DrupalBase at line 230
null|int
getUserIDFromUserObject(object $user)
in CRM_Utils_System_DrupalBase at line 557
array
getUser(int $contactID)
Get an array of user details for a contact, containing at minimum the user ID & name.
at line 691
int|null
getLoggedInUfID()
in CRM_Utils_System_DrupalBase at line 251
string|null
getLoggedInUniqueIdentifier()
in CRM_Utils_System_Base at line 851
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 871
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.
in CRM_Utils_System_DrupalBase at line 311
array
getModules()
in CRM_Utils_System_DrupalBase at line 266
string|null
getUserRecordUrl(int $contactID)
in CRM_Utils_System_DrupalBase at line 281
bool
checkPermissionAddUser()
in CRM_Utils_System_Base at line 914
outputError(string $content)
Output code from error function.
in CRM_Utils_System_DrupalBase at line 288
logger(string $message)
at line 1044
appendCoreResources(GenericHookEvent $e)
Append Backdrop CSS and JS to coreResourcesList.
in CRM_Utils_System_Base at line 939
alterAssetUrl(GenericHookEvent $e)
Modify dynamic assets.
at line 849
setHttpHeader(string $name, string $value)
at line 856
array
synchronizeUsers()
in CRM_Utils_System_Base at line 966
sendResponse(ResponseInterface $response)
Send an HTTP Response base on PSR HTTP RespnseInterface response.
in CRM_Utils_System_DrupalBase at line 50
__construct()
at line 943
bool
formatResourceUrl($url)
Check if a resource url is within the Backdrop directory and format appropriately.
in CRM_Utils_System_DrupalBase at line 154
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 774
void
replacePermission(string $oldPerm, array $newPerms)
Find any users/roles/security-principals with the given permission and replace it with one or more permissions.
in CRM_Utils_System_DrupalBase at line 574
object
getUserObject($userID)
Load the user object.
Note this function still works in drupal 6, 7 & 8 but is deprecated in Drupal 8.
in CRM_Utils_System_DrupalBase at line 586
null|string
parseDrupalSiteNameFromRoot(string $civicrm_root)
deprecated
deprecated
Parse the name of the drupal site.
in CRM_Utils_System_DrupalBase at line 661
string
getCurrentLanguage()
Function to return current language of Drupal
at line 115
static
checkUserNameEmailExists(array $params, array $errors, string $emailName = 'email')
Check if username and email exists in the Backdrop db.
at line 296
protected string
getUsersTableName()
Get the name of the table that stores the user details.
at line 792
og_membership_create(int $ogID, int $userID)
Wrapper for og_membership creation.
at line 815
og_membership_delete(int $ogID, int $userID)
Wrapper for og_membership deletion.
at line 908
string
permissionEmails(string $permissionName)
Get all the contact emails for users that have a specific permission.