Added missing permission check / limit
authorMarcel Werk <burntime@woltlab.com>
Sat, 4 Oct 2014 19:49:03 +0000 (21:49 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 4 Oct 2014 19:49:03 +0000 (21:49 +0200)
com.woltlab.wcf/templates/dashboardBoxTodaysBirthdays.tpl
wcfsetup/install/files/lib/system/dashboard/box/FollowingsOnlineSidebarDashboardBox.class.php
wcfsetup/install/files/lib/system/dashboard/box/TodaysBirthdaysDashboardBox.class.php
wcfsetup/install/files/lib/system/dashboard/box/TodaysFollowingBirthdaysDashboardBox.class.php
wcfsetup/install/files/lib/system/dashboard/box/UsersOnlineSidebarDashboardBox.class.php

index 1252b6b21a3b5263f662393c7bc22a5e83f8bb27..e756e22fae1dabf9c2dfb04bc3a731d47c4dbcf9 100644 (file)
@@ -11,7 +11,7 @@
        {/foreach}
 </ul>
 
-{if $birthdayUserProfiles|count >= 5}
+{if $birthdayUserProfiles|count >= 10}
        <a class="jsTodaysBirthdays button small more jsOnly">{lang}wcf.global.button.showAll{/lang}</a>
        
        <script data-relocate="true">
index a2752c88605ad4c7257bc83c8d3994f83b3a588d..21cb1450ccc855cae6ad71252ee0eec2ef3f14ac 100644 (file)
@@ -28,9 +28,10 @@ class FollowingsOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox {
        public function init(DashboardBox $box, IPage $page) {
                parent::init($box, $page);
                
-               if (MODULE_USERS_ONLINE && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
+               if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList') && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
                        $this->usersOnlineList = new UsersOnlineList();
                        $this->usersOnlineList->getConditionBuilder()->add('session.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
+                       $this->usersOnlineList->sqlLimit = 10;
                        $this->usersOnlineList->readObjects();
                }
                
index d2afdc51c85750c429e5e8448502b97812bfcffa..f11483be2fca4a138212f6b9f94ba421ba76c810 100644 (file)
@@ -43,7 +43,7 @@ class TodaysBirthdaysDashboardBox extends AbstractSidebarDashboardBox {
                        $userProfileList->readObjects();
                        $i = 0;
                        foreach ($userProfileList as $userProfile) {
-                               if ($i == 5) break;
+                               if ($i == 10) break;
                                
                                if (!$userProfile->isProtected() && substr($userProfile->birthday, 5) == $currentDay) {
                                        $this->userProfiles[] = $userProfile;
index 0f3a384c0a39b5901698856379b050e3359392f8..e86ab23e255b3910722eaa1124d437bcacb10501 100644 (file)
@@ -42,9 +42,13 @@ class TodaysFollowingBirthdaysDashboardBox extends AbstractSidebarDashboardBox {
                        $userProfileList = new UserProfileList();
                        $userProfileList->setObjectIDs($userIDs);
                        $userProfileList->readObjects();
+                       $i = 0;
                        foreach ($userProfileList as $userProfile) {
+                               if ($i == 10) break;
+                               
                                if (!$userProfile->isProtected() && substr($userProfile->birthday, 5) == $currentDay) {
                                        $this->userProfiles[] = $userProfile;
+                                       $i++;
                                }
                        }
                }
index 5f701f99ab051b348077cd31158fd5b8e53606f8..68e21ee03869b825060efc2cb74780675de31b15 100644 (file)
@@ -29,7 +29,7 @@ class UsersOnlineSidebarDashboardBox extends AbstractSidebarDashboardBox {
        public function init(DashboardBox $box, IPage $page) {
                parent::init($box, $page);
                
-               if (MODULE_USERS_ONLINE) {
+               if (MODULE_USERS_ONLINE && WCF::getSession()->getPermission('user.profile.canViewUsersOnlineList')) {
                        $this->usersOnlineList = new UsersOnlineList();
                        $this->usersOnlineList->readStats();
                        $this->usersOnlineList->checkRecord();