if (StrLen($errorMessage) <= 0) { $errorMessage .= str_replace("#RELATION_ID#", $arRelation["ID"], GetMessage("SONET_GRE_CANT_DELETE_INVITATION")); } } } $APPLICATION->ThrowException($errorMessage, "ERROR_DELETE_RELATION"); } } } if (strlen($errorMessage) > 0) { $arResult["ErrorMessage"] = $errorMessage; } } elseif (CModule::IncludeModule('extranet') && in_array(CExtranet::GetExtranetSiteID(), $arGroupSites) && intval($_REQUEST["invite_user_id"]) > 0 && check_bitrix_sessid() && CModule::IncludeModule('intranet')) { $rsInvitedUser = CUser::GetByID(intval($_REQUEST["invite_user_id"])); if (($arInvitedUser = $rsInvitedUser->Fetch()) && (!is_array($arInvitedUser["UF_DEPARTMENT"]) || intval($arInvitedUser["UF_DEPARTMENT"][0]) <= 0) && strlen($arInvitedUser["LAST_LOGIN"]) <= 0 && strlen($arInvitedUser["LAST_ACTIVITY_DATE"]) <= 0) { CIntranetInviteDialog::ReinviteUser(SITE_ID, $arInvitedUser["ID"]); LocalRedirect($APPLICATION->GetCurPageParam("invite_sent=Y", array("invite_user_id", "employee"))); } } $arNavParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bDescPageNumbering" => false); $parser = new CSocNetTextParser(LANGUAGE_ID, $arParams["PATH_TO_SMILE"]); $arResult["Requests"] = false; $dbRequests = CSocNetUserToGroup::GetList(array("DATE_CREATE" => "ASC"), array("GROUP_ID" => $arResult["Group"]["ID"], "ROLE" => SONET_ROLES_REQUEST, "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER), false, $arNavParams, array("ID", "USER_ID", "DATE_CREATE", "DATE_UPDATE", "MESSAGE", "USER_NAME", "USER_LAST_NAME", "USER_SECOND_NAME", "USER_LOGIN", "USER_PERSONAL_PHOTO", "USER_PERSONAL_GENDER")); if ($dbRequests) { $arResult["Requests"] = array(); $arResult["Requests"]["List"] = false; while ($arRequests = $dbRequests->GetNext()) { if ($arResult["Requests"]["List"] == false) { $arResult["Requests"]["List"] = array(); } $pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arRequests["USER_ID"]));
$strError = GetMessage("BX24_INVITE_DIALOG_ERROR_EXTRANET_NO_SONET_GROUP_INVITE"); } if (!$strError) { $ID_INVITED = CIntranetInviteDialog::RegisterNewUser($SITE_ID, $_POST, $arError); if (is_array($arError) && count($arError) > 0) { $strError = ""; $ID_INVITED = 0; foreach ($arError as $strErrorText) { if (strlen($strErrorText) > 0) { $strError .= '<li style="list-style-position: inside;">' . $strErrorText . '</li>'; } } } } } elseif (preg_match("/^reinvite_user_id_(\\d+)\$/", $_REQUEST["reinvite"], $match)) { CIntranetInviteDialog::ReinviteUser($SITE_ID, $match[1]); require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_js.php"; } elseif (preg_match("/^reinvite_user_id_extranet_(\\d+)\$/", $_REQUEST["reinvite"], $match)) { CIntranetInviteDialog::ReinviteExtranetUser($SITE_ID, $match[1]); require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_js.php"; } elseif ($strAction == "add") { if (intval($_POST["DEPARTMENT_ID"]) <= 0 && (!isset($_POST["SONET_GROUPS_CODE"]) || empty($_POST["SONET_GROUPS_CODE"])) && $bExtranetInstalled) { $strError = GetMessage("BX24_INVITE_DIALOG_ERROR_EXTRANET_NO_SONET_GROUP_ADD"); } if ($bMailInstalled) { if (isset($_POST["ADD_MAILBOX_PASSWORD"]) && $_POST['ADD_MAILBOX_PASSWORD'] != $_POST['ADD_MAILBOX_PASSWORD_CONFIRM']) { $strError = $MESS["BX24_INVITE_DIALOG_WARNING_CREATE_MAILBOX_ERROR"] . " " . GetMessage("BX24_INVITE_DIALOG_WARNING_MAILBOX_PASSWORD_CONFIRM"); } else { require_once $_SERVER['DOCUMENT_ROOT'] . "/bitrix/components/bitrix/intranet.mail.setup/helper.php"; if (isset($_POST["ADD_MAILBOX_ACTION"]) && $_POST["ADD_MAILBOX_ACTION"] == "create") { $arMailboxResult = CIntranetMailSetupHelper::createMailbox(false, false, $_POST['ADD_MAILBOX_SERVICE'], $_POST['ADD_MAILBOX_DOMAIN'], $_POST['ADD_MAILBOX_USER'], $_POST['ADD_MAILBOX_PASSWORD'], $strError);