| @@ 725-746 (lines=22) @@ | ||
| 722 | } |
|
| 723 | ||
| 724 | ||
| 725 | public function ban(SS_HTTPRequest $r) |
|
| 726 | { |
|
| 727 | if (!$r->param('ID')) { |
|
| 728 | return $this->httpError(404); |
|
| 729 | } |
|
| 730 | if (!$this->canModerate()) { |
|
| 731 | return $this->httpError(403); |
|
| 732 | } |
|
| 733 | ||
| 734 | $member = Member::get()->byID($r->param('ID')); |
|
| 735 | if (!$member || !$member->exists()) { |
|
| 736 | return $this->httpError(404); |
|
| 737 | } |
|
| 738 | ||
| 739 | $member->ForumStatus = 'Banned'; |
|
| 740 | $member->write(); |
|
| 741 | ||
| 742 | // Log event |
|
| 743 | $currentUser = Member::currentUser(); |
|
| 744 | SS_Log::log(sprintf( |
|
| 745 | 'Banned member %s (#%d), by moderator %s (#%d)', |
|
| 746 | $member->Email, |
|
| 747 | $member->ID, |
|
| 748 | $currentUser->Email, |
|
| 749 | $currentUser->ID |
|
| @@ 755-776 (lines=22) @@ | ||
| 752 | return ($r->isAjax()) ? true : $this->redirectBack(); |
|
| 753 | } |
|
| 754 | ||
| 755 | public function ghost(SS_HTTPRequest $r) |
|
| 756 | { |
|
| 757 | if (!$r->param('ID')) { |
|
| 758 | return $this->httpError(400); |
|
| 759 | } |
|
| 760 | if (!$this->canModerate()) { |
|
| 761 | return $this->httpError(403); |
|
| 762 | } |
|
| 763 | ||
| 764 | $member = Member::get()->byID($r->param('ID')); |
|
| 765 | if (!$member || !$member->exists()) { |
|
| 766 | return $this->httpError(404); |
|
| 767 | } |
|
| 768 | ||
| 769 | $member->ForumStatus = 'Ghost'; |
|
| 770 | $member->write(); |
|
| 771 | ||
| 772 | // Log event |
|
| 773 | $currentUser = Member::currentUser(); |
|
| 774 | SS_Log::log(sprintf( |
|
| 775 | 'Ghosted member %s (#%d), by moderator %s (#%d)', |
|
| 776 | $member->Email, |
|
| 777 | $member->ID, |
|
| 778 | $currentUser->Email, |
|
| 779 | $currentUser->ID |
|