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 = alpha2

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 ], [SETTING => CONFIG[APPEARANCE][support-contact][url], DEFVALUE => cat-support@our-cat-installation.example?body=Only%20English%20language%20please!, COMPLAINTSTRING => APPEARANCE/support-contact/url ], [SETTING => CONFIG[APPEARANCE][support-contact][display], DEFVALUE => cat-support@our-cat-installation.example, COMPLAINTSTRING => APPEARANCE/support-contact/display ], [SETTING => CONFIG[APPEARANCE][support-contact][developer-mail], DEFVALUE => cat-develop@our-cat-installation.example, COMPLAINTSTRING => APPEARANCE/support-contact/mail ], [SETTING => CONFIG[APPEARANCE][abuse-mail], DEFVALUE => my-abuse-contact@your-cat-installation.example, COMPLAINTSTRING => APPEARANCE/abuse-mail ], [SETTING => CONFIG[APPEARANCE][MOTD], DEFVALUE => Release Candidate. All bugs to be shot on sight!, COMPLAINTSTRING => APPEARANCE/MOTD ], [SETTING => CONFIG[APPEARANCE][webcert_CRLDP], DEFVALUE => [list, of, CRL, pointers], COMPLAINTSTRING => APPEARANCE/webcert_CRLDP ], [SETTING => CONFIG[DB][INST][host], DEFVALUE => db.host.example, COMPLAINTSTRING => DB/INST ], [SETTING => CONFIG[DB][INST][host], DEFVALUE => db.host.example, COMPLAINTSTRING => DB/USER ]]

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 —

$loggerInstance

$loggerInstance : \core\common\Logging

We occasionally log stuff (debug/audit). Have an initialised Logging instance nearby is sure helpful.

Type

\core\common\Logging —

$languageInstance

$languageInstance : \core\common\Language

access to language settings to be able to switch textDomain

Type

\core\common\Language —

$php_needversion

$php_needversion : 

Type

$ssp_needversion

$ssp_needversion : 

Type

$NSIS_Modules

$NSIS_Modules : 

Type

$profile_option_ct

$profile_option_ct : 

Type

$view_admin_ct

$view_admin_ct : 

Type

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.

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() 

__destruct()

__destruct() 

destroys the entity.

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

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

test()

test(  test) 

The single test wrapper

Parameters

test

the test name

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.

get_test_names()

get_test_names() : mixed|string|int

enumerates the tests which are defined

Returns

mixed|string|int —

test_return()

test_return(  level,   message) 

stores the result of a given test in standardised format

Parameters

level

severity level of the result

message

verbal description of the result

get_exec_path()

get_exec_path(  pathToCheck) : mixed|string|int

finds out if a path name is configured as an absolute path or only implicit (e.g. is in $PATH)

Parameters

pathToCheck

Returns

mixed|string|int —

php_test()

php_test() 

Test for php version

cat_base_url_test()

cat_base_url_test() 

set for cat_base_url setting

ssp_test()

ssp_test() 

test for simpleSAMLphp

security_test()

security_test() 

test for security setting

zip_test()

zip_test() 

test if zip is available

eapol_test_test()

eapol_test_test() 

test if eapol_test is availabe and reacent enough

logdir_test()

logdir_test() 

test if logdir exists and is writable

phpModules_test()

phpModules_test() 

test for required PHP modules

geoip_test()

geoip_test() 

test if GeoIP is installed correctly

openssl_test()

openssl_test() 

test if openssl is available

makensis_test()

makensis_test() 

test if makensis is available

NSISmodules_test()

NSISmodules_test() 

test if all required NSIS modules are available

directories_test()

directories_test() 

test access to dowloads directories

locales_test()

locales_test() 

test if all required locales are enabled

defaults_test()

defaults_test() 

test if defaults in the config have been replaced with some real values

databases_test()

databases_test() 

test access to databases

device_cache_test()

device_cache_test() 

test devices.php for the no_cache option

mailer_test()

mailer_test() 

test if mailer works

UDPhosts_test()

UDPhosts_test() 

TODO test if RADIUS connections work