You are here

function _securesite_digest_validate in Secure Site 6.2

Same name and namespace in other branches
  1. 7.2 securesite.inc \_securesite_digest_validate()

Get the result of digest validation.

Parameters

$status: Will be set to the return status of the validation script

$edit: An array of parameters to pass to the validation script

Return value

An HTTP header string.

6 calls to _securesite_digest_validate()
SecureSiteFunctionDigestValidateUnitTest::testSecureSiteFunctionDigestValidateData in ./securesite.test
Check output with data.
SecureSiteFunctionDigestValidateUnitTest::testSecureSiteFunctionDigestValidateEmpty in ./securesite.test
Check output without data.
SecureSiteFunctionDigestValidateUnitTest::testSecureSiteFunctionDigestValidateNull in ./securesite.test
Check output without input.
_securesite_denied in ./securesite.inc
Deny access to users who are not authorized to access secured pages.
_securesite_dialog in ./securesite.inc
Display authentication dialog and send password reset mails.

... See full list

File

./securesite.inc, line 133
Secure Site log-in functions.

Code

function _securesite_digest_validate(&$status, $edit = array()) {
  static $header;
  if (!empty($edit)) {
    $args = array();
    foreach ($edit as $key => $value) {
      $args[] = "{$key}=" . escapeshellarg($value);
    }
    $script = variable_get('securesite_digest_script', drupal_get_path('module', 'securesite') . '/digest_md5/digest_md5.php');
    $response = exec($script . ' ' . implode(' ', $args), $output, $status);
    if (isset($edit['data']) && empty($status)) {
      $header = "Authentication-Info: {$response}";
    }
    else {
      $header = "WWW-Authenticate: Digest {$response}";
    }
  }
  return $header;
}