]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/userprofile.php
RemoteProfileAction cleanup:
[quix0rs-gnu-social.git] / lib / userprofile.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');