 acquia_agent/acquia_agent.module | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/acquia_agent/acquia_agent.module b/acquia_agent/acquia_agent.module
index 91513ec..1515c3b 100644
--- a/acquia_agent/acquia_agent.module
+++ b/acquia_agent/acquia_agent.module
@@ -121,6 +121,23 @@ function acquia_agent_toolbar_add_links($toolbar) {
  * Implementation of hook_init().
  */
 function acquia_agent_init() {
+  
+  // If we do not have any current creds or connection, but there are creds
+  // provided by acquia cloud, use those.
+   if (!acquia_agent_has_credentials() && !variable_get('acquia_subscription_data', FALSE)
+      && variable_get('ah_network_key', FALSE) && variable_get('ah_network_identifier', FALSE)) {
+
+    variable_set('acquia_identifier', variable_get('ah_network_identifier', FALSE));
+    variable_set('acquia_key', variable_get('ah_network_key', FALSE));
+
+    $activated = acquia_agent_check_subscription();
+    
+    if ($activated) {
+      $text = 'Your site has been automatically connected to the Acquia Network subscription associated with this hosting account. ' . l(t('Change subscription', '/admin/config/system/acquia-agent/setup'));
+      drupal_set_message($text, 'status', FALSE);
+    }
+  }
+  
   $request = ltrim(request_uri(), DIRECTORY_SEPARATOR);
   $hide_signup_messages = variable_get('acquia_agent_hide_signup_messages', 0);
   if (!$hide_signup_messages &&
