You are here

class OAuthStoreSession in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession
  2. 7.2 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession
  3. 7.4 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession
  4. 7.5 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession
  5. 7.6 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession

Hierarchy

Expanded class hierarchy of OAuthStoreSession

File

lib/oauth-php/library/store/OAuthStoreSession.php, line 36

View source
class OAuthStoreSession extends OAuthStoreAbstract {
  private $session;

  /*
   * Takes two options: consumer_key and consumer_secret
   */
  public function __construct($options = array()) {
    if (!session_id()) {
      session_start();
    }
    if (isset($options['consumer_key']) && isset($options['consumer_secret'])) {
      $this->session =& $_SESSION['oauth_' . $options['consumer_key']];
      $this->session['consumer_key'] = $options['consumer_key'];
      $this->session['consumer_secret'] = $options['consumer_secret'];
      $this->session['signature_methods'] = array(
        'HMAC-SHA1',
      );
      $this->session['server_uri'] = $options['server_uri'];
      $this->session['request_token_uri'] = $options['request_token_uri'];
      $this->session['authorize_uri'] = $options['authorize_uri'];
      $this->session['access_token_uri'] = $options['access_token_uri'];
    }
    else {
      throw new OAuthException2("OAuthStoreSession needs consumer_token and consumer_secret");
    }
  }
  public function getSecretsForVerify($consumer_key, $token, $token_type = 'access') {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getSecretsForSignature($uri, $user_id) {
    return $this->session;
  }
  public function getServerTokenSecrets($consumer_key, $token, $token_type, $user_id, $name = '') {
    if ($consumer_key != $this->session['consumer_key']) {
      return array();
    }
    return array(
      'consumer_key' => $consumer_key,
      'consumer_secret' => $this->session['consumer_secret'],
      'token' => $token,
      'token_secret' => $this->session['token_secret'],
      'token_name' => $name,
      'signature_methods' => $this->session['signature_methods'],
      'server_uri' => $this->session['server_uri'],
      'request_token_uri' => $this->session['request_token_uri'],
      'authorize_uri' => $this->session['authorize_uri'],
      'access_token_uri' => $this->session['access_token_uri'],
      'token_ttl' => 3600,
    );
  }
  public function addServerToken($consumer_key, $token_type, $token, $token_secret, $user_id, $options = array()) {
    $this->session['token_type'] = $token_type;
    $this->session['token'] = $token;
    $this->session['token_secret'] = $token_secret;
  }
  public function deleteServer($consumer_key, $user_id, $user_is_admin = false) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getServer($consumer_key, $user_id, $user_is_admin = false) {
    return array(
      'id' => 0,
      'user_id' => $user_id,
      'consumer_key' => $this->session['consumer_key'],
      'consumer_secret' => $this->session['consumer_secret'],
      'signature_methods' => $this->session['signature_methods'],
      'server_uri' => $this->session['server_uri'],
      'request_token_uri' => $this->session['request_token_uri'],
      'authorize_uri' => $this->session['authorize_uri'],
      'access_token_uri' => $this->session['access_token_uri'],
    );
  }
  public function getServerForUri($uri, $user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function listServerTokens($user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function countServerTokens($consumer_key) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getServerToken($consumer_key, $token, $user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function deleteServerToken($consumer_key, $token, $user_id, $user_is_admin = false) {

    // TODO
  }
  public function setServerTokenTtl($consumer_key, $token, $token_ttl) {

    //This method just needs to exist. It doesn't have to do anything!
  }
  public function listServers($q = '', $user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function updateServer($server, $user_id, $user_is_admin = false) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function updateConsumer($consumer, $user_id, $user_is_admin = false) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function deleteConsumer($consumer_key, $user_id, $user_is_admin = false) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getConsumer($consumer_key, $user_id, $user_is_admin = false) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getConsumerStatic() {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function addConsumerRequestToken($consumer_key, $options = array()) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getConsumerRequestToken($token) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function deleteConsumerRequestToken($token) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function authorizeConsumerRequestToken($token, $user_id, $referrer_host = '') {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function countConsumerAccessTokens($consumer_key) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function exchangeConsumerRequestForAccessToken($token, $options = array()) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function getConsumerAccessToken($token, $user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function deleteConsumerAccessToken($token, $user_id, $user_is_admin = false) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function setConsumerAccessTokenTtl($token, $ttl) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function listConsumers($user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function listConsumerApplications($begin = 0, $total = 25) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function listConsumerTokens($user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function checkServerNonce($consumer_key, $token, $timestamp, $nonce) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function addLog($keys, $received, $sent, $base_string, $notes, $user_id = null) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function listLog($options, $user_id) {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }
  public function install() {
    throw new OAuthException2("OAuthStoreSession doesn't support " . __METHOD__);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OAuthStoreAbstract::generateKey public function * Generate a unique key * *
OAuthStoreAbstract::isUTF8 protected function * Check to see if a string is valid utf8 * *
OAuthStoreAbstract::makeUTF8 protected function * Make a string utf8, replacing all non-utf8 chars with a '.' * *
OAuthStoreSession::$session private property
OAuthStoreSession::addConsumerRequestToken public function Overrides OAuthStoreAbstract::addConsumerRequestToken
OAuthStoreSession::addLog public function Overrides OAuthStoreAbstract::addLog
OAuthStoreSession::addServerToken public function Overrides OAuthStoreAbstract::addServerToken
OAuthStoreSession::authorizeConsumerRequestToken public function Overrides OAuthStoreAbstract::authorizeConsumerRequestToken
OAuthStoreSession::checkServerNonce public function Overrides OAuthStoreAbstract::checkServerNonce
OAuthStoreSession::countConsumerAccessTokens public function Overrides OAuthStoreAbstract::countConsumerAccessTokens
OAuthStoreSession::countServerTokens public function Overrides OAuthStoreAbstract::countServerTokens
OAuthStoreSession::deleteConsumer public function Overrides OAuthStoreAbstract::deleteConsumer
OAuthStoreSession::deleteConsumerAccessToken public function Overrides OAuthStoreAbstract::deleteConsumerAccessToken
OAuthStoreSession::deleteConsumerRequestToken public function Overrides OAuthStoreAbstract::deleteConsumerRequestToken
OAuthStoreSession::deleteServer public function Overrides OAuthStoreAbstract::deleteServer
OAuthStoreSession::deleteServerToken public function Overrides OAuthStoreAbstract::deleteServerToken
OAuthStoreSession::exchangeConsumerRequestForAccessToken public function Overrides OAuthStoreAbstract::exchangeConsumerRequestForAccessToken
OAuthStoreSession::getConsumer public function Overrides OAuthStoreAbstract::getConsumer
OAuthStoreSession::getConsumerAccessToken public function Overrides OAuthStoreAbstract::getConsumerAccessToken
OAuthStoreSession::getConsumerRequestToken public function Overrides OAuthStoreAbstract::getConsumerRequestToken
OAuthStoreSession::getConsumerStatic public function Overrides OAuthStoreAbstract::getConsumerStatic
OAuthStoreSession::getSecretsForSignature public function Overrides OAuthStoreAbstract::getSecretsForSignature
OAuthStoreSession::getSecretsForVerify public function Overrides OAuthStoreAbstract::getSecretsForVerify
OAuthStoreSession::getServer public function Overrides OAuthStoreAbstract::getServer
OAuthStoreSession::getServerForUri public function Overrides OAuthStoreAbstract::getServerForUri
OAuthStoreSession::getServerToken public function Overrides OAuthStoreAbstract::getServerToken
OAuthStoreSession::getServerTokenSecrets public function Overrides OAuthStoreAbstract::getServerTokenSecrets
OAuthStoreSession::install public function Overrides OAuthStoreAbstract::install
OAuthStoreSession::listConsumerApplications public function Overrides OAuthStoreAbstract::listConsumerApplications
OAuthStoreSession::listConsumers public function Overrides OAuthStoreAbstract::listConsumers
OAuthStoreSession::listConsumerTokens public function Overrides OAuthStoreAbstract::listConsumerTokens
OAuthStoreSession::listLog public function Overrides OAuthStoreAbstract::listLog
OAuthStoreSession::listServers public function Overrides OAuthStoreAbstract::listServers
OAuthStoreSession::listServerTokens public function Overrides OAuthStoreAbstract::listServerTokens
OAuthStoreSession::setConsumerAccessTokenTtl public function Overrides OAuthStoreAbstract::setConsumerAccessTokenTtl
OAuthStoreSession::setServerTokenTtl public function
OAuthStoreSession::updateConsumer public function Overrides OAuthStoreAbstract::updateConsumer
OAuthStoreSession::updateServer public function Overrides OAuthStoreAbstract::updateServer
OAuthStoreSession::__construct public function