Esempio n. 1
0
 function prepare($args)
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         $this->clientError(_m('No ID.'));
     }
     $this->user = User::staticGet('id', $id);
     if (empty($this->user)) {
         $this->clientError(_m('No such user.'));
     }
     return true;
 }
Esempio n. 2
0
 function prepare($args)
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         // TRANS: Client error displayed trying to perform an action without providing an ID.
         $this->clientError(_m('No ID.'));
     }
     $this->user = User::staticGet('id', $id);
     if (empty($this->user)) {
         // TRANS: Client error displayed when referring to a non-existing user.
         $this->clientError(_m('No such user.'));
     }
     $this->target = $this->user;
     return true;
 }
Esempio n. 3
0
 protected function prepare(array $args = array())
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         // TRANS: Client error displayed trying to perform an action without providing an ID.
         $this->clientError(_m('No ID.'));
     }
     $this->user = User::getKV('id', $id);
     if (!$this->user instanceof User) {
         // TRANS: Client error displayed when referring to a non-existing user.
         $this->clientError(_m('No such user.'));
     }
     $this->target = $this->user->getProfile();
     return true;
 }
Esempio n. 4
0
 function prepare($args)
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         $this->clientError(_('No ID.'));
     }
     $this->group = User_group::staticGet('id', $id);
     if (empty($this->group)) {
         $this->clientError(_('No such group.'));
     }
     $oprofile = Ostatus_profile::staticGet('group_id', $id);
     if ($oprofile) {
         $this->clientError(_m("Can't accept remote posts for a remote group."));
     }
     return true;
 }
Esempio n. 5
0
 function prepare($args)
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         // TRANS: Client error displayed trying to perform an action without providing an ID.
         $this->clientError(_m('No ID.'));
     }
     $this->peopletag = Profile_list::staticGet('id', $id);
     if (empty($this->peopletag)) {
         // TRANS: Client error displayed when referring to a non-existing list.
         $this->clientError(_m('No such list.'));
     }
     $oprofile = Ostatus_profile::staticGet('peopletag_id', $id);
     if (!empty($oprofile)) {
         // TRANS: Client error displayed when trying to send a message to a remote list.
         $this->clientError(_m('Cannot accept remote posts for a remote list.'));
     }
     return true;
 }
Esempio n. 6
0
 protected function prepare(array $args = array())
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         // TRANS: Client error.
         $this->clientError(_m('No ID.'));
     }
     $this->group = User_group::getKV('id', $id);
     if (!$this->group instanceof User_group) {
         // TRANS: Client error.
         $this->clientError(_m('No such group.'));
     }
     $this->target = $this->group;
     $remote_group = Ostatus_profile::getKV('group_id', $id);
     if ($remote_group instanceof Ostatus_profile) {
         // TRANS: Client error.
         $this->clientError(_m('Cannot accept remote posts for a remote group.'));
     }
     return true;
 }
 protected function prepare(array $args = array())
 {
     parent::prepare($args);
     $id = $this->trimmed('id');
     if (!$id) {
         // TRANS: Client error displayed trying to perform an action without providing an ID.
         $this->clientError(_m('No ID.'));
     }
     $this->peopletag = Profile_list::getKV('id', $id);
     if (!$this->peopletag instanceof Profile_list) {
         // TRANS: Client error displayed when referring to a non-existing list.
         $this->clientError(_m('No such list.'));
     }
     $this->target = $this->peopletag;
     $remote_list = Ostatus_profile::getKV('peopletag_id', $id);
     if ($remote_list instanceof Ostatus_profile) {
         // TRANS: Client error displayed when trying to send a message to a remote list.
         $this->clientError(_m('Cannot accept remote posts for a remote list.'));
     }
     return true;
 }