L_OK = 0
This class represents an consortium federation.
It is semantically a country(!). Do not confuse this with a TLD; a federation may span more than one TLD, and a TLD may be distributed across multiple federations.
Example: a federation "fr" => "France" may also contain other TLDs which belong to France in spite of their different TLD Example 2: Domains ending in .edu are present in multiple different federations
$attributes : mixed|string|int
This variable gets initialised with the known IdP attributes in the constructor. It never gets updated until the object is destroyed. So if attributes change in the database, and IdP attributes are to be queried afterwards, the object needs to be re-instantiated to have current values in this variable.
getAttributes( optionName = NULL) : mixed|string|int
This function retrieves the entity's attributes.
If called with the optional parameter, only attribute values for the attribute name in $optionName are retrieved; otherwise, all attributes are retrieved. The retrieval is in-memory from the internal attributes class member - no DB callback, so changes in the database during the class instance lifetime are not considered.
optionally, the name of the attribute that is to be retrieved
of arrays of attributes which were set for this IdP
getAttributeValue(mixed|string|int attributeArray, string|int index1, string|int index2) : \core\any
This is a helper fuction to retreave a value from two-dimmentional 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
value or NULL
addAttribute( attrName, attrLang, attrValue)
Adds an attribute for the entity instance into the database. Multiple instances of the same attribute are supported.
Name of the attribute. This must be a well-known value from the profile_option_dict table in the DB.
language of the attribute. Can be NULL.
Value of the attribute. Can be anything; will be stored in the DB as-is.
fetchRawDataByIndex( table, row) : string|bool
Retrieves data from the underlying tables, for situations where instantiating the IdP or Profile object is inappropriate
institution_option or profile_option
the data, or FALSE if something went wrong
isDataRestricted( table, row) :
Checks if a raw data pointer is public data (return value FALSE) or if yes who the authorised admins to view it are (return array of user IDs)
which database table is this about
row index of the table
FALSE if the data is public, an array of owners of the data if it is NOT public
createTemporaryDirectory( purpose = installer, failIsFatal = 1) : mixed|string|int
create a temporary directory and return the location
one of 'installer', 'logo', 'test' defined the purpose of the directory
decides if a creation failure should cause an error; defaults to true
the tuple of: base path, absolute path for directory, directory name
newIdP( ownerId, level, mail) :
Creates a new IdP inside the federation.
Persistent identifier of the user for whom this IdP is created (first administrator)
Privilege level of the first administrator (was he blessed by a federation admin or a peer?)
e-mail address with which the user was invited to administer (useful for later user identification if the user chooses a "funny" real name)
identifier of the new IdP
listExternalEntities( unmappedOnly) : mixed|string|int
cross-checks in the EXTERNAL customer DB which institutions exist there for the federations
if set to TRUE, only returns those which do not have a known mapping to our internally known institutions
determineIdPIdByRealm( realm) : mixed|string|int
If we are running diagnostics, our input from the user is the realm. We need to find out which IdP this realm belongs to.
the realm to search for
an array with two entries, CAT ID and DB ID, with either the respective ID of the IdP in the system, or UNKNOWN_IDP or AMBIGUOUS_IDP
retrieveOptionsFromDatabase( query, level) : mixed|string|int
retrieve attributes from a database. Only does SELECT queries.
sub-classes set the query to execute to get to the options
the retrieved options get flagged with this "level" identifier
the attributes in one array
findCandidates(\mysqli_result dbResult, country) :
for a MySQL list of institutions, find an institution or find out that there is no single best match
used to return the country of the inst, if can be found out
the identifier of the inst, or one of the special return values if unsuccessful