summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-11-15 16:12:16 -0800
committerBrion Vibber <brion@pobox.com>2010-11-15 16:12:16 -0800
commit5fdcba472b8673380248ab0d5dce45967f774caa (patch)
tree65945eb73772a2b7c2e455fe1a2a5b5c5cb7f5b5
parent88c35c2ccea5edcd08708f30247dc51a7473ecce (diff)
RemoteProfileAction cleanup:
- meta robots to prevent spidering - a little notice if silenced
-rw-r--r--lib/userprofile.php7
-rw-r--r--plugins/ModPlus/remoteprofileaction.php11
2 files changed, 15 insertions, 3 deletions
diff --git a/lib/userprofile.php b/lib/userprofile.php
index 9124b7c94..2813f735e 100644
--- a/lib/userprofile.php
+++ b/lib/userprofile.php
@@ -321,6 +321,9 @@ class UserProfile extends Widget
}
$this->out->elementEnd('li');
+ // Some actions won't be applicable to non-local users.
+ $isLocal = !empty($this->user);
+
if ($cur->hasRight(Right::SANDBOXUSER) ||
$cur->hasRight(Right::SILENCEUSER) ||
$cur->hasRight(Right::DELETEUSER)) {
@@ -351,7 +354,7 @@ class UserProfile extends Widget
$this->out->elementEnd('li');
}
- if ($cur->hasRight(Right::DELETEUSER)) {
+ if ($isLocal && $cur->hasRight(Right::DELETEUSER)) {
$this->out->elementStart('li', 'entity_delete');
$df = new DeleteUserForm($this->out, $this->profile, $r2args);
$df->show();
@@ -361,7 +364,7 @@ class UserProfile extends Widget
$this->out->elementEnd('li');
}
- if ($cur->hasRight(Right::GRANTROLE)) {
+ if ($isLocal && $cur->hasRight(Right::GRANTROLE)) {
$this->out->elementStart('li', 'entity_role');
$this->out->element('p', null, _('User role'));
$this->out->elementStart('ul');
diff --git a/plugins/ModPlus/remoteprofileaction.php b/plugins/ModPlus/remoteprofileaction.php
index f3ddbc7c6..5b25da170 100644
--- a/plugins/ModPlus/remoteprofileaction.php
+++ b/plugins/ModPlus/remoteprofileaction.php
@@ -64,6 +64,11 @@ class RemoteProfileAction extends ShowstreamAction
$url);
$html = common_markup_to_html($markdown);
$this->raw($html);
+
+ if ($this->profile->hasRole(Profile_role::SILENCED)) {
+ $markdown = _m('Site moderators have silenced this profile, which prevents delivery of new messages to any users on this site.');
+ $this->raw(common_markup_to_html($markdown));
+ }
}
function getFeeds()
@@ -71,9 +76,13 @@ class RemoteProfileAction extends ShowstreamAction
// none
}
+ /**
+ * Don't do various extra stuff, and also trim some things to avoid crawlers.
+ */
function extraHead()
{
- // none
+ $this->element('meta', array('name' => 'robots',
+ 'content' => 'noindex,nofollow'));
}
function showLocalNav()