]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TwitterBridge/actions/twitterauthorization.php
Merged stuff from upstream/master
[quix0rs-gnu-social.git] / plugins / TwitterBridge / actions / twitterauthorization.php
index c9b892b6408d74ec5b388cf0333704c92699dfae..d3df46bfefc68ed5246683cc60f62c7858f3a15c 100644 (file)
@@ -56,17 +56,50 @@ class TwitterauthorizationAction extends FormAction
     var $access_token = null;
     var $verifier     = null;
 
+<<<<<<< .merge_file_Bq71r4
     protected $needLogin = false;   // authorization page can also be used to create a new user
+=======
+    /**
+     * Initialize class members. Looks for 'oauth_token' parameter.
+     *
+     * @param array $args misc. arguments
+     *
+     * @return boolean true
+     */
+    function prepare(array $args=array())
+    {
+        parent::prepare($args);
+>>>>>>> .merge_file_Ad5nH4
 
     protected function doPreparation()
     {
         $this->oauth_token = $this->arg('oauth_token');
         $this->verifier    = $this->arg('oauth_verifier');
 
+<<<<<<< .merge_file_Bq71r4
         if ($this->scoped instanceof Profile) {
             try {
                 $flink = Foreign_link::getByUserID($this->scoped->getID(), TWITTER_SERVICE);
                 $fuser = $flink->getForeignUser();
+=======
+        return true;
+    }
+
+    /**
+     * Handler method
+     *
+     * @param array $args is ignored since it's now passed in in prepare()
+     *
+     * @return nothing
+     */
+    function handle(array $args=array())
+    {
+        parent::handle($args);
+
+        if (common_logged_in()) {
+            $user  = common_current_user();
+            $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE);
+>>>>>>> .merge_file_Ad5nH4
 
                 // If there's already a foreign link record and a foreign user
                 // (no exceptions were thrown when fetching either of them...)