123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class UnsandboxAction extends ProfileFormAction
- {
-
- function prepare($args)
- {
- if (!parent::prepare($args)) {
- return false;
- }
- $cur = common_current_user();
- assert(!empty($cur));
- if (!$cur->hasRight(Right::SANDBOXUSER)) {
-
- $this->clientError(_('You cannot sandbox users on this site.'));
- }
- assert(!empty($this->profile));
- if (!$this->profile->isSandboxed()) {
-
- $this->clientError(_('User is not sandboxed.'));
- }
- return true;
- }
-
- function handlePost()
- {
- $this->profile->unsandbox();
- }
- }
|