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