You are here

function acquia_spi_check_login in Acquia Connector 6.2

Same name and namespace in other branches
  1. 7.3 acquia_spi/acquia_spi.module \acquia_spi_check_login()
  2. 7.2 acquia_spi/acquia_spi.module \acquia_spi_check_login()

Checks to see if SSL login is required

Parameters

n/a:

Return value

boolean

1 call to acquia_spi_check_login()
acquia_spi_get in acquia_spi/acquia_spi.module
Gather site profile information about this site.

File

acquia_spi/acquia_spi.module, line 917
Send site profile information (NSPI) and system data to Acquia Insight.

Code

function acquia_spi_check_login() {
  $login_safe = 0;
  if (module_exists('securepages')) {
    if (drupal_match_path('user/login', variable_get('securepages_pages', ''))) {
      $login_safe = 1;
    }
    if (drupal_match_path('user/login', variable_get('securepages_ignore', ''))) {
      $login_safe = 0;
    }
    if (!variable_get('securepages_secure', FALSE) || !variable_get('securepages_enable', FALSE)) {
      $login_safe = 0;
    }
  }
  elseif (module_exists('securelogin')) {

    // All the required forms should be enabled.
    $required_forms = array(
      'securelogin_registerform',
      'securelogin_redirect',
      'securelogin_profileform',
      'securelogin_loginform',
    );
    $login_safe = 1;
    foreach ($required_forms as $form_variable) {
      if (!variable_get($form_variable, TRUE)) {
        $login_safe = 0;
        break;
      }
    }
  }
  return $login_safe;
}