123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class SilenceAction extends ProfileFormAction
- {
-
- function prepare($args)
- {
- if (!parent::prepare($args)) {
- return false;
- }
- $cur = common_current_user();
- assert(!empty($cur));
- if (!$cur->hasRight(Right::SILENCEUSER)) {
-
- $this->clientError(_('You cannot silence users on this site.'));
- }
- assert(!empty($this->profile));
- if ($this->profile->isSilenced()) {
-
- $this->clientError(_('User is already silenced.'));
- }
- return true;
- }
-
- function handlePost()
- {
- $this->profile->silence();
- }
- }
|