]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'br3nda/0.8.x-tagrssfix' into 0.8.x
authorCraig Andrews <candrews@integralblue.com>
Thu, 23 Jul 2009 15:16:50 +0000 (11:16 -0400)
committerCraig Andrews <candrews@integralblue.com>
Thu, 23 Jul 2009 15:16:50 +0000 (11:16 -0400)
1  2 
lib/rssaction.php

index 6c982705efaea13508eaf634143427aab159eada,23653e4062b73bc0e3d8281307b630682e055ddf..0aca965664ded103b19de87ed7b0f661ebacad5c
@@@ -97,37 -97,8 +97,33 @@@ class Rss10Action extends Actio
      {
          // Parent handling, including cache check
          parent::handle($args);
 +
 +        if (common_config('site', 'private')) {
 +            if (!isset($_SERVER['PHP_AUTH_USER'])) {
 +
 +                # This header makes basic auth go
 +                header('WWW-Authenticate: Basic realm="Laconica RSS"');
 +
 +                # If the user hits cancel -- bam!
 +                $this->show_basic_auth_error();
 +                return;
 +            } else {
 +                $nickname = $_SERVER['PHP_AUTH_USER'];
 +                $password = $_SERVER['PHP_AUTH_PW'];
 +
 +                if (!common_check_user($nickname, $password)) {
 +                    # basic authentication failed
 +                    list($proxy, $ip) = common_client_ip();
 +
 +                    common_log(LOG_WARNING, "Failed RSS auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip.");
 +                    $this->show_basic_auth_error();
 +                    return;
 +                }
 +            }
 +        }
 +
          // Get the list of notices
-         if (empty($this->tag)) {
-             $this->notices = $this->getNotices($this->limit);
-         } else {
-             $this->notices = $this->getTaggedNotices($this->tag, $this->limit);
-         }
+         $this->notices = $this->getNotices($this->limit);
          $this->showRss();
      }