class CRM_Utils_System_Soap extends CRM_Utils_System_Base

Soap 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? from CRM_Utils_System_Base
bool $supports_form_extensions from CRM_Utils_System_Base
static $uf UF container variables.
static $ufClass

Methods

initialize()

No description

appendBreadCrumb(array $breadCrumbs)

Append an additional breadcrumb tag to the existing breadcrumb.

resetBreadCrumb()

Reset an additional breadcrumb tag to the existing breadcrumb.

addHTMLHead(string $head)

Append a string to the head of the html file.

mapConfigToSSL()

Rewrite various system urls to https.

string
postURL(string $action)

FIXME: Can this override be removed in favor of the parent?

string
url(string $path = NULL, string $query = NULL, bool $absolute = TRUE, string $fragment = NULL)

No description

array|bool
authenticate(string $name, $pass)

No description

setMessage(string $message)

Set a message in the CMS to display to a user.

bool
loadUser(obj $user)

Load user into session.

permissionDenied()

Immediately stop script execution and display a 401 "Access Denied" page.

logout() deprecated

Immediately stop script execution, log out the user and redirect to the home page.

updateCategories()

Clear CMS caches related to the user registration/profile forms.

string|null
getUFLocale()

Get the locale set in the CMS.

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.

string
getDefaultBlockLocation()

No description

bool|mixed|string
getAbsoluteBaseURL()

Get the absolute path to the site's base url.

bool
getRelativeBaseURL()

Get the relative path to the sites base url.

string
getVersion()

Get CMS Version.

string
languageNegotiationURL(string $url, bool $addLanguagePart = TRUE, bool $removeLanguagePart = FALSE)

Format the url as per language Negotiation.

string|null
cmsRootPath()

Determine the location of the CMS root.

int|bool
createUser(array $params, string $mail)

Create a user in the CMS.

updateCMSName(int $ufID, string $email)

Update a user's email address in the CMS.

bool
isUserLoggedIn()

Check if user is logged in to the CMS.

string
getLoginURL(string $destination = '')

Get user login URL for hosting CMS (method declared in each CMS system class)

string|NULL
getLoginDestination(CRM_Core_Form $form)

Get the login destination string.

getUfId(string $username)

Determine the native ID of the CMS user.

bool
setUFLocale(string $civicrm_language)

Set the localisation from the user framework.

setUserSession(array $data)

Set a init session with user object.

flush()

Reset any system caches that may be required for proper CiviCRM integration.

clearResourceCache()

Flush css/js caches.

bool
addScriptUrl(string $url, string $region)

Add a script file.

bool
addScript(string $code, string $region)

Add an inline script.

bool
addStyleUrl(string $url, string $region)

Add a css file.

bool
addStyle(string $code, string $region)

Add an inline style.

setTitle(string $title, string|null $pageTitle = NULL)

Sets the title of the page.

array
getDefaultSiteSettings(string $dir)

Return default Site Settings.

array
getDefaultFileStorage()

Determine the default location for file storage.

array
getCiviSourceStorage()

Determine the location of the CiviCRM source tree.

userLoginFinalize(array $params = array())

Perform any post login activities required by the CMS.

setMySQLTimeZone()

Set timezone in mysql so that timestamp fields show the correct time.

string|false|null
getTimeZoneOffset()

Get timezone from CMS.

string
getTimeZoneString()

Get timezone as a string.

mixed
getUniqueIdentifierFromUserObject(object $user)

Get Unique Identifier from UserFramework system (CMS).

null|int
getUserIDFromUserObject(object $user)

Get User ID from UserFramework system (CMS).

array
getUser(int $contactID)

Get an array of user details for a contact, containing at minimum the user ID & name.

int|null
getLoggedInUfID()

Get currently logged in user uf id.

string|null
getLoggedInUniqueIdentifier()

Get currently logged in user unique identifier - this tends to be the email address or user name.

int
getBestUFID(object $user = NULL)

Return a UFID (user account ID from the UserFramework / CMS system.

string
getBestUFUniqueIdentifier(object $user = NULL)

Return a unique identifier (usually an email address or username) from the UserFramework / CMS system.

array
getModules()

List modules installed in the CMS, including enabled and disabled ones.

string|null
getUserRecordUrl(int $contactID)

Get Url to view user record.

bool
checkPermissionAddUser()

Is the current user permitted to add a user.

outputError(string $content)

Output code from error function.

logger(string $message)

Log error to CMS.

appendCoreResources(array $list)

Append to coreResourcesList.

setHttpHeader(string $name, string $value)

No description

array
synchronizeUsers()

Create CRM contacts for all existing CMS users

bool
checkPermission(string $str)

Given a permission string, check for access requirements

setEmail(object $user)

Set the email address of the user.

swapUF()

Swap the current UF for soap.

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.

Parameters

array $breadCrumbs

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.

Parameters

string $head The new string to be appended.

in CRM_Utils_System_Base at line 85
mapConfigToSSL()

Rewrite various system urls to https.

at line 76
string postURL(string $action)

FIXME: Can this override be removed in favor of the parent?

Parameters

string $action The default url if one is pre-specified.

Return Value

string The url to post the form.

at line 61
string url(string $path = NULL, string $query = NULL, bool $absolute = TRUE, string $fragment = NULL)

Parameters

string $path The path being linked to, such as "civicrm/add".
string $query A query string to append to the link.
bool $absolute 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.
string $fragment A fragment identifier (named anchor) to append to the link.

Return Value

string

at line 92
array|bool authenticate(string $name, $pass)

Parameters

string $name The user name.
$pass

Return Value

array|bool [contactID, ufID, unique string] else false if no auth

in CRM_Utils_System_Base at line 164
setMessage(string $message)

Set a message in the CMS to display to a user.

Parameters

string $message The message to set.

in CRM_Utils_System_Base at line 174
bool loadUser(obj $user)

Load user into session.

Parameters

obj $user

Return Value

bool

in CRM_Utils_System_Base at line 181
permissionDenied()

Immediately stop script execution and display a 401 "Access Denied" page.

in CRM_Utils_System_Base at line 191
logout() deprecated

deprecated This function should be removed in favor of linking to the CMS's logout page

Immediately stop script execution, log out the user and redirect to the home page.

in CRM_Utils_System_Base at line 199
updateCategories()

Clear CMS caches related to the user registration/profile forms.

Used when updating/embedding profiles on CMS user forms.

See also

CRM-3600

in CRM_Utils_System_Base at line 208
string|null getUFLocale()

Get the locale set in the CMS.

Return Value

string|null Locale or null for none

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.

Parameters

string $content The content that will be themed.
bool $print Are we displaying to the screen or bypassing theming?.
bool $maintenance For maintenance mode.

Return Value

string|null NULL, If $print is FALSE, and some other criteria match up. The themed string, otherwise.

Exceptions

Exception

in CRM_Utils_System_Base at line 286
string getDefaultBlockLocation()

Return Value

string

in CRM_Utils_System_Base at line 295
bool|mixed|string getAbsoluteBaseURL()

Get the absolute path to the site's base url.

Return Value

bool|mixed|string

in CRM_Utils_System_Base at line 317
bool getRelativeBaseURL()

Get the relative path to the sites base url.

Return Value

bool

in CRM_Utils_System_Base at line 332
string getVersion()

Get CMS Version.

Return Value

string

in CRM_Utils_System_Base at line 346
string languageNegotiationURL(string $url, bool $addLanguagePart = TRUE, bool $removeLanguagePart = FALSE)

Format the url as per language Negotiation.

Parameters

string $url
bool $addLanguagePart
bool $removeLanguagePart

Return Value

string Formatted url.

in CRM_Utils_System_Base at line 360
string|null cmsRootPath()

Determine the location of the CMS root.

Return Value

string|null Local file system path to CMS root, or NULL if it cannot be determined

in CRM_Utils_System_Base at line 374
int|bool createUser(array $params, string $mail)

Create a user in the CMS.

Parameters

array $params
string $mail Email id for cms user.

Return Value

int|bool uid if user exists, false otherwise

in CRM_Utils_System_Base at line 386
updateCMSName(int $ufID, string $email)

Update a user's email address in the CMS.

Parameters

int $ufID User ID in CMS.
string $email Primary contact email address.

in CRM_Utils_System_Base at line 394
bool isUserLoggedIn()

Check if user is logged in to the CMS.

Return Value

bool

at line 123
string getLoginURL(string $destination = '')

Get user login URL for hosting CMS (method declared in each CMS system class)

Parameters

string $destination If present, add destination to querystring (works for Drupal only).

Return Value

string loginURL for the current CMS

Exceptions

Exception

in CRM_Utils_System_Base 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.

Parameters

CRM_Core_Form $form Form object representing the 'current' form - to which the user will be returned.

Return Value

string|NULL destination value for URL

in CRM_Utils_System_Base at line 431
getUfId(string $username)

Determine the native ID of the CMS user.

Parameters

string $username

Exceptions

CRM_Core_Exception

in CRM_Utils_System_Base at line 443
bool setUFLocale(string $civicrm_language)

Set the localisation from the user framework.

Parameters

string $civicrm_language

Return Value

bool

in CRM_Utils_System_Base at line 453
setUserSession(array $data)

Set a init session with user object.

Parameters

array $data Array with user specific data

in CRM_Utils_System_Base at line 463
flush()

Reset any system caches that may be required for proper CiviCRM integration.

in CRM_Utils_System_Base at line 470
clearResourceCache()

Flush css/js caches.

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

Parameters

string $url absolute path to file
string $region location within the document: 'html-header', 'page-header', 'page-footer'.

Return Value

bool TRUE if we support this operation in this CMS, FALSE otherwise

See also

CRM_Core_Region::render()

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

Parameters

string $code javascript code
string $region location within the document: 'html-header', 'page-header', 'page-footer'.

Return Value

bool TRUE if we support this operation in this CMS, FALSE otherwise

See also

CRM_Core_Region::render()

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

Parameters

string $url absolute path to file
string $region location within the document: 'html-header', 'page-header', 'page-footer'.

Return Value

bool TRUE if we support this operation in this CMS, FALSE otherwise

See also

CRM_Core_Region::render()

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

Parameters

string $code css code
string $region location within the document: 'html-header', 'page-header', 'page-footer'.

Return Value

bool TRUE if we support this operation in this CMS, FALSE otherwise

See also

CRM_Core_Region::render()

in CRM_Utils_System_Base at line 550
setTitle(string $title, string|null $pageTitle = NULL)

Sets the title of the page.

Parameters

string $title Title to set in html header
string|null $pageTitle Title to set in html body (if different)

in CRM_Utils_System_Base at line 563
array getDefaultSiteSettings(string $dir)

Return default Site Settings.

Parameters

string $dir

Return Value

array
  • $url, (Joomla - non admin url)
    • $siteName,
    • $siteRoot

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.

Return Value

array
  • url: string. ex: "http://example.com/sites/foo.com/files/civicrm"
    • path: string. ex: "/var/www/sites/foo.com/files/civicrm"

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.

Return Value

array
  • url: string. ex: "http://example.com/sites/all/modules/civicrm"
    • path: string. ex: "/var/www/sites/all/modules/civicrm"

in CRM_Utils_System_Base 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.

Parameters

array $params FIXME: Document values accepted/required by $params

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.

Return Value

string|false|null

in CRM_Utils_System_Base at line 738
string getTimeZoneString()

Get timezone as a string.

Return Value

string Timezone string e.g. 'America/Los_Angeles'

in CRM_Utils_System_Base at line 751
mixed getUniqueIdentifierFromUserObject(object $user)

Get Unique Identifier from UserFramework system (CMS).

Parameters

object $user Object as described by the User Framework.

Return Value

mixed Unique identifier from the user Framework system

in CRM_Utils_System_Base at line 763
null|int getUserIDFromUserObject(object $user)

Get User ID from UserFramework system (CMS).

Parameters

object $user Object as described by the User Framework.

Return Value

null|int

in CRM_Utils_System_Base at line 777
array getUser(int $contactID)

Get an array of user details for a contact, containing at minimum the user ID & name.

Parameters

int $contactID

Return Value

array CMS user details including - id - name (ie the system user name.

in CRM_Utils_System_Base at line 794
int|null getLoggedInUfID()

Get currently logged in user uf id.

Return Value

int|null logged in user uf id.

in CRM_Utils_System_Base at line 804
string|null getLoggedInUniqueIdentifier()

Get currently logged in user unique identifier - this tends to be the email address or user name.

Return Value

string|null logged in user unique identifier

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.

Parameters

object $user

Return Value

int User ID of UF System

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.

Parameters

object $user

Return Value

string unique identifier from the UF System

in CRM_Utils_System_Base at line 857
array getModules()

List modules installed in the CMS, including enabled and disabled ones.

Return Value

array [CRM_Core_Module]

in CRM_Utils_System_Base at line 869
string|null getUserRecordUrl(int $contactID)

Get Url to view user record.

Parameters

int $contactID Contact ID.

Return Value

string|null

in CRM_Utils_System_Base at line 878
bool checkPermissionAddUser()

Is the current user permitted to add a user.

Return Value

bool

in CRM_Utils_System_Base at line 887
outputError(string $content)

Output code from error function.

Parameters

string $content

in CRM_Utils_System_Base at line 896
logger(string $message)

Log error to CMS.

Parameters

string $message

in CRM_Utils_System_Base at line 904
appendCoreResources(array $list)

Append to coreResourcesList.

Parameters

array $list

in CRM_Utils_System_Base at line 911
setHttpHeader(string $name, string $value)

Parameters

string $name
string $value

in CRM_Utils_System_Base at line 921
array synchronizeUsers()

Create CRM contacts for all existing CMS users

Return Value

array

Exceptions

Exception

at line 54
bool checkPermission(string $str)

Given a permission string, check for access requirements

Parameters

string $str The permission to check.

Return Value

bool true if yes, else false

at line 86
setEmail(object $user)

Set the email address of the user.

Parameters

object $user Handle to the user object.

at line 106
swapUF()

Swap the current UF for soap.