function drupalmonitor_connector_enable in Drupalmonitor 7
Implements hook_enable().
File
- ./
drupalmonitor_connector.install, line 28 - Installer file of drupalmonitor_connector module
Code
function drupalmonitor_connector_enable() {
variable_set('drupalmonitor_hash', md5(microtime() . 'drupalmonitorrocks_salt_666' . time()));
variable_set('drupalmonitor_performance_monitoring', 1);
variable_set('drupalmonitor_server_monitoring', 1);
variable_set('drupalmonitor_user_monitoring', 1);
variable_set('drupalmonitor_files_monitoring', 1);
variable_set('drupalmonitor_node_monitoring', 1);
variable_set('drupalmonitor_modules_monitoring', 1);
variable_set('drupalmonitor_variables_monitoring', 1);
variable_set('drupalmonitor_node_monitoring', 1);
user_role_grant_permissions(1, array(
'access drupalmonitor api',
));
$message = t("You need to create an account on !urldrupalmonitor in order to monitor your website. The sites security hash is @hash. You can configure Drupalmonitor Connector on the !configurl.", array(
'!urldrupalmonitor' => l(t('Drupalmonitor.com'), 'http://www.drupalmonitor.com'),
'@hash' => variable_get('drupalmonitor_hash'),
'!configurl' => l(t('configuration page'), 'admin/config/system/drupalmonitor'),
));
drupal_set_message(filter_xss($message));
}