function drd_server_aes in Drupal Remote Dashboard Server 6.2
Same name and namespace in other branches
- 7.2 drd_server.module \drd_server_aes()
Get the AES encryption values for the remote DRD dashboard, identified by their IP address.
Return value
array
2 calls to drd_server_aes()
- drd_server_output in ./
drd_server.module - Prepare the output to be sent back to the DRD dashboard. This preparation json encodes the output and then encrypts the resulting string if encryption is available.
- _drd_server_validate_request in ./
drd_server.module
File
- ./
drd_server.module, line 726
Code
function drd_server_aes() {
$cluster_mode = !empty($_SERVER['HTTP_X_DRD_AUTH_TOKEN']);
$referer = $cluster_mode ? $_SERVER['HTTP_X_DRD_AUTH_TOKEN'] : ip_address();
$aes_keys = variable_get('drd_aes_keys', array());
if (empty($aes_keys[$referer])) {
return FALSE;
}
if (!empty($aes_keys[$referer]['cluster_mode']) && (empty($aes_keys[$referer]['cluster_ips']) || strpos($aes_keys[$referer]['cluster_ips'], ip_address()) === FALSE)) {
return FALSE;
}
return $aes_keys[$referer];
}