]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
RemoteProfileAction cleanup:
authorBrion Vibber <brion@pobox.com>
Tue, 16 Nov 2010 00:12:16 +0000 (16:12 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 16 Nov 2010 00:12:16 +0000 (16:12 -0800)
- meta robots to prevent spidering
- a little notice if silenced

lib/userprofile.php
plugins/ModPlus/remoteprofileaction.php

index 9124b7c94d0b4c81e8c6dbffb0728170461fead4..2813f735eabad3efc1b2cebabfcc44cda81921b0 100644 (file)
@@ -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');
index f3ddbc7c6511163842da3b474a0c683d131f99c4..5b25da17019f0571f418d3185e7a98511e35e36b 100644 (file)
@@ -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()