summaryrefslogtreecommitdiff
path: root/lib/userprofile.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/userprofile.php')
-rw-r--r--lib/userprofile.php44
1 files changed, 38 insertions, 6 deletions
diff --git a/lib/userprofile.php b/lib/userprofile.php
index 4f9d4984f..4321a2f93 100644
--- a/lib/userprofile.php
+++ b/lib/userprofile.php
@@ -283,22 +283,54 @@ class UserProfile extends Widget
}
}
+ // return-to args, so we don't have to keep re-writing them
+
+ $r2args = array('action' => 'showstream',
+ 'nickname' => $this->profile->nickname);
+
// block/unblock
$blocked = $cur->hasBlocked($this->profile);
$this->out->elementStart('li', 'entity_block');
if ($blocked) {
- $ubf = new UnblockForm($this->out, $this->profile,
- array('action' => 'showstream',
- 'nickname' => $this->profile->nickname));
+ $ubf = new UnblockForm($this->out, $this->profile, $r2args);
$ubf->show();
} else {
- $bf = new BlockForm($this->out, $this->profile,
- array('action' => 'showstream',
- 'nickname' => $this->profile->nickname));
+ $bf = new BlockForm($this->out, $this->profile, $r2args);
$bf->show();
}
$this->out->elementEnd('li');
+
+ if ($cur->hasRight(Right::SANDBOXUSER)) {
+ $this->out->elementStart('li', 'entity_sandbox');
+ if ($this->user->isSandboxed()) {
+ $usf = new UnSandboxForm($this->out, $this->profile, $r2args);
+ $usf->show();
+ } else {
+ $sf = new SandboxForm($this->out, $this->profile, $r2args);
+ $sf->show();
+ }
+ $this->out->elementEnd('li');
+ }
+
+ if ($cur->hasRight(Right::SILENCEUSER)) {
+ $this->out->elementStart('li', 'entity_silence');
+ if ($this->user->isSilenced()) {
+ $usf = new UnSilenceForm($this->out, $this->profile, $r2args);
+ $usf->show();
+ } else {
+ $sf = new SilenceForm($this->out, $this->profile, $r2args);
+ $sf->show();
+ }
+ $this->out->elementEnd('li');
+ }
+
+ if ($cur->hasRight(Right::DELETEUSER)) {
+ $this->out->elementStart('li', 'entity_delete');
+ $df = DeleteUserForm($this->out, $this->profile, $r2args);
+ $df->show();
+ $this->out->elementEnd('li');
+ }
}
}