Class that extends Array object to add Gems specific functions.

package Gems
subpackage Project
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.5

 Methods

Creates the object and checks for required values.

__construct(mixed $array) 

Parameters

$array

mixed

Set the default values for all keys.

_getDefaultValues() 

By doing this, we make sure the settings show up in the project information with the defaults even if the settings was not present in the project.ini

This function checks for the required project settings.

checkRequiredValues() : void

Overrule this function or the $requiredParameters to add extra required settings.

see

Checks the super admin password, if it exists

checkSuperAdminPassword(string $password) : boolean

Parameters

$password

string

Returns

booleanTrue if the password is correct.

Decrypt a string encrypted with encrypt()

decrypt(string $input, string $method = 'default') : \decrypted

Parameters

$input

string

String to decrypt

$method

string

The method used for encrypting (null = no encryption)

Returns

\decryptedstring

Reversibly encrypt a string

encrypt(string $input, string $method = 'default') : \decrypted

Parameters

$input

string

String to decrypt

$method

string

The method used for encrypting (null = no encryption)

Returns

\decryptedstring

Calculate the delay between surveys being asked for this request. Zero means forward at once, a negative value means wait forever.

getAskDelay(\Zend_Controller_Request_Abstract $request, boolean $wasAnswered) : integer

Parameters

$request

\Zend_Controller_Request_Abstract

$wasAnswered

boolean

When true use the ask delay

Returns

integer-1 means waiting indefinitely

Returns an array with throttling settings for the ask controller

getAskThrottleSettings() : array

Returns

array

Get the specified cache method from project settings

getCache() : string

Returns

string

Get the specified role for the console user from the project setttings.

getConsoleRole() : string

If the role is not defined (or does not exist) running GemsTracker in console mode requires the users login name, organization and password to be specified on the command line.

Returns

string

The site url during command line actions

getConsoleUrl() : string

Returns

string

Returns an (optional) default organization from the project settings

getDefaultOrganization() : integer

Returns

integerOrganization number or -1 when not set

Returns an (optional) default track id from the project settings

getDefaultTrackId() : integer

Usually used in by single track project

Returns

integerOrganization number or -1 when not set

Returns the public description of this project.

getDescription() : string

Returns

string

Returns the documentation url

getDocumentationUrl() : string

Returns

string

The the email BCC address - if any

getEmailBcc() : string

Returns

string

Should all mail be bounced to the sender?

getEmailBounce() : boolean

Returns

boolean

The default Email Template for Create Account

getEmailCreateAccount() : string

Returns

stringTemplate Code

Check if multiple language mail templates is supported

getEmailMultiLanguage() : boolean

Returns

boolean

The default Email template for Reset password

getEmailResetPassword() : string

Returns

stringTemplate Code

Get the directory to use as the root for automatic import

getFileImportRoot() : string

Returns

string

Returns the forum url

getForumUrl() : string

Returns

string

Returns the from address

getFrom() : string

Returns

stringE-Mail address

Returns the from address

getImageDir() : string

Returns

stringE-Mail address

Returns the initial password specified for users - if any.

getInitialPassword() : String

Returns

String

Get the local jQuery directory (without base url)

getJQueryLocal() : boolean

Instead of e.g. google Content Delivery Network.

Returns

boolean

Get the default locale

getLocaleDefault() : string

Returns

stringlocale

Get the logLevel to use with the \Gems_Log

getLogLevel() : integer

Default settings is for development and testing environment to use \Zend_Log::DEBUG and for all other environments to use the \Zend_Log::ERR level. This can be overruled by specifying a logLevel in the project.ini

Using a level higher than \Zend_Log::ERR will output full error messages, traces and request info to the logfile. Please be aware that this might introduce a security risk as passwords might be written to the logfile in plain text.

Returns

integerThe loglevel to use

Return the default logLevel to use with the \Gems_Log

getLogLevelDefault() : integer

Default settings is for development and testing environment to use \Zend_Log::DEBUG and for all other environments to use the \Zend_Log::ERR level. This can be overruled by specifying a logLevel in the project.ini

Returns

integerThe loglevel to use

Return a long description, in the correct language if available

getLongDescription(string $language) : string

Parameters

$language

string

Iso code languahe

Returns

string

Array of field name => values for sending E-Mail

getMailFields() : array

Returns

array

Returns the manual url

getManualUrl() : string

Returns

string

Get the form address for monitor messages

getMonitorFrom(string $name = null) : string

Parameters

$name

string

Optional section name

Returns

string

Get the period for monitor messages, optionally for a name

getMonitorPeriod(string $name = null) : string

Parameters

$name

string

Optional section name

Returns

string

Get the to addresses for monitor messages, optionally for a name

getMonitorTo(string $name = null) : string

Parameters

$name

string

Optional section name

Returns

string

Returns the public name of this project.

getName() : string

Returns

string

Get the rules active for this specific set of codes.

getPasswordRules(array $codes) : array

Parameters

$codes

array

An array of code names that identify rules that should be used only for those codes.

Returns

array

The response database with a table with one row for each token answer.

getResponseDatabase() : \Zend_Db_Adapter_Abstract

Returns

\Zend_Db_Adapter_Abstract

Timeout for sessions in seconds.

getSessionTimeOut() : integer

Returns

integer

The site email address - if any

getSiteEmail() : string

Returns

string

Returns the super admin ip range, if it exists

getSuperAdminIPRanges() : string

Returns

string

Returns the super admin name, if any

getSuperAdminName() : string

Returns

string

Returns the support url

getSupportUrl() : string

Returns

string

Returns a salted hash optionally using the specified hash algorithm

getValueHash(string $value, $algorithm = null) : string

Parameters

$value

string

The value to hash

$algorithm

Returns

stringThe salted hexadecimal hash, length depending on the algorithm (32 for md5, 128 for sha512.

True at least one support url exists.

hasAnySupportUrl() : boolean

Returns

boolean

True the bugs url exists.

hasBugsUrl() : boolean

Returns

boolean

True if an initial password was specified for users.

hasInitialPassword() : boolean

Returns

boolean

True when a response database with a table with one row for each token answer should exist.

hasResponseDatabase() : boolean

Returns

boolean

Does this project use a local Bootstrap

isBootstrapLocal() : boolean

Instead of e.g. google Content Delivery Network.

Returns

boolean

Is running GemsTracker from the console allowed

isConsoleAllowed() : string

If allowed you can call index.php from the command line. Use -h as a parameter to get more info, e.g: php.exe -f index.php -- -f The -- is needed because otherwise the command is interpreted as php.exe -h.

Returns

string

Is the use of https required for this site?

isHttpsRequired() : boolean

Returns

boolean

Does this project use a local jQuery

isJQueryLocal() : boolean

Instead of e.g. google Content Delivery Network.

Returns

boolean

Is login shared between organizations (which therefore require a unique staff logon id for each user, instead of for each user within an organization).

isLoginShared() : boolean

Returns

boolean

Is this project use a multi locale project

isMultiLocale() : boolean

Returns

boolean

Is a valid until date required for each round in each track

isValidUntilRequired() : boolean

Returns

boolean

Does this project use Csrf checks

useCsrfCheck() : boolean

Returns

boolean

Add recursively the rules active for this specific set of codes.

_getPasswordRules(array $current, array $codes, array $rules) : void

Parameters

$current

array

The current (part)sub) array of $this->passwords to check

$codes

array

An array of code names that identify rules that should be used only for those codes.

$rules

array

The array that stores the activated rules.

Returns the super admin password, if it exists

getSuperAdminPassword() : string

Returns

string

 Properties

 

The db adapter for the responses

$_responsesDb : \Zend_Db_Adapter_Abstract

Default

 

The default session time out for this project in seconds.

$defaultSessionTimeout : integer

Default

1800

Can be overruled in sesssion.idleTimeout

 

The minimum length for the password of a super admin on a production server.

$minimumSuperPasswordLength : integer

Default

10
 

Array of required keys. Give a string value for root keys or name => array() values for required subs keys.

$requiredKeys : array

Default

array('css' => array('gems'), 'locale' => array('default'), 'salt')

Deeper levels are not supported at the moment.

see