PluginFlyvemdmAgent - btry/glpi-plugin GitHub Wiki

PluginFlyvemdmAgent

Constants

ENROLL_DENY

const ENROLL_DENY = 0

ENROLL_INVITATION_TOKEN

const ENROLL_INVITATION_TOKEN = 1

ENROLL_ENTITY_TOKEN

const ENROLL_ENTITY_TOKEN = 2

DEFAULT_TOKEN_LIFETIME

const DEFAULT_TOKEN_LIFETIME = "P7D"

Properties

$rightname

public string $rightname = 'flyvemdm:agent'
  • Visibility: public
  • This property is static.

$dohistory

public boolean $dohistory = true
  • Visibility: public

$usenotepad

protected boolean $usenotepad = true
  • Visibility: protected

$usenotepadRights

protected boolean $usenotepadRights = true
  • Visibility: protected

$topic

protected mixed $topic = null
  • Visibility: protected

Methods

getEnumMdmType

mixed PluginFlyvemdmAgent::getEnumMdmType()

get mdm types availables

  • Visibility: public
  • This method is static.

getTypeName

mixed PluginFlyvemdmAgent::getTypeName($nb)

Localized name of the type

  • Visibility: public
  • This method is static.

Arguments

  • $nb mixed - <p>integer number of item in the type (default 0)</p>

getMenuPicture

string PluginFlyvemdmAgent::getMenuPicture()

Return the picture file for the menu

  • Visibility: public
  • This method is static.

getRights

mixed PluginFlyvemdmAgent::getRights($interface)
  • Visibility: public

Arguments

  • $interface mixed

defineTabs

mixed PluginFlyvemdmAgent::defineTabs($options)

Define tabs available for this itemtype

  • Visibility: public

Arguments

  • $options mixed

getTabNameForItem

mixed PluginFlyvemdmAgent::getTabNameForItem(\CommonGLPI $item, $withtemplate)
  • Visibility: public

Arguments

  • $item CommonGLPI
  • $withtemplate mixed

displayTabContentForItem

mixed PluginFlyvemdmAgent::displayTabContentForItem($item, $tabnum, $withtemplate)
  • Visibility: public
  • This method is static.

Arguments

  • $item mixed - <p>CommonGLPI object</p>
  • $tabnum mixed - <p>(default 1)</p>
  • $withtemplate mixed - <p>(default 0)</p>

showForm

mixed PluginFlyvemdmAgent::showForm($ID, $options)

Show form for edition

  • Visibility: public

Arguments

  • $ID mixed
  • $options mixed

showDangerZone

void PluginFlyvemdmAgent::showDangerZone(\PluginFlyvemdmAgent $item)

Print the computer's operating system form

  • Visibility: public
  • This method is static.

Arguments

showForFleet

string PluginFlyvemdmAgent::showForFleet(\PluginFlyvemdmFleet $item)

Display the agents according the fleet

  • Visibility: public
  • This method is static.

Arguments

canViewItem

mixed PluginFlyvemdmAgent::canViewItem()
  • Visibility: public

sendWipeQuery

mixed PluginFlyvemdmAgent::sendWipeQuery()

Send a wipe command to the agent

  • Visibility: protected

sendLockQuery

mixed PluginFlyvemdmAgent::sendLockQuery()

Send a lock command to the agent

  • Visibility: protected

sendUnlockQuery

mixed PluginFlyvemdmAgent::sendUnlockQuery()

Send a lock command to the agent

  • Visibility: protected

sendUnenrollQuery

mixed PluginFlyvemdmAgent::sendUnenrollQuery()

Send unenrollment command to the agent

  • Visibility: protected

prepareInputForAdd

mixed PluginFlyvemdmAgent::prepareInputForAdd($input)
  • Visibility: public

Arguments

  • $input mixed

prepareInputForUpdate

mixed PluginFlyvemdmAgent::prepareInputForUpdate($input)
  • Visibility: public

Arguments

  • $input mixed

post_addItem

mixed PluginFlyvemdmAgent::post_addItem()
  • Visibility: public

post_getFromDB

mixed PluginFlyvemdmAgent::post_getFromDB()
  • Visibility: public

pre_deleteItem

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

post_updateItem

void PluginFlyvemdmAgent::post_updateItem(integer $history)

Actions done after the UPDATE of the item in the database

  • Visibility: public

Arguments

  • $history integer - <p>store changes history ? (default 1)</p>

post_restoreItem

void PluginFlyvemdmAgent::post_restoreItem()

Actions done after the restore of the item

  • Visibility: public

post_purgeItem

mixed PluginFlyvemdmAgent::post_purgeItem()

Actions done after the purge of an item

  • Visibility: public

getSearchOptions

mixed PluginFlyvemdmAgent::getSearchOptions()
  • Visibility: public

addDefaultJoin

mixed PluginFlyvemdmAgent::addDefaultJoin()

Limit search for agents of guest user

  • Visibility: public
  • This method is static.

addDefaultWhere

mixed PluginFlyvemdmAgent::addDefaultWhere()

Limit search for agents if guest user

  • Visibility: public
  • This method is static.

getSubscribedTopic

string PluginFlyvemdmAgent::getSubscribedTopic()

Returns the topic the agent shall listen

  • Visibility: public

updateSubscription

mixed PluginFlyvemdmAgent::updateSubscription()

Send to an agent an up to date list of MQTT topics it must subscribe

  • Visibility: public

getTopic

mixed PluginFlyvemdmNotifiable::getTopic()

Gets the topic related to the notifiable

getByTopic

mixed PluginFlyvemdmAgent::getByTopic(string|false $topic)

get an agent from DB by topic

  • Visibility: public

Arguments

  • $topic string|false

unsubscribe

mixed PluginFlyvemdmAgent::unsubscribe()

unsibscribe from a fleet

  • Visibility: public

checkChallengeCombinations

integer PluginFlyvemdmAgent::checkChallengeCombinations(Array $authFactors)

Checks if the data provided for enrollment satisfy our requirements

  • Visibility: protected
  • This method is static.

Arguments

  • $authFactors Array

enrollByInvitationToken

mixed PluginFlyvemdmAgent::enrollByInvitationToken(array $input)

Attempt to enroll using an invitation token

  • Visibility: protected

Arguments

  • $input array - <p>Enrollment data</p>

cleanupSubtopics

mixed PluginFlyvemdmAgent::cleanupSubtopics()

Erase delete persisted MQTT topics of the agent

  • Visibility: public

getTopicsToCleanup

array<mixed,string> PluginFlyvemdmAgent::getTopicsToCleanup()

list of topics to cleanup on unenrollment or on enrollment

  • Visibility: public
  • This method is static.

sendGeolocationQuery

boolean PluginFlyvemdmAgent::sendGeolocationQuery($errorMessage)

Send an geolocation request to the agent

  • Visibility: protected

Arguments

  • $errorMessage mixed

pollGeolocationAnswer

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

Arguments

  • $lastPosition array
  • $errorMessage string - <p>the error message to return to the caller</p>

sendInventoryQuery

boolean PluginFlyvemdmAgent::sendInventoryQuery()

Send an inventory request to the device

  • Visibility: protected

pollInventoryAnswer

boolean PluginFlyvemdmAgent::pollInventoryAnswer()

Polls in the DB for the inventory of the agent

  • Visibility: protected

sendPingQuery

boolean PluginFlyvemdmAgent::sendPingQuery()

Sends a message on the subtopic dedicated to ping requests

  • Visibility: protected

pollPingAnswer

boolean PluginFlyvemdmAgent::pollPingAnswer()

Polls the ping answer

  • Visibility: protected

signCertificate

mixed PluginFlyvemdmAgent::signCertificate(String $csr)

Attempts to sign the certificate against the CA

  • Visibility: protected
  • This method is static.

Arguments

  • $csr String - <p>Certificate signing request</p>

getAgents

array PluginFlyvemdmNotifiable::getAgents()

get the agents related to the notifiable

getPackages

array PluginFlyvemdmNotifiable::getPackages()

get the applications related to the notifiable

getFiles

array PluginFlyvemdmNotifiable::getFiles()

get the files related to the notifiable

getFleet

\PluginFlyvemdmFleet PluginFlyvemdmNotifiable::getFleet()

get the fleet attached to the notifiable

getOwner

mixed PluginFlyvemdmAgent::getOwner()

Get the user owner of the agent's device

  • Visibility: public

chooseEnrollMethod

mixed PluginFlyvemdmAgent::chooseEnrollMethod(array $input)

Determine the enrollment method depending on input data

  • Visibility: protected

Arguments

  • $input array

setupMqttAccess

mixed PluginFlyvemdmAgent::setupMqttAccess()

Creates virtual fields with enrollment data

  • Visibility: protected

filterMessages

mixed PluginFlyvemdmAgent::filterMessages(string $error)

If debug node is disabled, disable detailed error messages

  • Visibility: protected

Arguments

  • $error string

logInvitationEvent

mixed PluginFlyvemdmAgent::logInvitationEvent(\PluginFlyvemdmInvitation $invitation, string $event)

Logs invitation events

  • Visibility: protected

Arguments

changeMqttAcl

mixed PluginFlyvemdmAgent::changeMqttAcl(\PluginFlyvemdmFleet $old, \PluginFlyvemdmFleet $new)

Update settings related to fleet change

  • Visibility: protected

Arguments

getComputer

NULL|\Computer PluginFlyvemdmAgent::getComputer()

Get the computer associatated to the agent

  • Visibility: public

notify

mixed PluginFlyvemdmNotifiable::notify(string $topic, string $mqttMessage, \number $qos, \number $retain)

Send a MQTT message

Arguments

  • $topic string
  • $mqttMessage string
  • $qos number
  • $retain number

hook_entity_purge

mixed PluginFlyvemdmAgent::hook_entity_purge(\CommonDBTM $item)

purge agents in the entity being purged

  • Visibility: public

Arguments

  • $item CommonDBTM

hook_computer_purge

mixed PluginFlyvemdmAgent::hook_computer_purge(\CommonDBTM $item)

Deletes agents related to the computers id

  • Visibility: public

Arguments

  • $item CommonDBTM
⚠️ **GitHub.com Fallback** ⚠️