protected function deleteStorageTokens() { global $USER; if (is_object($USER) && $USER->IsAuthorized()) { $dbSocservUser = CSocServAuthDB::GetList(array(), array('USER_ID' => $USER->GetID(), "EXTERNAL_AUTH_ID" => static::SERVICE_ID), false, false, array("ID")); while ($accessToken = $dbSocservUser->Fetch()) { CSocServAuthDB::Delete($accessToken['ID']); } } }
} if (is_array($arResult["DB_SOCSERV_USER"])) { foreach ($arResult["DB_SOCSERV_USER"] as $key => $value) { if ($value["EXTERNAL_AUTH_ID"] == 'Twitter') { $arResult["DB_SOCSERV_USER"][$twitNum] = $arResult["DB_SOCSERV_USER"][$key]; unset($arResult["DB_SOCSERV_USER"][$key]); $twitNum++; } } } $arParamsToDelete = array("openid_assoc_handle", "openid_identity", "openid_sreg_email", "openid_sreg_fullname", "openid_sreg_gender", "openid_mode", "openid_op_endpoint", "openid_response_nonce", "openid_return_to", "openid_signed", "openid_sig", "current_fieldset"); $add = CModule::IncludeModule("socialnetwork") && $_REQUEST["auth_service_id"] != '' && $componentTemplate == 'twitpost' ? "current_fieldset=SOCSERV" : ""; if ($_SERVER["REQUEST_METHOD"] == "GET" && $_REQUEST["action"] == "delete" && isset($_REQUEST["user_id"]) && intval($_REQUEST["user_id"] > 0) && check_bitrix_sessid()) { $userId = intval($_REQUEST["user_id"]); if (in_array($userId, $arResult["ALLOW_DELETE_ID"])) { if (!CSocServAuthDB::Delete($userId)) { $_SESSION["LAST_ERROR"] = GetMessage("DELETE_ERROR"); } } $backurl = ''; if ($arResult['BACKURL'] != '') { $backurl = $arResult['BACKURL']; if ($componentTemplate == 'twitpost') { $backurl .= (strpos($arResult['BACKURL'], '?') > 0 ? "&" : "?") . "current_fieldset=SOCSERV"; } } else { $backurl = $APPLICATION->GetCurPageParam($componentTemplate == 'twitpost' ? "current_fieldset=SOCSERV" : "", array("sessid", "user_id", "action")); } LocalRedirect($backurl); } if ($componentTemplate == 'twitpost') {