<commit_before><?php
/*
 * This product includes software developed by
 * <NAME> (http://about.me/ismailelshareef)
 * under Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0.html).
 *
 */
class TwitterUserIdentity extends TwitterComponent implements IUserIdentity {

    /**
     * @var string OAuth consumer key.
     */
    public $key = '';
    /**
     * @var string OAuth consumer secret.
     */
    public $secret = '';
	/**
     * @var bool Is the user authenticated?
     */
    private $_authenticated=false;

    public function __construct($key, $secret) {
		if (isset($key) && isset($secret)) {
			$this->key = $key;
			$this->secret = $secret;
		} else {
			throw new TwitterException("Tokens are incorrect or missing.");
		}
    }

    public function getIsAuthenticated() {
        return $this->_authenticated;
    }

    public function getId() {
        return Yii::app()->session['access_token']['user_id'];
    }

    public function getName() {
        return Yii::app()->session['access_token']['screen_name'];
    }

    public function getPersistentStates() {
    }

    public function authenticate() {
		$session=Yii::app()->session;
		$tmhOAuth = new tmhOAuth(array(
		  'consumer_key'    => $this->key,
		  'consumer_secret' => $this->secret,
		));
		$here = 'http://localhost/voterspring/index.php?r=site/twitterlogin';
		
		// already got some credentials stored?
		if (isset($session['access_token'])) {
			$tmhOAuth->config['user_token']  = $session['access_token']['oauth_token'];
		  	$tmhOAuth->config['user_secret'] = $session['access_token']['oauth_token_secret'];

		  	$tmhOAuth->request('GET', $tmhOAuth->url('1/account/verify_credentials'));
		  	$session['twitter_user'] = json_decode($tmhOAuth->response['response']);
			$this->_authenticated = true;<commit_msg>Updated the callback URL<commit_after><?php
/*
 * This product includes software developed by
 * <NAME> (http://about.me/ismailelshareef)
 * under Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0.html).
 *
 */
class TwitterUserIdentity extends TwitterComponent implements IUserIdentity {

    /**
     * @var string OAuth consumer key.
     */
    public $key = '';
    /**
     * @var string OAuth consumer secret.
     */
    public $secret = '';
	/**
     * @var bool Is the user authenticated?
     */
    private $_authenticated=false;

    public function __construct($key, $secret) {
		if (isset($key) && isset($secret)) {
			$this->key = $key;
			$this->secret = $secret;
		} else {
			throw new TwitterException("Tokens are incorrect or missing.");
		}
    }

    public function getIsAuthenticated() {
        return $this->_authenticated;
    }

    public function getId() {
        return Yii::app()->session['access_token']['user_id'];
    }

    public function getName() {
        return Yii::app()->session['access_token']['screen_name'];
    }

    public function getPersistentStates() {
    }

    public function authenticate() {
		$session=Yii::app()->session;
		$tmhOAuth = new tmhOAuth(array(
		  'consumer_key'    => $this->key,
		  'consumer_secret' => $this->secret,
		));
		$here = Yii::app()->request->hostInfo . Yii::app()->request->url;
		
		// already got some credentials stored?
		if (isset($session['access_token'])) {
			$tmhOAuth->config['user_token']  = $session['access_token']['oauth_token'];
		  	$tmhOAuth->config['user_secret'] = $session['access_token']['oauth_token_secret'];

		  	$tmhOAuth->request('GET', $tmhOAuth->url('1/account/verify_credentials'));
		  	$session['twitter_user'] = json_decode($tmhOAuth->response['response']);
			$this->_authenticated = true;
{'fraction_non_alphanumeric': 0.1662551440329218, 'fraction_numerical': 0.0027434842249657062, 'mean_word_length': 3.5067985166872684, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '201434', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1121, 'n_words': 221}