2if(!
$USER->CanDoOperation(
'edit_other_settings'))
15$GLOBALS[
"APPLICATION"]->SetAdditionalCSS(
"/bitrix/js/socialservices/css/ss.css");
35 array(
"DIV" =>
"edit1",
"TAB" =>
GetMessage(
"MAIN_TAB_SET"),
"ICON" =>
"",
37 array(
"DIV" =>
"edit2",
"TAB" =>
GetMessage(
"MAIN_TAB_6"),
"ICON" =>
"",
39 array(
"DIV" =>
"edit3",
"TAB" =>
GetMessage(
"SOC_OPT_CRYPTO_TAB_TITLE"),
"ICON" =>
"",
40 "TITLE" =>
GetMessage(
"SOC_OPT_CRYPTO_TAB_DESCR")),
47 LocalRedirect(
$APPLICATION->GetCurPage().
"?mid=".urlencode(
$module_id).
"&lang=".urlencode(LANGUAGE_ID).
"&back_url_settings=".urlencode(
$_REQUEST[
"back_url_settings"]).
"&".
$tabControl->ActiveTabParam().($_REQUEST[
"siteTabControl_active_tab"] <>
''?
"&siteTabControl_active_tab=".urlencode(
$_REQUEST[
"siteTabControl_active_tab"]):
''));
52 if($_POST[
"RestoreDefaults"] <>
'')
58 COption::SetOptionString(
"socialservices",
"use_on_sites", serialize($_POST[
"use_on_sites"]));
59 CAgent::RemoveModuleAgents(
"socialservices");
60 CAgent::AddAgent(
"CSocServAuthManager::SendSocialservicesMessages();",
"socialservices",
"N", 100,
"",
"Y",
"");
61 CAgent::AddAgent(
"CSocServMessage::CleanUp();",
"socialservices",
"N", 86400,
"",
"Y",
"");
64 $suffix = (
$site <> ''?
'_bx_site_'.$site:
'');
67 COption::SetOptionString(
"socialservices",
"auth_services".$suffix, serialize($_POST[
"AUTH_SERVICES".$suffix]));
68 COption::SetOptionString(
"socialservices",
"twitter_search_hash".$suffix, $_POST[
"twitter_search_hash".$suffix]);
75 if(
$option[3][0] ==
'statictext')
84 $sendTwit = $allowSendActivity =
'N';
86 if($_POST[
"allow_send_user_activity"] ==
'Y')
87 $allowSendActivity =
'Y';
88 COption::SetOptionString(
"socialservices",
"allow_send_user_activity", $allowSendActivity);
93 if(isset(
$_REQUEST[
"allow_registration"]))
95 COption::SetOptionString(
"socialservices",
"allow_registration",
$_REQUEST[
"allow_registration"] ==
"N" ?
"N" :
"Y");
100 if($_POST[
"Apply"] <>
'' || $_POST[
"RestoreDefaults"] <>
'')
101 LocalRedirect(
$APPLICATION->GetCurPage().
"?mid=".urlencode(
$module_id).
"&lang=".urlencode(LANGUAGE_ID).
"&back_url_settings=".urlencode(
$_REQUEST[
"back_url_settings"]).
"&".
$tabControl->ActiveTabParam().($_REQUEST[
"siteTabControl_active_tab"] <>
''?
"&siteTabControl_active_tab=".urlencode(
$_REQUEST[
"siteTabControl_active_tab"]):
''));
115 var table = BX.findParent(a, {
'tag':
'table'});
116 var index = BX.findParent(a, {
'tag':
'tr'}).rowIndex;
119 table.rows[index].parentNode.insertBefore(table.rows[index], table.rows[index-1]);
122function MoveRowDown(a)
124 var table = BX.findParent(a, {
'tag':
'table'});
125 var index = BX.findParent(a, {
'tag':
'tr'}).rowIndex;
126 if(index == table.rows.length-1)
128 table.rows[index].parentNode.insertBefore(table.rows[index+1], table.rows[index]);
132window.networkRegister = (
function(){
137 if(BX.type.isString(s))
141 BX.ajax.loadJSON(
'/bitrix/tools/oauth/socserv.ajax.php', {
142 action:
'registernetwork',
144 sessid: BX.bitrix_sessid()
152 BX(
'b24net_out').innerHTML =
'';
153 BX.adjust(BX(
'b24net_out'), {
155 BX.create(
'DIV', {html:
'<?=GetMessageJS('SOC_OPT_B24NET_CLIENT_ID
');?>: <b>' + BX.util.htmlspecialchars(res.client_id) +
'</b><br /><?=GetMessageJS('SOC_OPT_B24NET_CLIENT_SECRET
');?>: <b>' + BX.util.htmlspecialchars(res.client_secret) +
'</b><br ><br />'}),
157 attrs: {type:
"button",value:
'<?=GetMessageJS('SOC_OPT_B24NET_PUT
');?>'},
161 networkRegister(res);
168 BX.show(BX(
'b24net_out'));
169 BX.hide(BX(
'b24net_in'));
173 else if(!!s && !!s.client_id)
175 var currentSite = document.forms[
'socserv_settings'].siteTabControl_active_tab.value;
177 currentSite = currentSite ==
"opt_common" ?
"" : currentSite.replace(
"opt_",
"_bx_");
179 if(!document.forms.socserv_settings[
'bitrix24net_domain' + currentSite])
181 document.forms.socserv_settings.appendChild(BX.create(
'input', {attrs: {
183 'name':
'bitrix24net_domain' + currentSite
186 var el = document.forms.socserv_settings[
'bitrix24net_id' + currentSite];
188 BX.findPreviousSibling(el.parentNode.parentNode).cells[1].innerHTML = BX.util.htmlspecialchars(domainUrl);
191 document.forms.socserv_settings[
'bitrix24net_id' + currentSite].value = s.client_id;
192 document.forms.socserv_settings[
'bitrix24net_secret' + currentSite].value = s.client_secret;
193 document.forms.socserv_settings[
'bitrix24net_domain' + currentSite].value = domainUrl;
195 BX(
'AUTH_SERVICES'+currentSite+
'Bitrix24Net').checked =
true;
197 BX.focus(document.forms.socserv_settings[
'bitrix24net_id' + currentSite]);
205 p =
new BX.PopupWindow(
"socservB24NetPopup",
null, {
210 titleBar: {content: BX.create(
'SPAN', {text:
'<?=GetMessageJS('SOC_OPT_B24NET_TITLE_MSGVER_1
')?>'})},
211 content: BX.create(
'DIV', {
217 html:
'<div id="b24net_in"><?=GetMessageJS('SOC_OPT_B24NET_SITE
')?><br /><br /><input type="text" id="b24net_url" value="' +
218 BX.util.htmlspecialchars(window.location.protocol+
'//'+window.location.host) +
219 '" style="width: 400px" /><br /><br />' +
220 '<input type="button" onclick="networkRegister(BX(\'b24net_url\').value)" value="<?=GetMessageJS('SOC_OPT_B24NET_GET
')?>">' +
221 '</div><div id="b24net_out" style="display: none"></div>'
227 BX.hide(BX(
'b24net_out'));
228 BX.show(BX(
'b24net_in'));
234 BX.focus(BX(
'b24net_url'));
243BX.ready(
function(){networkRegister()});
249<form method=
"post" name=
"socserv_settings" action=
"<?echo $APPLICATION->GetCurPage()?>?mid=<?=urlencode($module_id)?>&lang=<?=urlencode(LANGUAGE_ID)?>">
254<tr><td colspan=
"2" style=
"padding-bottom: 20px;">
256$aSiteTabs =
array(
array(
"DIV" =>
"opt_common",
"TAB" =>
GetMessage(
"socserv_sett_common"),
'TITLE' =>
GetMessage(
"socserv_sett_common_title"),
'ONSELECT'=>
"document.forms['socserv_settings'].siteTabControl_active_tab.value='opt_common'"));
258 $aSiteTabs[] =
array(
"DIV" =>
"opt_site_".$arSite[
"ID"],
"TAB" =>
'['.$arSite[
"ID"].
'] '.
htmlspecialcharsbx($arSite[
"NAME"]),
'TITLE' =>
GetMessage(
"socserv_sett_site").
' ['.$arSite[
"ID"].
'] '.
htmlspecialcharsbx($arSite[
"NAME"]),
'ONSELECT'=>
"document.forms['socserv_settings'].siteTabControl_active_tab.value='opt_site_".$arSite[
"ID"].
"'");
264$arUseOnSites = unserialize(COption::GetOptionString(
"socialservices",
"use_on_sites",
""), [
"allowed_classes" =>
false]);
267 $suffix = (
$site <> ''?
'_bx_site_'.$site:
'');
268 $hash = COption::GetOptionString(
"socialservices",
"twitter_search_hash".$suffix,
"#b24");
273<table cellpadding=
"0" cellspacing=
"0" border=
"0" width=
"100%" class=
"edit-table">
275 <td
width=
"50%" class=
"field-name"><label
for=
"use_on_sites<?=$suffix?>"><?echo
GetMessage(
"socserv_sett_site_apply")?></td>
277 <input type=
"hidden" name=
"use_on_sites[<?=htmlspecialcharsbx($site)?>]" value=
"N">
278 <input type=
"checkbox" name=
"use_on_sites[<?=htmlspecialcharsbx($site)?>]" value=
"Y"<?
if(
$arUseOnSites[
$site] ==
"Y") echo
' checked'?>
id=
"use_on_sites<?=$suffix?>" onclick=
"BX('site_settings<?=$suffix?>').style.display=(this.checked? '':'none');">
283<table cellpadding=
"0" cellspacing=
"0" border=
"0" class=
"edit-table" width=
"100%" id=
"site_settings<?=$suffix?>"<?
if(
$site <> '' &&
$arUseOnSites[
$site] <>
"Y") echo
' style="display:none"';?>>
287 <td> <?=
GetMessage(
"soc_serv_send_activity");?> </td><td>
288 <input type=
"checkbox" name=
"allow_send_user_activity" id=
"allow_send_user_activity" value=
"Y"
289 <?
if(COption::GetOptionString(
"socialservices",
"allow_send_user_activity",
"N") ==
'Y') echo
" checked";
elseif(COption::GetOptionString(
"socialservices",
"allow_send_user_activity",
false) ===
false) echo
" checked";?>>
295 <td colspan=
"2"><?=
GetMessage(
"soc_serv_opt_list_title")?></td>
300 <td
width=
"50%" class=
"field-name"><?echo
GetMessage(
"soc_serv_opt_list")?></td>
302 <table cellpadding=
"0" style=
"width:45%;" cellspacing=
"3" border=
"0" width=
"" class=
"padding-0">
305 if (!ModuleManager::isModuleInstalled('bitrix24') && Loader::includeModule('intranet'))
307 $portalPrefix = \CIntranetUtils::getPortalZone();
312 $allowedServices = [];
313 foreach($arServices as $id=>
$service)
324 foreach($allowedServices as $id=>
$service):
327 <td
style=
"padding-top: 3px;">
328 <input type=
"hidden" name=
"AUTH_SERVICES<?=$suffix?>[<?=htmlspecialcharsbx($id)?>]" value=
"N">
329 <input type=
"checkbox" name=
"AUTH_SERVICES<?=$suffix?>[<?=htmlspecialcharsbx($id)?>]"
330 id=
"AUTH_SERVICES<?=$suffix?><?=htmlspecialcharsbx($id)?>"
332 <?
if(isset(
$service[
"__active"]) &&
$service[
"__active"] ==
true) echo
" checked"?>
333 <?
if(isset(
$service[
"DISABLED"]) &&
$service[
"DISABLED"] ==
true) echo
" disabled"?>>
335 <td><div
class=
"bx-ss-icon <?=htmlspecialcharsbx($service["ICON
"])?>"></div></td>
338 <td><a href=
"javascript:void(0)" onclick=
"MoveRowUp(this)"><img src=
"/bitrix/images/socialservices/up.gif" width=
"16" height=
"16" alt=
"<?echo GetMessage("soc_serv_opt_up
")?>" border=
"0"></a></td>
339 <td><a href=
"javascript:void(0)" onclick=
"MoveRowDown(this)"><img src=
"/bitrix/images/socialservices/down.gif" width=
"16" height=
"16" alt=
"<?echo GetMessage("soc_serv_opt_down
")?>" border=
"0"></a></td>
348 foreach($allowedServices as $id =>
$service)
370 $option[
'note'] =
'<div style="text-align: left; ">' .
$option[
'note'] .
'</div>';
388while(
$zr =
$z->Fetch())
391 $ar[
"ID"] = intval(
$zr[
"ID"]);
399 <td><?echo
GetMessage(
"SOC_OPT_MAIN_REG")?>: </td>
402if (COption::GetOptionString(
"main",
"new_user_registration",
"N") ==
"Y"):
404 <span
style=
"color: green;"><?echo
GetMessage(
"SOC_OPT_MAIN_REG_Y")?></span>
408 <span
style=
"color: red;"><?echo
GetMessage(
"SOC_OPT_MAIN_REG_N")?></span>
415 <td><label
for=
"allow_registration"><?echo
GetMessage(
"SOC_OPT_SOC_REG")?>: </label></td>
417 <input type=
"hidden" name=
"allow_registration" value=
"N" />
418 <input type=
"checkbox" name=
"allow_registration" id=
"allow_registration" value=
"Y"<?=
$allowAuthorization ?
' checked="checked"' :
''?> />
422 <td
class=
"adm-detail-valign-top"><?echo
GetMessage(
"SOC_OPT_MAIN_DENY_AUTH")?>: </td>
424 <
select name=
"group_deny_auth[]" size=
"5" multiple=
"multiple">
426foreach(
$groups as $groupId => $groupTitle)
429 <option value=
"<?=$groupId?>"<?=in_array($groupId,
430 $groupDenyAuth)?
' selected="selected"' :
''?>><?=Converter::getHtmlConverter()->encode($groupTitle)?></option>
438 <td
class=
"adm-detail-valign-top"><?echo
GetMessage(
"SOC_OPT_MAIN_DENY_SPLIT")?>: </td>
440 <
select name=
"group_deny_split[]" size=
"5" multiple=
"multiple">
442foreach(
$groups as $groupId => $groupTitle)
445 <option value=
"<?=$groupId?>"<?=in_array($groupId,
446 $groupDenySplit)?
' selected="selected"' :
''?>><?=Converter::getHtmlConverter()->encode($groupTitle)?></option>
463 if (COption::GetOptionString(
"socialservices",
"allow_encrypted_tokens",
false))
472 if (\
Bitrix\Main\Entity\CryptoField::cryptoAvailable())
476 <input type=
"submit" value=
"<?=GetMessage('SOC_OPT_CRYPTO_ACTIVATE')?>" name=
"activate_crypto_tokens" class=
"adm-btn-green" onclick=
"return confirmTokensEncryption()" />
481 function confirmTokensEncryption()
483 return (confirm(
'<?=GetMessageJS('SOC_OPT_CRYPTO_CONFIRM
')?>'));
501 <input type=
"hidden" name=
"siteTabControl_active_tab" value=
"<?=htmlspecialcharsbx($_REQUEST["siteTabControl_active_tab
"])?>">
502<?
if(
$_REQUEST[
"back_url_settings"] <>
''):?>
503 <input type=
"submit" name=
"Update" value=
"<?=GetMessage("MAIN_SAVE
")?>" title=
"<?=GetMessage("MAIN_OPT_SAVE_TITLE
")?>">
505 <input type=
"submit" name=
"Apply" value=
"<?=GetMessage("MAIN_OPT_APPLY
")?>" title=
"<?=GetMessage("MAIN_OPT_APPLY_TITLE
")?>">
506<?
if(
$_REQUEST[
"back_url_settings"] <>
''):?>
507 <input type=
"button" name=
"Cancel" value=
"<?=GetMessage("MAIN_OPT_CANCEL
")?>" title=
"<?=GetMessage("MAIN_OPT_CANCEL_TITLE
")?>" onclick=
"window.location='<?echo htmlspecialcharsbx(CUtil::addslashes($_REQUEST["back_url_settings
"]))?>'">
508 <input type=
"hidden" name=
"back_url_settings" value=
"<?=htmlspecialcharsbx($_REQUEST["back_url_settings
"])?>">
510 <input type=
"submit" name=
"RestoreDefaults" title=
"<?echo GetMessage("MAIN_HINT_RESTORE_DEFAULTS
")?>" onclick=
"return confirm('<?echo AddSlashes(GetMessage("MAIN_HINT_RESTORE_DEFAULTS_WARNING
"))?>')" value=
"<?echo GetMessage("MAIN_RESTORE_DEFAULTS
")?>">
static GetList($by='c_sort', $order='asc', $arFilter=[], $SHOW_USERS_AMOUNT="N")
static setGroupsDenyAuth($value)
static setGroupsDenySplit($value)
static getGroupsDenySplit()
static getGroupsDenyAuth()
static listServicesBlockedByZone(string $zone)
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
bitrix_sessid_post($varname='sessid', $returnInvocations=false)
check_bitrix_sessid($varname='sessid')
IsModuleInstalled($module_id)
ShowError($strError, $cls="errortext")
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
ShowNote($strNote, $cls="notetext")
LocalRedirect($url, $skip_security_check=false, $status="302 Found")
global_menu_<?echo $menu["menu_id"]?> adm main menu item icon adm main menu item text text adm main menu hover adm submenu menucontainer menu_id menu_id items_id items_id desktop menu_id block none adm global submenu<?=($subMenuDisplay=="block" ? " adm-global-submenu-active" :"")?> global_submenu_<?echo $menu["menu_id"]?> text MAIN_PR_ADMIN_FAV items adm submenu items wrap adm submenu items stretch wrap BX adminMenu itemsStretchScroll()"> <table class if (!empty( $menu["items"])) elseif ( $menu[ 'menu_id']=='desktop') if ( $menu[ 'menu_id']=='desktop') endforeach
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
while($arSite=$dbSites->Fetch()) $oAuthManager
$GLOBALS['_____370096793']