Example #1
0
 /**
  * Prepare the action
  *
  * Reads and validates arguments and instantiates the attributes.
  *
  * @param array $args $_REQUEST args
  *
  * @return boolean success flag
  */
 function prepare($args)
 {
     parent::prepare($args);
     $nickname_arg = $this->arg('nickname');
     $nickname = common_canonical_nickname($nickname_arg);
     // Permanent redirect on non-canonical nickname
     if ($nickname_arg != $nickname) {
         $args = array('nickname' => $nickname);
         common_redirect(common_local_url('showgroup', $args), 301);
         return false;
     }
     if (!$nickname) {
         // TRANS: Client error displayed when requesting a group RSS feed without providing a group nickname.
         $this->clientError(_('No nickname.'), 404);
         return false;
     }
     $local = Local_group::staticGet('nickname', $nickname);
     if (!$local) {
         // TRANS: Client error displayed when requesting a group RSS feed for group that does not exist.
         $this->clientError(_('No such group.'), 404);
         return false;
     }
     $this->group = User_group::staticGet('id', $local->group_id);
     if (!$this->group) {
         // TRANS: Client error displayed when requesting a group RSS feed for an object that is not a group.
         $this->clientError(_('No such group.'), 404);
         return false;
     }
     $this->notices = $this->getNotices($this->limit);
     return true;
 }
Example #2
0
 /**
  * Prepare the action
  *
  * Reads and validates arguments and instantiates the attributes.
  *
  * @param array $args $_REQUEST args
  *
  * @return boolean success flag
  */
 function prepare($args)
 {
     parent::prepare($args);
     $nickname_arg = $this->arg('nickname');
     $nickname = common_canonical_nickname($nickname_arg);
     // Permanent redirect on non-canonical nickname
     if ($nickname_arg != $nickname) {
         $args = array('nickname' => $nickname);
         common_redirect(common_local_url('showgroup', $args), 301);
         return false;
     }
     if (!$nickname) {
         $this->clientError(_('No nickname.'), 404);
         return false;
     }
     $local = Local_group::staticGet('nickname', $nickname);
     if (!$local) {
         $this->clientError(_('No such group.'), 404);
         return false;
     }
     $this->group = User_group::staticGet('id', $local->group_id);
     if (!$this->group) {
         $this->clientError(_('No such group.'), 404);
         return false;
     }
     $this->notices = $this->getNotices($this->limit);
     return true;
 }
Example #3
0
 function prepare($args)
 {
     parent::prepare($args);
     $tag = common_canonical_tag($this->trimmed('tag'));
     $this->tag = Notice_tag::staticGet('tag', $tag);
     if (!$this->tag) {
         $this->clientError(_('No such tag.'));
         return false;
     } else {
         return true;
     }
 }
Example #4
0
 /**
  * Initialization.
  *
  * @param array $args Web and URL arguments
  *
  * @return boolean false if user doesn't exist
  */
 function prepare($args)
 {
     parent::prepare($args);
     $nickname = $this->trimmed('nickname');
     $this->user = User::staticGet('nickname', $nickname);
     if (!$this->user) {
         $this->clientError(_('No such user.'));
         return false;
     } else {
         return true;
     }
 }
Example #5
0
 /**
  * Find the user to display by supplied nickname
  *
  * @param array $args Arguments from $_REQUEST
  *
  * @return boolean success
  */
 function prepare($args)
 {
     parent::prepare($args);
     $nickname = $this->trimmed('nickname');
     $this->user = User::getKV('nickname', $nickname);
     if (!$this->user) {
         // TRANS: Client error displayed when trying to get the RSS feed with favorites of a user that does not exist.
         $this->clientError(_('No such user.'));
     } else {
         $this->notices = $this->getNotices($this->limit);
         return true;
     }
 }
Example #6
0
 function prepare($args)
 {
     parent::prepare($args);
     $nickname = $this->trimmed('nickname');
     $this->user = User::getKV('nickname', $nickname);
     if (!$this->user) {
         // TRANS: Client error displayed when providing a non-existing nickname in a RSS 1.0 action.
         $this->clientError(_('No such user.'));
     } else {
         $this->notices = $this->getNotices($this->limit);
         return true;
     }
 }
Example #7
0
 /**
  * Initialization.
  *
  * @param array $args Web and URL arguments
  *
  * @return boolean false if user doesn't exist
  */
 function prepare($args)
 {
     parent::prepare($args);
     $nickname = $this->trimmed('nickname');
     $this->user = User::staticGet('nickname', $nickname);
     if (!$this->user) {
         $this->clientError(_('用户不存在'));
         return false;
     } else {
         $this->notices = $this->getNotices($this->limit);
         return true;
     }
 }
Example #8
0
 function prepare($args)
 {
     parent::prepare($args);
     $tag = common_canonical_tag($this->trimmed('tag'));
     $this->tag = Notice_tag::getKV('tag', $tag);
     if (!$this->tag) {
         // TRANS: Client error when requesting a tag feed for a non-existing tag.
         $this->clientError(_('No such tag.'));
     } else {
         $this->notices = $this->getNotices($this->limit);
         return true;
     }
 }
Example #9
0
 /**
  * Initialization.
  *
  * @param array $args Web and URL arguments
  *
  * @return boolean false if user doesn't exist
  *
  */
 function prepare($args)
 {
     parent::prepare($args);
     $nickname = $this->trimmed('nickname');
     $this->user = User::getKV('nickname', $nickname);
     if (!$this->user) {
         // TRANS: Client error when user not found for an rss related action.
         $this->clientError(_('No such user.'));
     } else {
         $this->notices = $this->getNotices($this->limit);
         return true;
     }
 }
 function prepare($args)
 {
     parent::prepare($args);
     $this->notices = $this->getNotices();
     return true;
 }
 function initRss($limit = 0)
 {
     $url = common_local_url('sup', null, null, $this->user->id);
     header('X-SUP-ID: ' . $url);
     parent::initRss($limit);
 }