You are here

function acquia_agent_connection_error_message in Acquia Connector 6

Same name and namespace in other branches
  1. 6.2 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()
  2. 7.3 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()
  3. 7 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()
  4. 7.2 acquia_agent/acquia_agent.module \acquia_agent_connection_error_message()

Returns an error message for the most recent (failed) attempt to connect to the Acquia Network during the current page request. If there were no failed attempts, returns FALSE.

This function assumes that the most recent XML-RPC error came from the Acquia Network; otherwise, it will not work correctly.

2 calls to acquia_agent_connection_error_message()
acquia_agent_settings_form_page in acquia_agent/acquia_agent.pages.inc
Menu callback for settings page.
acquia_agent_set_validate in acquia_agent/acquia_agent.pages.inc
Validate acquia_agent_settings form submissions.

File

acquia_agent/acquia_agent.module, line 391
Acquia Agent securely sends information to Acquia Network.

Code

function acquia_agent_connection_error_message() {
  $errno = xmlrpc_errno();
  if ($errno) {
    switch ($errno) {
      case SUBSCRIPTION_NOT_FOUND:
        return t('The identifier you have provided does not exist in the Acquia Network or is expired. Please make sure you have used the correct value and try again.');
        break;
      case SUBSCRIPTION_EXPIRED:
        return t('Your Acquia Network subscription has expired. Please renew your subscription so that you can resume using Acquia Network services.');
        break;
      case SUBSCRIPTION_MESSAGE_FUTURE:
        return t('Your server is unable to communicate with the Acquia Network due to a problem with your clock settings. For security reasons, we reject messages that are more than @time ahead of the actual time recorded by our servers. Please fix the clock on your server and try again.', array(
          '@time' => format_interval(SUBSCRIPTION_MESSAGE_LIFETIME),
        ));
        break;
      case SUBSCRIPTION_MESSAGE_EXPIRED:
        return t('Your server is unable to communicate with the Acquia Network due to a problem with your clock settings. For security reasons, we reject messages that are more than @time older than the actual time recorded by our servers. Please fix the clock on your server and try again.', array(
          '@time' => format_interval(SUBSCRIPTION_MESSAGE_LIFETIME),
        ));
        break;
      case SUBSCRIPTION_VALIDATION_ERROR:
        return t('The identifier and key you have provided for the Acquia Network do not match. Please make sure you have used the correct values and try again.');
        break;
      default:
        return t('There is an error communicating with the Acquia Network at this time. Please check your identifier and key and try again.');
        break;
    }
  }
  return FALSE;
}