You are here

function LingotekOAuthRequestSigner::getAuthorizationHeader in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/LingotekOAuthRequestSigner.php \LingotekOAuthRequestSigner::getAuthorizationHeader()
  2. 7.4 lib/oauth-php/library/LingotekOAuthRequestSigner.php \LingotekOAuthRequestSigner::getAuthorizationHeader()
  3. 7.5 lib/oauth-php/library/LingotekOAuthRequestSigner.php \LingotekOAuthRequestSigner::getAuthorizationHeader()

* Builds the Authorization header for the request. * Adds all oauth_ and xoauth_ parameters to the Authorization header. * *

Return value

string

1 call to LingotekOAuthRequestSigner::getAuthorizationHeader()
LingotekOAuthRequester::curl_raw in lib/oauth-php/library/LingotekOAuthRequester.php
* Open and close a curl session passing all the options to the curl libs * *

File

lib/oauth-php/library/LingotekOAuthRequestSigner.php, line 159

Class

LingotekOAuthRequestSigner

Code

function getAuthorizationHeader() {
  if (!$this->signed) {
    $this
      ->sign($this->usr_id);
  }
  $h = array();
  $h[] = 'Authorization: OAuth realm=""';
  foreach ($this->param as $name => $value) {
    if (strncmp($name, 'oauth_', 6) == 0 || strncmp($name, 'xoauth_', 7) == 0) {
      $h[] = $name . '="' . $value . '"';
    }
  }
  $hs = implode(', ', $h);
  return $hs;
}