Constants

ERROR_API_DISABLED

ERROR_API_DISABLED = 1

ERROR_NO_APIKEY

ERROR_NO_APIKEY = 2

ERROR_INVALID_APIKEY

ERROR_INVALID_APIKEY = 3

ERROR_MISSING_PARAMETER

ERROR_MISSING_PARAMETER = 4

ERROR_INVALID_PARAMETER

ERROR_INVALID_PARAMETER = 5

ERROR_NO_ACTION

ERROR_NO_ACTION = 6

ERROR_INVALID_ACTION

ERROR_INVALID_ACTION = 7

ERROR_MALFORMED_REQUEST

ERROR_MALFORMED_REQUEST = 8

ERROR_INTERNAL_ERROR

ERROR_INTERNAL_ERROR = 9

ERROR_NO_TOU

ERROR_NO_TOU = 10

ACTION_NEWINST_BY_REF

ACTION_NEWINST_BY_REF = NEWINST-BY-REF

ACTION_NEWINST

ACTION_NEWINST = NEWINST

ACTION_DELINST

ACTION_DELINST = DELINST

ACTION_ADMIN_LIST

ACTION_ADMIN_LIST = ADMIN-LIST

ACTION_ADMIN_ADD

ACTION_ADMIN_ADD = ADMIN-ADD

ACTION_ADMIN_DEL

ACTION_ADMIN_DEL = ADMIN-DEL

ACTION_STATISTICS_INST

ACTION_STATISTICS_INST = STATISTICS-INST

ACTION_STATISTICS_FED

ACTION_STATISTICS_FED = STATISTICS-FED

ACTION_NEWPROF_RADIUS

ACTION_NEWPROF_RADIUS = NEWPROF-RADIUS

ACTION_NEWPROF_SB

ACTION_NEWPROF_SB = NEWPROF-MANAGED

ACTION_ENDUSER_NEW

ACTION_ENDUSER_NEW = ENDUSER-NEW

ACTION_ENDUSER_DEACTIVATE

ACTION_ENDUSER_DEACTIVATE = ENDUSER-DEACTIVATE

ACTION_ENDUSER_LIST

ACTION_ENDUSER_LIST = ENDUSER-LIST

ACTION_TOKEN_NEW

ACTION_TOKEN_NEW = TOKEN-NEW

ACTION_TOKEN_REVOKE

ACTION_TOKEN_REVOKE = TOKEN-REVOKE

ACTION_TOKEN_LIST

ACTION_TOKEN_LIST = TOKEN-LIST

ACTION_CERT_LIST

ACTION_CERT_LIST = CERT-LIST

ACTION_CERT_REVOKE

ACTION_CERT_REVOKE = CERT-REVOKE

AUXATTRIB_ADMINID

AUXATTRIB_ADMINID = ATTRIB-ADMINID

AUXATTRIB_TARGETMAIL

AUXATTRIB_TARGETMAIL = ATTRIB-TARGETMAIL

AUXATTRIB_TARGETSMS

AUXATTRIB_TARGETSMS = ATTRIB-TARGETSMS

AUXATTRIB_EXTERNALID

AUXATTRIB_EXTERNALID = ATTRIB-EXTERNALID

AUXATTRIB_CAT_INST_ID

AUXATTRIB_CAT_INST_ID = ATTRIB-CAT-INSTID

AUXATTRIB_CAT_PROFILE_ID

AUXATTRIB_CAT_PROFILE_ID = ATTRIB-CAT-PROFILEID

AUXATTRIB_PROFILE_REALM

AUXATTRIB_PROFILE_REALM = ATTRIB-PROFILE-REALM

AUXATTRIB_PROFILE_OUTERVALUE

AUXATTRIB_PROFILE_OUTERVALUE = ATTRIB-PROFILE-OUTERVALUE

AUXATTRIB_PROFILE_TESTUSER

AUXATTRIB_PROFILE_TESTUSER = ATTRIB-PROFILE-TESTUSER

AUXATTRIB_PROFILE_INPUT_HINT

AUXATTRIB_PROFILE_INPUT_HINT = ATTRIB-PROFILE-HINTREALM

AUXATTRIB_PROFILE_INPUT_VERIFY

AUXATTRIB_PROFILE_INPUT_VERIFY = ATTRIB-PROFILE-VERIFYREALM

AUXATTRIB_PROFILE_EAPTYPE

AUXATTRIB_PROFILE_EAPTYPE = ATTRIB-PROFILE-EAPTYPE

AUXATTRIB_SB_TOU

AUXATTRIB_SB_TOU = ATTRIB-MANAGED-TOU

AUXATTRIB_SB_USERNAME

AUXATTRIB_SB_USERNAME = ATTRIB-MANAGED-USERNAME

AUXATTRIB_SB_USERID

AUXATTRIB_SB_USERID = ATTRIB-MANAGED-USERID

AUXATTRIB_SB_EXPIRY

AUXATTRIB_SB_EXPIRY = ATTRIB-MANAGED-EXPIRY

AUXATTRIB_TOKEN

AUXATTRIB_TOKEN = ATTRIB-TOKEN

AUXATTRIB_TOKENURL

AUXATTRIB_TOKENURL = ATTRIB-TOKENURL

AUXATTRIB_TOKEN_ACTIVATIONS

AUXATTRIB_TOKEN_ACTIVATIONS = ATTRIB-TOKEN-ACTIVATIONS

ACTIONS

ACTIONS = [
    # inst-level actions
    \web\lib\admin\API::ACTION_NEWINST_BY_REF => [REQ => [\web\lib\admin\API::AUXATTRIB_EXTERNALID], OPT => [general:geo_coordinates, general:logo_file, media:SSID, media:SSID_with_legacy, media:wired, media:remove_SSID, media:consortium_OI, media:force_proxy, support:email, support:info_file, support:phone, support:url]],
    \web\lib\admin\API::ACTION_NEWINST => [REQ => [], OPT => [general:instname, general:geo_coordinates, general:logo_file, media:SSID, media:SSID_with_legacy, media:wired, media:remove_SSID, media:consortium_OI, media:force_proxy, support:email, support:info_file, support:phone, support:url]],
    \web\lib\admin\API::ACTION_DELINST => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => []],
    # inst administrator management
    \web\lib\admin\API::ACTION_ADMIN_LIST => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => []],
    \web\lib\admin\API::ACTION_ADMIN_ADD => [REQ => [\web\lib\admin\API::AUXATTRIB_ADMINID, \web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => [\web\lib\admin\API::AUXATTRIB_TARGETMAIL]],
    \web\lib\admin\API::ACTION_ADMIN_DEL => [REQ => [\web\lib\admin\API::AUXATTRIB_ADMINID, \web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => []],
    # statistics
    \web\lib\admin\API::ACTION_STATISTICS_INST => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => []],
    \web\lib\admin\API::ACTION_STATISTICS_FED => [REQ => [], OPT => []],
    # RADIUS profile actions
    \web\lib\admin\API::ACTION_NEWPROF_RADIUS => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => [eap:ca_file, eap:server_name, media:SSID, media:SSID_with_legacy, media:wired, media:remove_SSID, media:consortium_OI, media:force_proxy, profile:name, profile:customsuffix, profile:description, profile:production, support:email, support:info_file, support:phone, support:url, \web\lib\admin\API::AUXATTRIB_PROFILE_INPUT_HINT, \web\lib\admin\API::AUXATTRIB_PROFILE_INPUT_VERIFY, \web\lib\admin\API::AUXATTRIB_PROFILE_OUTERVALUE, \web\lib\admin\API::AUXATTRIB_PROFILE_REALM, \web\lib\admin\API::AUXATTRIB_PROFILE_TESTUSER, \web\lib\admin\API::AUXATTRIB_PROFILE_EAPTYPE]],
    # Silverbullet profile actions
    \web\lib\admin\API::ACTION_NEWPROF_SB => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_INST_ID], OPT => [\web\lib\admin\API::AUXATTRIB_SB_TOU]],
    \web\lib\admin\API::ACTION_ENDUSER_NEW => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_PROFILE_ID, \web\lib\admin\API::AUXATTRIB_SB_USERNAME, \web\lib\admin\API::AUXATTRIB_SB_EXPIRY], OPT => []],
    \web\lib\admin\API::ACTION_ENDUSER_DEACTIVATE => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_PROFILE_ID, \web\lib\admin\API::AUXATTRIB_SB_USERID], OPT => []],
    \web\lib\admin\API::ACTION_ENDUSER_LIST => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_PROFILE_ID], OPT => []],
    \web\lib\admin\API::ACTION_TOKEN_NEW => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_PROFILE_ID, \web\lib\admin\API::AUXATTRIB_SB_USERID], OPT => [\web\lib\admin\API::AUXATTRIB_TOKEN_ACTIVATIONS, \web\lib\admin\API::AUXATTRIB_TARGETMAIL, \web\lib\admin\API::AUXATTRIB_TARGETSMS]],
    \web\lib\admin\API::ACTION_TOKEN_REVOKE => [REQ => [\web\lib\admin\API::AUXATTRIB_TOKEN], OPT => []],
    \web\lib\admin\API::ACTION_TOKEN_LIST => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_PROFILE_ID], OPT => [\web\lib\admin\API::AUXATTRIB_SB_USERID]],
    \web\lib\admin\API::ACTION_CERT_LIST => [REQ => [\web\lib\admin\API::AUXATTRIB_CAT_PROFILE_ID, \web\lib\admin\API::AUXATTRIB_SB_USERID], OPT => []],
    \web\lib\admin\API::ACTION_CERT_REVOKE => [REQ => [], OPT => []],
]

Methods

__construct()

__construct() : 

Returns

scrub()

scrub(mixed|string|int  inputJson, \core\Federation  fedObject) : mixed|string|int

Only leave attributes in the request which are related to the ACTION.

Also sanitise by enforcing LANG attribute in multi-lang attributes.

Parameters

mixed|string|int inputJson

the incoming JSON request

\core\Federation fedObject

the federation the user is acting within

Returns

mixed|string|int —

the scrubbed attributes

firstParameterInstance()

firstParameterInstance(mixed|string|int  inputs,   expected) : 

extracts the first occurence of a given parameter name from the set of inputs

Parameters

mixed|string|int inputs

incoming set of arrays

expected

attribute that is to be extracted

Returns

the value, or FALSE if none was found

uglify()

uglify(mixed|string|int  parameters) : 

we are coercing the submitted JSON-style parameters into the same format we use for the HTML POST user-interactively.

That's ugly, hence the function name.

Parameters

mixed|string|int parameters

Returns

returnError()

returnError( code,  description) : 

Parameters

code
description

Returns

returnSuccess()

returnSuccess( details) : 

Parameters

details

Returns