Profile __construct(
int
$p_id, [IdP
$idp_object = 0]
)
|
|
Class constructor for existing profiles (use IdP::newProfile() to actually create one). Retrieves all attributes and supported EAP types from the DB and stores them in the priv_ arrays.
Parameters:
int |
$p_id: |
identifier of the profile in the DB |
IdP |
$idp_object: |
optionally, the institution to which this Profile belongs. Saves the construction of the IdP instance. If omitted, an extra query and instantiation is executed to find out. |
API Tags:
void addAttribute(
string
$attr_name, string
$attr_value, int
$eap_type, [string
$device = 0]
)
|
|
adds an attribute to this profile
Parameters:
string |
$attr_name: |
name of the attribute to set |
string |
$attr_value: |
value of the attribute to set |
int |
$eap_type: |
identifier of the EAP type in the database. 0 if the attribute is valid for all EAP types. |
string |
$device: |
identifier of the device in the databse. Omit the argument if attribute is valid for all devices. |
API Tags:
void addSupportedEapMethod(
array
$type, int
$preference
)
|
|
register new supported EAP method for this profile
Parameters:
array |
$type: |
The EAP Type, as defined in class EAP |
int |
$preference: |
preference of this EAP Type. If a preference value is re-used, the order of EAP types of the same preference level is undefined. |
API Tags:
array beginFlushAttributes(
[int
$eap_type_id = 0], [string
$device = 0]
)
|
|
deletes all attributes in this profile except the _file ones, these are reported as array.
either eap_type or device can be non-zero; then, only method-level attributes or device-level attributes will be deleted
Parameters:
int |
$eap_type_id: |
eap_type_id the DB identifier of this EAP type; if omitted stands for "all EAP types" |
string |
$device: |
device the device ID for which to flush attribs; if omitted stands for "all devices" |
API Tags:
Return: | list of row id's of file-based attributes which weren't deleted |
Access: | public |
void commitFlushAttributes(
array
$tobedeleted
)
|
|
after a beginFlushAttributes, deletes all attributes which are in the tobedeleted array
Parameters:
array |
$tobedeleted: |
array of database rows which are to be deleted |
API Tags:
Deletes the profile from database and uninstantiates itself.
API Tags:
void flushSupportedEapMethods(
)
|
|
Removes all supported EAP methods
API Tags:
array getAttributes(
[string
$option_name = 0], [eapmethod
$eapmethod = 0], [string
$device = 0]
)
|
|
Returns an array of the profile's attributes.
Parameters:
string |
$option_name: |
option_name the name of a specific option. If set, only returns option values for this option name |
eapmethod |
$eapmethod: |
the EAP type, in array ("OUTER/INNER") notation. If set, returns only attributes which are specific to that EAP type |
string |
$device: |
device the device ID string. If set, returns only attributes which are specific to that device |
API Tags:
Return: | attributes of the profile |
Access: | public |
array getCollapsedAttributes(
[array
$eap = 0]
)
|
|
prepare profile attributes for device modules Gets profile attributes taking into account the most specific level on which they may be defined as wel as the chosen language.
can be called with an optional $eap argument
Parameters:
array |
$eap: |
if specified, retrieves attributes specific to the given EAP type |
API Tags:
Return: | list of attributes in collapsed style (index is the attrib name, value is an array of different values) |
Access: | public |
array getEapMethodsinOrderOfPreference(
[int
$complete_only = 0]
)
|
|
Produces an array of EAP methods supported by this profile, ordered by preference
Parameters:
int |
$complete_only: |
if set and non-zero limits the output to methods with complete information |
API Tags:
Return: | list of EAP methods, (in "array" OUTER/INNER representation) |
Access: | public |
gets the last-modified timestamp (useful for caching "dirty" check)
API Tags:
Checks if the profile is shown (showable) to end users
API Tags:
Return: | TRUE if profile is shown; FALSE if not |
Access: | public |
void getSufficientConfig(
)
|
|
API Tags:
mixed getUserDownloadStats(
[string
$device = 0]
)
|
|
Retrieve current download stats from database, either for one specific device or for all devices
Parameters:
string |
$device: |
the device id string |
API Tags:
Return: | user downloads of this profile; if device is given, returns the counter as int, otherwise an array with devicename => counter |
Access: | public |
TRUE incrementDownloadStats(
device
$device, area
$area
)
|
|
Log a new download for our stats
Parameters:
device |
$device: |
the device id string |
area |
$area: |
either admin or user |
API Tags:
Return: | if incrementing worked, FALSE if not |
Access: | public |
mixed isEapTypeDefinitionComplete(
array
$eaptype
)
|
|
Performs a sanity check for a given EAP type - did the admin submit enough information to create installers for him?
Parameters:
array |
$eaptype: |
the EAP type in "array" OUTER/INNER representation |
API Tags:
Return: | TRUE if the EAP type is complete; an array of missing attribues if it's incomplete; FALSE if it's incomplete for other reasons |
Access: | public |
array listDevices(
[string
$locale = 0]
)
|
|
list all devices marking their availabiblity and possible redirects
Parameters:
string |
$locale: |
for text-based attributes, either returns values for the default value, or if specified here, in the locale specified |
API Tags:
Return: | of device ids display names and their status |
Access: | public |
set the showtime and QR-user attributes if prepShowTime says that there is enough info *and* the admin flagged the profile for showing
API Tags:
boolean readyForShowtime(
)
|
|
Checks if the profile has enough information to have something to show to end users. This does not necessarily mean that there's a fully configured EAP type - it is sufficient if a redirect has been set for at least one device.
API Tags:
Return: | TRUE if enough information for showtime is set; FALSE if not |
Access: | public |
void setAnonymousIDSupport(
boolean
$shallwe, string
$realm
)
|
|
Toggle anonymous outer ID support.
Parameters:
boolean |
$shallwe: |
TRUE to enable outer identities (needs valid $realm), FALSE to disable |
string |
$realm: |
the realm (potentially with the local@ part that should be used for anonymous identities) |
API Tags:
void setRealm(
string
$realm
)
|
|
Specifies the realm of this profile.
Parameters:
string |
$realm: |
the realm (potentially with the local@ part that should be used for anonymous identities) |
API Tags:
mixed testCache(
string
$device
)
|
|
This function tests if the configurator needs to be regenerated (properties of the Profile may have changed since the last configurator generation).
Parameters:
string |
$device: |
device ID to check |
API Tags:
Return: | a string with the path to the configurator download, or NULL if it needs to be regenerated |
Access: | public |
void updateCache(
string
$device, string
$path,
$mime
)
|
|
Updates database with new installler location
Parameters:
string |
$device: |
device the device identifier string |
string |
$path: |
path the path where the new installer can be found |
|
$mime: |
|
API Tags:
update the last_changed timestamp for this profile
API Tags: