| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/www/cj79373/components/com_community/templates/jomsocial/layouts/ |
Upload File : |
<script type="text/javascript">
var googleUser = {};
var startApp = function() {
gapi.load('auth2', function(){
// Retrieve the singleton for the GoogleAuth library and set up the client.
auth2 = gapi.auth2.init({
client_id: '<?php echo $config->get('googleclientid') ?>',
cookiepolicy: 'single_host_origin',
// Request scopes in addition to 'profile' and 'email'
//scope: 'additional_scope'
});
attachSignin(document.getElementById('btn-google<?php echo $prefix ?>'));
});
};
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 attachSignin(element) {
console.log(element.id);
auth2.attachClickHandler(element, {},
function(googleUser) {
var redirectURI = '<?php echo JURI::root().'index.php?option=com_community&view=oauth&task=callback&app=google' ?>';
redirectURI = addOrUpdateUrlParam(redirectURI, 'googleid', googleUser.getBasicProfile().getId());
redirectURI = addOrUpdateUrlParam(redirectURI, 'googlename', encodeURIComponent(googleUser.getBasicProfile().getName()));
redirectURI = addOrUpdateUrlParam(redirectURI, 'googleemail', encodeURIComponent(googleUser.getBasicProfile().getEmail()));
redirectURI = addOrUpdateUrlParam(redirectURI, 'googlepic', encodeURIComponent(googleUser.getBasicProfile().getImageUrl()));
window.location.href = redirectURI;
}, function(error) {
//console.log(JSON.stringify(error, undefined, 2));
});
}
</script>
<div id="btn-google<?php echo $prefix ?>" class="btn-sign-with-google"><?php echo JText::_('COM_COMMUNITY_SIGN_IN_WITH_GOOGLE') ?></div>
<script type="text/javascript">startApp();</script>