Squiz Matrix
4.12.2
|
Public Member Functions | |
__construct () | |
__destruct () | |
init () | |
start () | |
replaceKeyword (&$content, $additional_replacements=Array()) | |
setGlobalDefine ($index, $value) | |
unsetGlobalDefine ($index) | |
getGlobalDefine ($index, $default=NULL) | |
isGlobalDefineSet ($index) | |
paintLogin ($heading, $msg) | |
paintPasswordChange ($heading, $msg) | |
setupUser () | |
_processGlobalActions () | |
loginPublicUser () | |
loginUser (User $user, $invoking_user_full_name= '') | |
setCurrentUser (User $user) | |
restoreCurrentUser () | |
getUniqueSessionKey () | |
getUniqueSOAPSessionKey () | |
generateLoginKey ($force_new_key=FALSE) | |
loginKey () | |
getSessionHandlerClassName () | |
_findValidSessionExpiry ($session_prefs) | |
currentUser ($user) | |
currentUserId () | |
& | getPublicUser () |
userRoot ($user=NULL) | |
userSystemAdmin ($user=NULL) | |
userPublic ($user=NULL) | |
getUserPrefs ($asset_type=NULL, $pref=NULL, $value_only=TRUE) | |
getContextId () | |
changeContext ($contextid) | |
restoreContext () | |
getAllContexts ($force_reload=FALSE) | |
insertContextData ($contextid) | |
deleteContextData ($contextid) | |
getAlternateContext () | |
& | getMessagingService () |
& | getFileVersioning () |
& | getHipoHerder () |
& | getMetadataManager () |
& | getWorkflowManager () |
& | getEventManager () |
& | getTagManager () |
& | getTriggerManager () |
& | getLogManager () |
getDejaVu () | |
setRunLevel ($run_level) | |
restoreRunLevel () | |
getRunLevel () | |
runLevelEnables ($security_system) | |
changeDatabaseConnection ($conn, $oci_force_new=FALSE) | |
restoreDatabaseConnection ($force_reconnect=FALSE) | |
doTransaction ($type) | |
printRollbackWarning () | |
constructRollbackWhereClause ($where='', $table_alias=NULL, $prefix='WHERE', $is_table_alias=TRUE) | |
acquireLock ($lockid, $source_lockid='', $expires=0) | |
releaseLock ($lockid) | |
updateLock ($lockid, $expires=0) | |
getLockInfo ($lockid, $full_chain=FALSE, $check_expires=TRUE, $allow_only_one=TRUE) | |
addMessage ($msg) | |
messages () | |
datetime ($timestamp=NULL) | |
date ($timestamp=NULL) | |
time ($timestamp=NULL) | |
getInstalledPackages () | |
broadcastTriggerEvent ($event_name, &$broadcaster, $parameters=NULL) | |
_getHeaders () | |
authRedirect () | |
_generateAttributeImage ($text) | |
_translateMatrixURL (&$content) | |
_translatePerformanceModeURL (&$content) | |
Public Member Functions inherited from MySource_Object | |
MySource_Object () | |
__sleep () | |
__wakeup () | |
Data Fields | |
$db | |
$backend | |
$am | |
$tm | |
$pm | |
$lm | |
$log_manager | |
$user = NULL | |
$frontend_asset | |
Data Fields inherited from MySource_Object | |
$_tmp | |
Protected Member Functions | |
_setApacheNotes () | |
_sendHTTPHeaders (&$asset) | |
_loginHttpAuthenticatedUser () | |
_authenticateHttpUser () | |
_updateSessionCookie () | |
_clearSession () | |
_logSecurityMsg ($code, $extra_replacements=Array(), $failed_login=FALSE) | |
_paintNotFoundAsset (Asset $asset, Site $site) | |
Definition at line 38 of file mysource.inc.
__construct | ( | ) |
Constructor
Definition at line 217 of file mysource.inc.
__destruct | ( | ) |
Destructor
Attempts to save locale manager in Deja Vu to improve performance.
Definition at line 231 of file mysource.inc.
|
protected |
Check the user authentication. If the user is authenticated then it assigns the user and returns TRUE else returns FALSE
Definition at line 2058 of file mysource.inc.
|
protected |
Clear the user's session of all data
Definition at line 2532 of file mysource.inc.
_findValidSessionExpiry | ( | $session_prefs | ) |
Find the largest valid session expiry for the current user
array | $session_prefs | An array of all the current preferences |
Definition at line 2456 of file mysource.inc.
_generateAttributeImage | ( | $text | ) |
Generates a attribute image
string | $text | The text of the image |
Definition at line 4197 of file mysource.inc.
_getHeaders | ( | ) |
Replacement function that allows request headers to be taken from CGI
Definition at line 4063 of file mysource.inc.
|
protected |
Try to login a user who has already been HTTP-authenticated by some external mechanism
Definition at line 2024 of file mysource.inc.
|
protected |
Log a message to do with system security (logging in / out)
string | $code | The message code for the message |
array | $extra_replacements | Extra keyword replacements to use in the message (user_name is already there) |
boolean | $failed_login | status of the log in process |
Definition at line 2555 of file mysource.inc.
Paint a Not Found page
This function will print the HTTP 404 header, any necessary headers for the sending of Cacheable Headers, and then the "Not Found" asset itself. This will typically be the "Not Found" asset of the site, but may have been set to something else (eg. the "Archived Asset" 404 link).
Asset | $asset | The asset that represents the Not Found page |
Site | $site | The site that has set the Not Found page |
Definition at line 4091 of file mysource.inc.
_processGlobalActions | ( | ) |
Processes any global actions that need to be taken care of
Definition at line 1439 of file mysource.inc.
|
protected |
Sends appropiate HTTP Headers based on the system config
object | &$asset | the asset being processed |
Definition at line 928 of file mysource.inc.
|
protected |
Sets the Apache Request Notes with the set information filled on the the Apache Configuration Screen
Definition at line 896 of file mysource.inc.
_translateMatrixURL | ( | & | $content | ) |
Replace "./?a=xx" URLs by their respective full URLs
string | &$content | The content to replace ./a=xx urls in |
Definition at line 4280 of file mysource.inc.
_translatePerformanceModeURL | ( | & | $content | ) |
Replace all URLs with performance suffix and target = _top
string | &$content | The entire matrix output content |
Definition at line 4309 of file mysource.inc.
|
protected |
Update the session cookie with the appropriate expiry time given the kind of user we are
Note: this function must be called before any other cookies are set or it will clear their set-cookie headers
Definition at line 2390 of file mysource.inc.
acquireLock | ( | $lockid, | |
$source_lockid = '' , |
|||
$expires = 0 |
|||
) |
Attempts to acquire a lock
returns TRUE on success or the error message on failure
string | $lockid | the id of the lock |
string | $source_lockid | the id of the lock that started this locking process |
int | $expires | when the lock expires (timestamp or NULL) If expires is set to NULL, the lock will be acquired indefinitely (ie. it will never expire). If expires is set to zero, the lock will be acquired for the current time plus SQ_CONF_LOCK_LENGTH |
Definition at line 3826 of file mysource.inc.
addMessage | ( | $msg | ) |
Add a system message
string | $msg | message |
Definition at line 3934 of file mysource.inc.
authRedirect | ( | ) |
Sees if an auth redirect is available, and then redirects if there is The redirect will be attempted on the same protocol (HTTP or HTTPS) that the original request was made on. If the URL being redirected to does not support the current protocol, it will use the protocol it can use instead.
Returns boolean FALSE if no redirect exists, otherwise this function will NOT return (as a result of exit() being called in do_redirect()).
Definition at line 4144 of file mysource.inc.
broadcastTriggerEvent | ( | $event_name, | |
& | $broadcaster, | ||
$parameters = NULL |
|||
) |
Broadcast a trigger event
string | $event_name | a valid trigger event name |
object | &$broadcaster | an asset that broadcast the event |
array | $parameters | an array of parameters that trigger conditions are expected to understand |
Definition at line 4042 of file mysource.inc.
changeContext | ( | $contextid | ) |
Change the current context, and place it on the stack
int | $contextid | The ID of the context to change to |
Definition at line 2812 of file mysource.inc.
changeDatabaseConnection | ( | $conn, | |
$oci_force_new = FALSE |
|||
) |
Alter's which DB connection to use
string | $conn | [db|db2] which DB connection to use |
string | $oci_force_new | force a new connection for oci |
Definition at line 3557 of file mysource.inc.
constructRollbackWhereClause | ( | $where = '' , |
|
$table_alias = NULL , |
|||
$prefix = 'WHERE' , |
|||
$is_table_alias = TRUE |
|||
) |
Given a WHERE clause, this function will append extra where conditions to the clause that allow selection of rollback entries based on the current rollback view mode settings
string | $where | a current where clause without WHERE on the front NOTE: if the string begins with WHERE, it will be stripped |
string | $table_alias | the table alias to add entries for eg. SELECT * FROM asset a –> $table_alias is 'a' so rollback queries for table 'a' get added, otherwise the entries will not be prefixed with an alias |
string | $prefix | the prefix (eg 'WHERE' or 'AND') to put at the start of the condition |
boolean | $is_table_alias | TRUE if the specified alias is a table alias, FALSE if it is a column prefix |
Definition at line 3774 of file mysource.inc.
currentUser | ( | $user | ) |
Returns TRUE if the passed user is the logged in user
object | $user | the user to check |
Definition at line 2581 of file mysource.inc.
currentUserId | ( | ) |
Returns the userid of the current user, or zero if none present
Definition at line 2594 of file mysource.inc.
date | ( | $timestamp = NULL | ) |
Returns date string for the passed timestamp
int | $timestamp | timestamp to format, if null uses current timestamp |
Definition at line 3980 of file mysource.inc.
datetime | ( | $timestamp = NULL | ) |
Returns date time string for the passed timestamp
int | $timestamp | timestamp to format, if null uses current timestamp |
Definition at line 3965 of file mysource.inc.
deleteContextData | ( | $contextid | ) |
Deletes the information associated with a deleted context
Returns TRUE on success, FALSE on failure
int | $contextid | The ID of the condemned context |
Definition at line 2918 of file mysource.inc.
doTransaction | ( | $type | ) |
Begin, Commit, or Rollback a transaction
Call as many times as you like. Ensures the transaction manager has been created.
string | $type | the type of transaction to do (begin, commit, rollback) |
Definition at line 3668 of file mysource.inc.
generateLoginKey | ( | $force_new_key = FALSE | ) |
Generates a new login key and returns it
boolean | $force_new_key | if TRUE the key will regenerated even if there is already a value save in the session |
Definition at line 2333 of file mysource.inc.
getAllContexts | ( | $force_reload = FALSE | ) |
Gets and caches information about all contexts
This could be just called from the database each time. This is being placed in a function to allow us to cache the info, as it's unlikely to change within a request.
If it's vital to get the latest context info, call with a parameter of TRUE to force reload.
boolean | $force_reload | If TRUE, always reload data from the database. If FALSE, use cache if loaded. |
Definition at line 2853 of file mysource.inc.
getAlternateContext | ( | ) |
Returns the context we should be using based on the settings on the Context Configuration screen
Returns the ID of the context that we should be using, or '0' (representing the default context) if none are appropriate.
Definition at line 2956 of file mysource.inc.
getContextId | ( | ) |
getDejaVu | ( | ) |
Get Deja Vu for that eerie "have me not met before?" feeling.
Always call this function to get Deja Vu, dont use $this->_deja_vu directly
Definition at line 3448 of file mysource.inc.
& getEventManager | ( | ) |
Get the event manager so you can fire events
Always call this function to get the event manager, dont use $this->em directly
Definition at line 3365 of file mysource.inc.
& getFileVersioning | ( | ) |
Get the file versioning object so you can add/remove/commit/checkout file versions
Always call this function to get the file versioning object, dont use $this->fv directly
Definition at line 3289 of file mysource.inc.
getGlobalDefine | ( | $index, | |
$default = NULL |
|||
) |
Get the value of a global define, or $default if the variable doesn't exist
string | $index | the index of the variable |
string | $default | a default value to return if $index not set |
Definition at line 1112 of file mysource.inc.
& getHipoHerder | ( | ) |
Get the HIPO herder so you can queue and run HIPO jobs
Always call this function to get the HIPO herder, dont use $this->hh directly
Definition at line 3308 of file mysource.inc.
getInstalledPackages | ( | ) |
Returns some information about the currently installed packages.
Returns the code name, version, name and description for each of the currently installed packages NOTE: do NOT ever cache the results of this function within the function because some parts of the install require the most up-to-date info about which packages are installed.
Definition at line 4015 of file mysource.inc.
getLockInfo | ( | $lockid, | |
$full_chain = FALSE , |
|||
$check_expires = TRUE , |
|||
$allow_only_one = TRUE |
|||
) |
Returns an array of information about the passed lock
string | array | $lockid | the id of the lock |
boolean | $full_chain | return the info for every lock in the lock chain |
boolean | $check_expires | check the expiry date and cleanup the lock if it has expired |
boolean | $allow_only_one | Force only one lock returned |
Definition at line 3907 of file mysource.inc.
& getLogManager | ( | ) |
& getMessagingService | ( | ) |
Get the messaging service object so you can send/receive messages
Always call this function to get the messaging service, dont use $this->ms directly
Definition at line 3270 of file mysource.inc.
& getMetadataManager | ( | ) |
Get the metadata manager so you can manage metadata in the system
Always call this function to get the metadata manager, dont use $this->mm directly
Definition at line 3327 of file mysource.inc.
& getPublicUser | ( | ) |
Returns the userid of the public access user, if it exists in the system
Definition at line 2613 of file mysource.inc.
getRunLevel | ( | ) |
Get the current run level
Returns NULL if no run level has been set
Definition at line 3510 of file mysource.inc.
& getTagManager | ( | ) |
Get the tag manager
Always call this function to get the event manager, dont use $this->tm directly
Definition at line 3384 of file mysource.inc.
& getTriggerManager | ( | ) |
Get the trigger manager so you can fire trigger events
Always call this function to get the trigger manager, dont use $this->wm directly
Definition at line 3403 of file mysource.inc.
getUniqueSessionKey | ( | ) |
Returns a unique session key
the key can be used to strengthen the sending of the session id as a $_GET variable
Definition at line 2283 of file mysource.inc.
getUniqueSOAPSessionKey | ( | ) |
Returns a unique session key
the key can be used to strengthen the sending of the session id as a $_GET variable
Definition at line 2310 of file mysource.inc.
getUserPrefs | ( | $asset_type = NULL , |
|
$pref = NULL , |
|||
$value_only = TRUE |
|||
) |
Get user preferences (user specific config settings) for the current user
string | $asset_type | Asset type whose preferences we want (leave NULL to get all prefs) |
string | $pref | Name of the preference var we want (leave NULL for all prefs for the asset type) |
boolean | $value_only | If TRUE, returns the value of the pref only, rather than all its details |
Definition at line 2696 of file mysource.inc.
& getWorkflowManager | ( | ) |
Get the workflow manager so you can manage workflow in the system
Always call this function to get the workflow manager, dont use $this->wm directly
Definition at line 3346 of file mysource.inc.
init | ( | ) |
This initialises all the objects that we need to use, the reason that we can't do this in the constructor is that the Asset_Manager uses the DB in it's constructor in order to load the asset types but if initialise the Asset_Manager in our constructor we don't exist and therefore cannot be accessed to get the DB for the Asset_Manager to use
Definition at line 258 of file mysource.inc.
insertContextData | ( | $contextid | ) |
Copies the attribute data for a new contextid from the default
Returns TRUE on success, FALSE on failure
int | $contextid | The ID of the new context |
Definition at line 2881 of file mysource.inc.
isGlobalDefineSet | ( | $index | ) |
Check if a globally defined variable has been set
string | $index | the index of the variable |
Definition at line 1128 of file mysource.inc.
loginKey | ( | ) |
loginPublicUser | ( | ) |
loginUser | ( | User | $user, |
$invoking_user_full_name = '' |
|||
) |
Log in the specified user, setting the session etc as appropriate
SHOULD BE USED WITH CAUTION - the assumption is that this user has already been authenticated
User | $user | The user object to log in |
string | $invoking_user_full_name | The name of the user who has invoked the login (only used from the "Login As..." function) |
Definition at line 2101 of file mysource.inc.
messages | ( | ) |
Returns the system messages, array(string)
Definition at line 3947 of file mysource.inc.
paintLogin | ( | $heading, | |
$msg | |||
) |
Paints the login form, based upon which url we are currently at
string | $heading | a heading to print on the form |
string | $msg | a msg to print with the form |
Definition at line 1147 of file mysource.inc.
paintPasswordChange | ( | $heading, | |
$msg | |||
) |
Paints the password change form, based upon which url we are currently at
string | $heading | a heading to print on the form |
string | $msg | a msg to print with the form |
Definition at line 1247 of file mysource.inc.
printRollbackWarning | ( | ) |
Prints a warning box to let the user know that they are viewing the system in rollback mode Also includes the system time they are viewing and how long ago that was
Definition at line 3709 of file mysource.inc.
releaseLock | ( | $lockid | ) |
Release the passed lock
string | $lockid | the id of the lock to release |
Definition at line 3850 of file mysource.inc.
replaceKeyword | ( | & | $content, |
$additional_replacements = Array() |
|||
) |
Highest level of keyword replacement is done here
string | &$content | the text to replace keywords in |
array | $additional_replacements | extra replacements to add |
Definition at line 1042 of file mysource.inc.
restoreContext | ( | ) |
Restore the previous context from the stack
Definition at line 2824 of file mysource.inc.
restoreCurrentUser | ( | ) |
Reset the current user to the previously assigned user
SHOULD BE USED WITH CAUTION
Definition at line 2246 of file mysource.inc.
restoreDatabaseConnection | ( | $force_reconnect = FALSE | ) |
Restore the active DB connection to the previous one
boolean | $force_reconnect | set to true for pcntl fork reconnect |
Definition at line 3645 of file mysource.inc.
restoreRunLevel | ( | ) |
Restore the run level to the previously set one
Definition at line 3490 of file mysource.inc.
runLevelEnables | ( | $security_system | ) |
Check if the current run level enables a particular security sub-system
int | $security_system | one of the SQ_SECURITY_* constants thats represents the security sub-system we want to check is enabled |
Definition at line 3532 of file mysource.inc.
setCurrentUser | ( | User | $user | ) |
Sets the current user of the system to be the specified user
SHOULD BE USED WITH CAUTION - no authentication is done inside here This is generally to be used by scripts etc - the session is not updated with the new user's details
User | $user | the user to make current |
Definition at line 2211 of file mysource.inc.
setGlobalDefine | ( | $index, | |
$value | |||
) |
Set a new global define, or overwrite the value of an existing one
string | $index | the index of the variable |
string | $value | the value of the variable |
Definition at line 1079 of file mysource.inc.
setRunLevel | ( | $run_level | ) |
Set the current run level
int | $run_level | a combination of any of the SQ_SECURITY_* constants that determine which security sub-systems will be enabled (can also use the SQ_RUN_LEVEL_* constants as short-cuts) |
Definition at line 3477 of file mysource.inc.
setupUser | ( | ) |
Set up the current user, reading from the session and checking that conditions are satisfied
Definition at line 1315 of file mysource.inc.
start | ( | ) |
From here is where everything else happens, it starts the ball rolling
Definition at line 530 of file mysource.inc.
time | ( | $timestamp = NULL | ) |
Returns time string for the passed timestamp
int | $timestamp | timestamp to format, if null uses current timestamp |
Definition at line 3995 of file mysource.inc.
unsetGlobalDefine | ( | $index | ) |
Unset a global define
string | $index | the index of the variable |
Definition at line 1096 of file mysource.inc.
updateLock | ( | $lockid, | |
$expires = 0 |
|||
) |
Updates the expiry date of the lock
If the current lock is being held indefinitely (ie. expires = NULL), the lock expiry time will not be updated but the function will return TRUE. You must release an indefinite lock before updating its expiry date. returns TRUE on success, error message on failure
string | $lockid | the id of the lock |
int | $expires | when the lock expires (timestamp or NULL) |
Definition at line 3880 of file mysource.inc.
userPublic | ( | $user = NULL | ) |
Is the passed/current user the public user?
object | $user | the user object you want to test for root access |
Definition at line 2676 of file mysource.inc.
userRoot | ( | $user = NULL | ) |
Is the passed/current user the root user?
object | $user | the user object you want to test for root access |
Definition at line 2629 of file mysource.inc.
userSystemAdmin | ( | $user = NULL | ) |
Does the passed/current user have effective system administrator access?
To have system administrator access you must be a user with backend access (in default authentication, this translates to a Backend User or above), and be a member of the system administrators group
object | $user | the user object you want to test for sysadmin access |
Definition at line 2651 of file mysource.inc.