]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
try again with user_timeline auth
authorEvan Prodromou <evan@prodromou.name>
Sat, 19 Jul 2008 15:55:26 +0000 (11:55 -0400)
committerEvan Prodromou <evan@prodromou.name>
Sat, 19 Jul 2008 15:55:26 +0000 (11:55 -0400)
darcs-hash:20080719155526-84dde-5157cd11d2f96128321b46cb2bea8ff27ce4478f.gz

actions/api.php
actions/twitapistatuses.php

index 97da359feaba25e5239feef6b10e84f581091590..1cfae91143621908d1c964a4774e15daf02b8c5a 100644 (file)
@@ -105,9 +105,18 @@ class ApiAction extends Action {
                                                                'statuses/show',
                                                                'help/test', 
                                                                'help/downtime_schedule');
-               if (in_array("$this->api_action/$this->api_method", $noauth)) {
+               static $bareauth = array('statuses/user_timeline');
+
+               # noauth: never needs auth
+               # bareauth: only needs auth if without an argument
+               
+               $fullname = "$this->api_action/$this->api_method";
+               
+               if (in_array($fullname, $bareauth) && !$this->api_arg) {
+                       return true;
+               } if (in_array($fullname, $noauth)) {
                        return false;
-               }               
+               }
                return true;
        }
                
index 5a4345ab656bb829ebdc3d9aa9caa8b3c80fd647..96931fec634949caef800d55219a1d46ce25d31e 100644 (file)
@@ -309,14 +309,6 @@ class TwitapistatusesAction extends TwitterapiAction {
                        // Set the user to be the auth user if asked-for can't be found
                        // honestly! This is what Twitter does, I swear --Zach
                        $user = $apidata['user'];
-                       
-                       if (!$user) {
-                               # This header makes basic auth go
-                               header('WWW-Authenticate: Basic realm="Laconica API"');
-                               # if the user hits cancel -- bam!
-                               common_show_basic_auth_error();
-                               exit();
-                       }
                }
 
                $profile = $user->getProfile();