Файловый менеджер - Редактировать - /var/www/html/components/com_community/templates/jomsocial/layouts/google.button.php
Ðазад
<script type="text/javascript"> (() => { function addOrUpdateUrlParam(uri, paramKey, paramVal) { var re = new RegExp("([?&])" + paramKey + "=[^&#]*", "i"); if (re.test(uri)) { uri = uri.replace(re, '$1' + paramKey + "=" + paramVal); } else { var separator = /\?/.test(uri) ? "&" : "?"; uri = uri + separator + paramKey + "=" + paramVal; } return uri; } function decodeJwtResponse(token) { var base64Url = token.split(".")[1]; var base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/"); var jsonPayload = decodeURIComponent( atob(base64) .split("") .map(function(c) { return "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2); }) .join("") ); return JSON.parse(jsonPayload); } function handleCredentialResponse(response) { const responsePayload = decodeJwtResponse(response.credential); let redirectURI = '<?php use Joomla\CMS\Uri\Uri; echo Uri::root() . 'index.php?option=com_community&view=oauth&task=callback&app=google' ?>'; redirectURI = addOrUpdateUrlParam(redirectURI, 'googleid', responsePayload.sub); redirectURI = addOrUpdateUrlParam(redirectURI, 'googlename', encodeURIComponent(responsePayload.given_name)); redirectURI = addOrUpdateUrlParam(redirectURI, 'googleemail', encodeURIComponent(responsePayload.email)); redirectURI = addOrUpdateUrlParam(redirectURI, 'googlepic', encodeURIComponent(responsePayload.picture)); window.location.href = redirectURI; } window.jomsHandleCredentialResponse = handleCredentialResponse; })() </script> <script src="https://accounts.google.com/gsi/client"></script> <div id="g_id_onload" data-client_id="<?php echo $config->get('googleclientid') ?>" data-context="signin" data-ux_mode="popup" data-callback="jomsHandleCredentialResponse" data-auto_prompt="false" > </div> <div class="g_id_signin" data-type="standard" data-shape="rectangular" data-theme="outline" data-text="signin_with" data-size="medium" data-logo_alignment="left"> </div>
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка