Beispiel #1
0
             } else {
                 if ($e = $GLOBALS["APPLICATION"]->GetException()) {
                     $errorMessage .= $e->GetString();
                 }
             }
         }
     }
 }
 if (StrLen($errorMessage) <= 0) {
     foreach ($arGroupsId as $ind => $val) {
         CSocNetUserToGroup::Add(array("USER_ID" => 1, "GROUP_ID" => $val, "ROLE" => "A", "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER, "INITIATED_BY_USER_ID" => 1, "MESSAGE" => false));
     }
 }
 if (StrLen($errorMessage) <= 0) {
     // set EUV vor news
     $dbResult = CSocNetEventUserView::GetList(array("ENTITY_ID" => "ASC"), array("ENTITY_TYPE" => "N"));
     $arResult = $dbResult->Fetch();
     if (!$arResult) {
         CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news", "USER_ID" => 0, "USER_ANONYMOUS" => "N"));
         CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news_comment", "USER_ID" => 0, "USER_ANONYMOUS" => "N"));
     }
     $blogGroupID = 0;
     if (CModule::IncludeModule("blog")) {
         $dbRes = CBlogGroup::GetList(array("ID" => "DESC"), array("SITE_ID" => WIZARD_SITE_ID));
         if ($arRes = $dbRes->Fetch()) {
             $blogGroupID = $arRes["ID"];
         }
     }
     $forumID = 0;
     $photoForumID = 0;
     if (CModule::IncludeModule("forum")) {
 function IsEntityEmpty($entityType, $entityID)
 {
     global $arSocNetAllowedEntityTypes;
     $entityType = trim($entityType);
     if (!in_array($entityType, $arSocNetAllowedEntityTypes)) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_INCORRECT_ENTITY_TYPE"), "ERROR_INCORRECT_ENTITY_TYPE");
         return false;
     }
     $entityID = IntVal($entityID);
     if ($entityID <= 0) {
         $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_EMPTY_ENTITY_ID"), "ERROR_EMPTY_ENTITY_ID");
         return false;
     }
     $iCnt = CSocNetEventUserView::GetList(array(), array("ENTITY_TYPE" => $entityType, "ENTITY_ID" => $entityID), array());
     if (intval($iCnt) > 0) {
         return false;
     } else {
         return true;
     }
 }