PluginFlyvemdmAgent - btry/glpi-plugin GitHub Wiki
- Class name: PluginFlyvemdmAgent
- Namespace:
- Parent class: CommonDBTM
- This class implements: PluginFlyvemdmNotifiable
const ENROLL_DENY = 0
const ENROLL_INVITATION_TOKEN = 1
const ENROLL_ENTITY_TOKEN = 2
const DEFAULT_TOKEN_LIFETIME = "P7D"
public string $rightname = 'flyvemdm:agent'
- Visibility: public
- This property is static.
public boolean $dohistory = true
- Visibility: public
protected boolean $usenotepad = true
- Visibility: protected
protected boolean $usenotepadRights = true
- Visibility: protected
protected mixed $topic = null
- Visibility: protected
mixed PluginFlyvemdmAgent::getEnumMdmType()
get mdm types availables
- Visibility: public
- This method is static.
mixed PluginFlyvemdmAgent::getTypeName($nb)
Localized name of the type
- Visibility: public
- This method is static.
- $nb mixed - <p>integer number of item in the type (default 0)</p>
string PluginFlyvemdmAgent::getMenuPicture()
Return the picture file for the menu
- Visibility: public
- This method is static.
mixed PluginFlyvemdmAgent::getRights($interface)
- Visibility: public
- $interface mixed
mixed PluginFlyvemdmAgent::defineTabs($options)
Define tabs available for this itemtype
- Visibility: public
- $options mixed
mixed PluginFlyvemdmAgent::getTabNameForItem(\CommonGLPI $item, $withtemplate)
- Visibility: public
- $item CommonGLPI
- $withtemplate mixed
mixed PluginFlyvemdmAgent::displayTabContentForItem($item, $tabnum, $withtemplate)
- Visibility: public
- This method is static.
- $item mixed - <p>CommonGLPI object</p>
- $tabnum mixed - <p>(default 1)</p>
- $withtemplate mixed - <p>(default 0)</p>
mixed PluginFlyvemdmAgent::showForm($ID, $options)
Show form for edition
- Visibility: public
- $ID mixed
- $options mixed
void PluginFlyvemdmAgent::showDangerZone(\PluginFlyvemdmAgent $item)
Print the computer's operating system form
- Visibility: public
- This method is static.
- $item PluginFlyvemdmAgent
string PluginFlyvemdmAgent::showForFleet(\PluginFlyvemdmFleet $item)
Display the agents according the fleet
- Visibility: public
- This method is static.
- $item PluginFlyvemdmFleet
mixed PluginFlyvemdmAgent::canViewItem()
- Visibility: public
mixed PluginFlyvemdmAgent::sendWipeQuery()
Send a wipe command to the agent
- Visibility: protected
mixed PluginFlyvemdmAgent::sendLockQuery()
Send a lock command to the agent
- Visibility: protected
mixed PluginFlyvemdmAgent::sendUnlockQuery()
Send a lock command to the agent
- Visibility: protected
mixed PluginFlyvemdmAgent::sendUnenrollQuery()
Send unenrollment command to the agent
- Visibility: protected
mixed PluginFlyvemdmAgent::prepareInputForAdd($input)
- Visibility: public
- $input mixed
mixed PluginFlyvemdmAgent::prepareInputForUpdate($input)
- Visibility: public
- $input mixed
mixed PluginFlyvemdmAgent::post_addItem()
- Visibility: public
mixed PluginFlyvemdmAgent::post_getFromDB()
- Visibility: public
boolean PluginFlyvemdmAgent::pre_deleteItem()
Actions done before the DELETE of the item in the database / Maybe used to add another check for deletion
- Visibility: public
void PluginFlyvemdmAgent::post_updateItem(integer $history)
Actions done after the UPDATE of the item in the database
- Visibility: public
- $history integer - <p>store changes history ? (default 1)</p>
void PluginFlyvemdmAgent::post_restoreItem()
Actions done after the restore of the item
- Visibility: public
mixed PluginFlyvemdmAgent::post_purgeItem()
Actions done after the purge of an item
- Visibility: public
mixed PluginFlyvemdmAgent::getSearchOptions()
- Visibility: public
mixed PluginFlyvemdmAgent::addDefaultJoin()
Limit search for agents of guest user
- Visibility: public
- This method is static.
mixed PluginFlyvemdmAgent::addDefaultWhere()
Limit search for agents if guest user
- Visibility: public
- This method is static.
string PluginFlyvemdmAgent::getSubscribedTopic()
Returns the topic the agent shall listen
- Visibility: public
mixed PluginFlyvemdmAgent::updateSubscription()
Send to an agent an up to date list of MQTT topics it must subscribe
- Visibility: public
mixed PluginFlyvemdmNotifiable::getTopic()
Gets the topic related to the notifiable
- Visibility: public
- This method is defined by PluginFlyvemdmNotifiable
mixed PluginFlyvemdmAgent::getByTopic(string|false $topic)
get an agent from DB by topic
- Visibility: public
- $topic string|false
mixed PluginFlyvemdmAgent::unsubscribe()
unsibscribe from a fleet
- Visibility: public
integer PluginFlyvemdmAgent::checkChallengeCombinations(Array $authFactors)
Checks if the data provided for enrollment satisfy our requirements
- Visibility: protected
- This method is static.
- $authFactors Array
mixed PluginFlyvemdmAgent::enrollByInvitationToken(array $input)
Attempt to enroll using an invitation token
- Visibility: protected
- $input array - <p>Enrollment data</p>
mixed PluginFlyvemdmAgent::cleanupSubtopics()
Erase delete persisted MQTT topics of the agent
- Visibility: public
array<mixed,string> PluginFlyvemdmAgent::getTopicsToCleanup()
list of topics to cleanup on unenrollment or on enrollment
- Visibility: public
- This method is static.
boolean PluginFlyvemdmAgent::sendGeolocationQuery($errorMessage)
Send an geolocation request to the agent
- Visibility: protected
- $errorMessage mixed
boolean PluginFlyvemdmAgent::pollGeolocationAnswer(array $lastPosition, string $errorMessage)
Polls in the DB for a new geolocation entry with ID higher than the given one Timeouts if no new entry after a few seconds
- Visibility: protected
- $lastPosition array
- $errorMessage string - <p>the error message to return to the caller</p>
boolean PluginFlyvemdmAgent::sendInventoryQuery()
Send an inventory request to the device
- Visibility: protected
boolean PluginFlyvemdmAgent::pollInventoryAnswer()
Polls in the DB for the inventory of the agent
- Visibility: protected
boolean PluginFlyvemdmAgent::sendPingQuery()
Sends a message on the subtopic dedicated to ping requests
- Visibility: protected
boolean PluginFlyvemdmAgent::pollPingAnswer()
Polls the ping answer
- Visibility: protected
mixed PluginFlyvemdmAgent::signCertificate(String $csr)
Attempts to sign the certificate against the CA
- Visibility: protected
- This method is static.
- $csr String - <p>Certificate signing request</p>
array PluginFlyvemdmNotifiable::getAgents()
get the agents related to the notifiable
- Visibility: public
- This method is defined by PluginFlyvemdmNotifiable
array PluginFlyvemdmNotifiable::getPackages()
get the applications related to the notifiable
- Visibility: public
- This method is defined by PluginFlyvemdmNotifiable
array PluginFlyvemdmNotifiable::getFiles()
get the files related to the notifiable
- Visibility: public
- This method is defined by PluginFlyvemdmNotifiable
\PluginFlyvemdmFleet PluginFlyvemdmNotifiable::getFleet()
get the fleet attached to the notifiable
- Visibility: public
- This method is defined by PluginFlyvemdmNotifiable
mixed PluginFlyvemdmAgent::getOwner()
Get the user owner of the agent's device
- Visibility: public
mixed PluginFlyvemdmAgent::chooseEnrollMethod(array $input)
Determine the enrollment method depending on input data
- Visibility: protected
- $input array
mixed PluginFlyvemdmAgent::setupMqttAccess()
Creates virtual fields with enrollment data
- Visibility: protected
mixed PluginFlyvemdmAgent::filterMessages(string $error)
If debug node is disabled, disable detailed error messages
- Visibility: protected
- $error string
mixed PluginFlyvemdmAgent::logInvitationEvent(\PluginFlyvemdmInvitation $invitation, string $event)
Logs invitation events
- Visibility: protected
- $invitation PluginFlyvemdmInvitation
- $event string
mixed PluginFlyvemdmAgent::changeMqttAcl(\PluginFlyvemdmFleet $old, \PluginFlyvemdmFleet $new)
Update settings related to fleet change
- Visibility: protected
- $old PluginFlyvemdmFleet - <p>old fleet</p>
- $new PluginFlyvemdmFleet - <p>new fleet</p>
NULL|\Computer PluginFlyvemdmAgent::getComputer()
Get the computer associatated to the agent
- Visibility: public
mixed PluginFlyvemdmNotifiable::notify(string $topic, string $mqttMessage, \number $qos, \number $retain)
Send a MQTT message
- Visibility: public
- This method is defined by PluginFlyvemdmNotifiable
- $topic string
- $mqttMessage string
- $qos number
- $retain number
mixed PluginFlyvemdmAgent::hook_entity_purge(\CommonDBTM $item)
purge agents in the entity being purged
- Visibility: public
- $item CommonDBTM
mixed PluginFlyvemdmAgent::hook_computer_purge(\CommonDBTM $item)
Deletes agents related to the computers id
- Visibility: public
- $item CommonDBTM