Commit 50e4e205 authored by Matt Glaman's avatar Matt Glaman Committed by Jakob P
Browse files

Issue #3314139 by nkoporec, mglaman: EOL message for 7.x-3.x

parent bf07df1f
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -86,6 +86,24 @@ function acquia_agent_requirements($phase) {
    case 'runtime':
      $token = ['token' => drupal_get_token('admin/config/system/acquia-agent/refresh-status')];

      // After Tue Nov 15 2022.
      $eol_warning_date = new \DateTime('Tue Nov 15 2022');
      $current_date = new \DateTime('now');
      if ($current_date >= $eol_warning_date) {
        $requirements['acquia_3_x_eol'] = [
          'title' => t('Acquia 3.x EOL'),
          'value' => t('Acquia Connector 3.x has reached end of life, please upgrade to 4.x to continue using it.'),
          'description' => t('Please upgrade to 4.x before March 1st 2023, after that the 3.x version of the module will no longer work.'),
          'severity' => REQUIREMENT_WARNING,
        ];

        // after Wed Mar 01 2023.
        $eol_date = new \DateTime('Wed Mar 01 2023');
        if ($current_date >= $eol_date) {
            $requirements['acquia_3_x_eol']['severity'] = REQUIREMENT_ERROR;
        }
      }

      // Inform users on subscription status. Either we know they are active,
      // or we know they have credentials but not active (not set up yet) or
      // we have credentials but an inactive subscription (either bad
+15 −0
Original line number Diff line number Diff line
@@ -240,6 +240,13 @@ function acquia_agent_theme() {
 *   xmlrpc error number or subscription data
 */
function acquia_agent_check_subscription($params = array()) {
  // This has reached EOL after Wed Mar 01 2023.
  $eol_date = new \DateTime('Wed Mar 01 2023');
  $current_date = new \DateTime('now');
  if ($current_date >= $eol_date) {
    return ['active' => FALSE];
  }

  $current_subscription = acquia_agent_settings('acquia_subscription_data');
  $subscription = FALSE;
  $active = FALSE;
@@ -605,6 +612,14 @@ function acquia_agent_call($method, $params, $identifier = NULL, $key = NULL, $a
    'ssl' => $ssl,
    'body' => $params,
  );

  $eol_date = new \DateTime('Wed Mar 01 2023');
  $current_date = new \DateTime('now');
  if ($current_date >= $eol_date) {
    $data['result'] = FALSE;
    return $data;
  }

  $data['result'] = _acquia_agent_request($acquia_network_address, $method, $data);
  return $data;
}