You are here

function drd_agent_setup in DRD Agent 6.3

Same name and namespace in other branches
  1. 7.3 drd_agent.admin.inc \drd_agent_setup()

Callback that receives all relevant parameters from a monitoring DRD instance base64 and json encoded in $values. This is called by a menu callback or from drush.

Security note: if called through a http request, this should only be done over https as otherwise those parameters are travelling in plain text.

Parameters

string $values:

Return value

array

2 calls to drd_agent_setup()
drd_agent_authorize_submit in ./drd_agent.admin.inc
Submit handler for the DRD authorization form which will then store the values and redirect back to DRD.
drush_drd_agent_setup in ./drd_agent.drush.inc
Drush command to configure this domain for communication with a DRD instance.

File

./drd_agent.admin.inc, line 34

Code

function drd_agent_setup($values) {
  $values = _drd_agent_setup_decode($values);
  $authorised = variable_get('drd_agent_authorised', array());
  $values['timestamp'] = REQUEST_TIME;
  $values['ip'] = ip_address();
  $authorised[$values['uuid']] = $values;
  variable_set('drd_agent_authorised', $authorised);
  return $values;
}