Constants

VERSION_MAJOR

VERSION_MAJOR = 2

which version is this? even if we are unreleased, keep track of internal version-to-be developers need to set this in code. The user-displayed string is generated into $CAT_VERSION_STRING and $CAT_COPYRIGHT below

VERSION_MINOR

VERSION_MINOR = 0

VERSION_PATCH

VERSION_PATCH = 0

VERSION_EXTRA

VERSION_EXTRA = beta1

RELEASE_VERSION

RELEASE_VERSION = FALSE

USER_API_VERSION

USER_API_VERSION = 2

DB_TYPE

DB_TYPE = INST

the default database to query in this class.

L_OK

L_OK = 0

L_REMARK

L_REMARK = 4

L_WARN

L_WARN = 32

L_ERROR

L_ERROR = 256

DEFAULTS

DEFAULTS = [[SETTING => CONFIG[APPEARANCE][from-mail], DEFVALUE => cat-invite@your-cat-installation.example, COMPLAINTSTRING => APPEARANCE/from-mail , REQUIRED => FALSE], [SETTING => CONFIG[APPEARANCE][support-contact][url], DEFVALUE => cat-support@our-cat-installation.example?body=Only%20English%20language%20please!, COMPLAINTSTRING => APPEARANCE/support-contact/url , REQUIRED => FALSE], [SETTING => CONFIG[APPEARANCE][support-contact][display], DEFVALUE => cat-support@our-cat-installation.example, COMPLAINTSTRING => APPEARANCE/support-contact/display , REQUIRED => FALSE], [SETTING => CONFIG[APPEARANCE][support-contact][developer-mail], DEFVALUE => cat-develop@our-cat-installation.example, COMPLAINTSTRING => APPEARANCE/support-contact/mail , REQUIRED => FALSE], [SETTING => CONFIG[APPEARANCE][abuse-mail], DEFVALUE => my-abuse-contact@your-cat-installation.example, COMPLAINTSTRING => APPEARANCE/abuse-mail , REQUIRED => FALSE], [SETTING => CONFIG[APPEARANCE][MOTD], DEFVALUE => Release Candidate. All bugs to be shot on sight!, COMPLAINTSTRING => APPEARANCE/MOTD , REQUIRED => FALSE], [SETTING => CONFIG[APPEARANCE][webcert_CRLDP], DEFVALUE => [list, of, CRL, pointers], COMPLAINTSTRING => APPEARANCE/webcert_CRLDP , REQUIRED => TRUE], [SETTING => CONFIG[APPEARANCE][webcert_OCSP], DEFVALUE => [list, of, OCSP, pointers], COMPLAINTSTRING => APPEARANCE/webcert_OCSP , REQUIRED => TRUE], [SETTING => CONFIG[DB][INST][host], DEFVALUE => db.host.example, COMPLAINTSTRING => DB/INST , REQUIRED => TRUE], [SETTING => CONFIG[DB][INST][host], DEFVALUE => db.host.example, COMPLAINTSTRING => DB/USER , REQUIRED => TRUE], [SETTING => CONFIG[DB][EXTERNAL][host], DEFVALUE => customerdb.otherhost.example, COMPLAINTSTRING => DB/EXTERNAL , REQUIRED => FALSE]]

Properties

$CAT_VERSION_STRING

$CAT_VERSION_STRING : 

Type

$CAT_COPYRIGHT

$CAT_COPYRIGHT : 

Type

$nomenclature_fed

$nomenclature_fed : 

the custom displayable variant of the term 'federation'

Type

$nomenclature_inst

$nomenclature_inst : 

the custom displayable variant of the term 'institution'

Type

$knownFederations

$knownFederations : mixed|string|int

all known federation, in an array with ISO short name as an index, and localised version of the pretty-print name as value.

The static value is only filled with meaningful content after the first object has been instantiated. That is because it is not possible to define static properties with function calls like _().

Type

mixed|string|int — of all known federations

$out

$out : 

Type

$name

$name : 

Type

$test_result

$test_result : mixed|string|int

This array is used to return the test results.

As the 'global' entry it returns the maximum return value from all tests. Individual tests results are teturned as separate entires indexed by test names; each value is an array passing "level" and "message" from each of the tests. $test_result is set by the test_return method

Type

mixed|string|int —

Methods

__construct()

__construct() : 

initialise the tests. Includes counting the number of expected rows in the profile_option_dict table.

Logs the start of lifetime of the entity to the debug log on levels 3 and higher.

Returns

totalIdPs()

totalIdPs(  level) : 

Calculates the number of IdPs overall in the system

Parameters

level

completeness level of IdPs that are to be taken into consideration for counting

Returns

listAllIdentityProviders()

listAllIdentityProviders(  activeOnly,   country) : mixed|string|int

Lists all identity providers in the database adding information required by DiscoJuice.

Parameters

activeOnly

if set to non-zero will cause listing of only those institutions which have some valid profiles defined.

country

if set, only list IdPs in a specific country

Returns

mixed|string|int —

the list of identity providers

printCountryList()

printCountryList(  activeOnly) : mixed|string|int

Prepares a list of countries known to the CAT.

Parameters

activeOnly

is set and nonzero will cause that only countries with some institutions underneath will be listed

Returns

mixed|string|int —

Array indexed by (uppercase) lang codes and sorted according to the current locale

getExternalDBEntityDetails()

getExternalDBEntityDetails(  externalId,   realm = NULL) : mixed|string|int

get additional details about an institution from the EXTERNAL customer DB (if any; for eduroam, this would be the official eduroam database)

Parameters

externalId

the ID of the institution in the external DB

realm

the function can also try to find an inst by its realm in the external DB

Returns

mixed|string|int —

a list of institutions, ideally with only one member

getExternalCountriesList()

getExternalCountriesList() : mixed|string|int

the list of countries as per external DB

Returns

mixed|string|int —

the list

getRootUrlPath()

getRootUrlPath() : 

Returns

__destruct()

__destruct() : 

destroys the entity.

Logs the end of lifetime of the entity to the debug log on level 5.

Returns

getAttributeValue()

getAttributeValue(mixed|string|int  attributeArray, string|int  index1, string|int  index2) : 

This is a helper fuction to retrieve a value from two-dimensional arrays The function tests if the value for the first indes is defined and then the same with the second and finally returns the value if something on the way is not defined, NULL is returned

Parameters

mixed|string|int attributeArray
string|int index1
string|int index2

Returns

createTemporaryDirectory()

createTemporaryDirectory(  purpose = installer,   failIsFatal = 1) : mixed|string|int

create a temporary directory and return the location

Parameters

purpose

one of 'installer', 'logo', 'test' defined the purpose of the directory

failIsFatal

decides if a creation failure should cause an error; defaults to true

Returns

mixed|string|int —

the tuple of: base path, absolute path for directory, directory name

rrmdir()

rrmdir(  dir) : 

this direcory delete function has been copied from PHP documentation

Parameters

dir

name of the directory to delete

Returns

uuid()

uuid(  prefix,  deterministicSource = NULL) : 

generates a UUID, for the devices which identify file contents by UUID

Parameters

prefix

an extra prefix to set before the UUID

deterministicSource

Returns

UUID (possibly prefixed)

randomString()

randomString(  length,   keyspace = 23456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) : 

produces a random string

Parameters

length

the length of the string to produce

keyspace

the pool of characters to use for producing the string

Throws

\Exception

Returns

test()

test(  test) : 

The single test wrapper

Parameters

test

the test name

Returns

run_tests()

run_tests(mixed|string|int  Tests) : 

The multiple tests wrapper

Parameters

mixed|string|int Tests

the tests array.

The $Tests is a simple string array, where each entry is a test name the test names can also be given in the format "test=>subtest", which defines a conditional execution of the "subtest" if the "test" was run earier and returned a success.

Returns

get_test_names()

get_test_names() : mixed|string|int

enumerates the tests which are defined

Returns

mixed|string|int —