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; } } }
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(); } } }
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(); } } }
function error($user, $text) { common_user_error($text); }