PHP User::isSysop Examples

PHP User::isSysop - 2 examples found. These are the top rated real world PHP examples of User::isSysop extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 public function isAllowed($isLoggedIn, $userId = 0)
 {
     if (!$isLoggedIn) {
         return false;
     } else {
         if ($isLoggedIn && $userId == 0) {
             return false;
         } else {
             $user = new User();
             $user->setID($userId);
             return in_array('newarticlepatrol', $user->getRights()) || $user->isSysop();
         }
     }
 }
 /**
  *
  * For the given userId, returns the html for that user's
  * avatar. Also makes $foundAdmin true if the current user
  * is an admin.
  *
  */
 static function getActualAvatar($user_id, &$foundAdmin)
 {
     if ($user_id) {
         $u = new User();
         $u->setID($user_id);
         if ($u->loadFromDatabase()) {
             $foundAdmin = $foundAdmin || $u->getGroups() && $u->isSysop();
         }
         $img = Avatar::getAvatarURL($u->getName());
         if ($img == '') {
             $img = Avatar::getDefaultPicture();
         } else {
             $img = "<img src='{$img}' />";
         }
         $avatar = "<div class='nfd_avatar'><a href='{$u->getUserPage()->getFullURL()}' target='_blank' class='tooltip'>{$img}</a>";
         $avatar .= "<span class='tooltip_span'>Hi, I'm {$u->getName()}</span></div>";
     }
     return $avatar;
 }