Пример #1
0
 public static function filesBulletinAdd($userId, $bulletinId)
 {
     if ($userId == 0) {
         CAccess::setError('blockUnregister');
         return false;
     }
     $table = JTable::getInstance('Bulletin', 'CTable');
     $table->load($bulletinId);
     //CFactory::load( 'libraries' , 'limits' );
     $groupModel = CFactory::getModel('groups');
     $bulletinParams = $table->getParams();
     if (!CLimitsHelper::exceededGroupFileUpload($table->groupid)) {
         return false;
     }
     if (CLimitsLibrary::exceedDaily('files', $userId)) {
         return false;
     }
     if (COwnerHelper::isCommunityAdmin() || $groupModel->isAdmin($userId, $table->groupid) || $groupModel->isMember($userId, $table->groupid) && $bulletinParams->get('filepermission-member')) {
         return true;
     }
     return false;
 }
Пример #2
0
 public static function groupsBulletinView($userId, $bullentinId)
 {
     $config = CFactory::getConfig();
     if (!$config->get('enablegroups')) {
         CAccess::setError(JText::_('COM_COMMUNITY_GROUPS_DISABLE'));
         return false;
     } else {
         return true;
     }
 }