Exemplo n.º 1
0
 function handle($args)
 {
     parent::handle($args);
     if (!common_logged_in()) {
         common_user_error(_('Not logged in.'));
         exit;
     } else {
         if ($this->notice->profile_id != $this->user_profile->id) {
             common_user_error(_('Can\'t delete this notice.'));
             exit;
         }
     }
 }
Exemplo n.º 2
0
 function handle($args)
 {
     parent::handle($args);
     if ($this->notice->profile_id != $this->user_profile->id && !$this->user->hasRight(Right::DELETEOTHERSNOTICE)) {
         common_user_error(_('Can\'t delete this notice.'));
         exit;
     }
     // XXX: Ajax!
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->deleteNotice();
     } else {
         if ($_SERVER['REQUEST_METHOD'] == 'GET') {
             $this->showForm();
         }
     }
 }
Exemplo n.º 3
0
 function handle($args)
 {
     parent::handle($args);
     if ($this->notice->profile_id != $this->user_profile->id && !$this->user->hasRight(Right::DELETEOTHERSNOTICE)) {
         // TRANS: Error message displayed trying to delete a notice that was not made by the current user.
         common_user_error(_('Cannot delete this notice.'));
         exit;
     }
     // XXX: Ajax!
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->deleteNotice();
     } else {
         if ($_SERVER['REQUEST_METHOD'] == 'GET') {
             $this->showForm();
         }
     }
 }
Exemplo n.º 4
0
 function error($user, $text)
 {
     common_user_error($text);
 }