Skip to content

Commit

Permalink
Remove Facebook login functionality (closes: #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbohal committed Sep 3, 2020
1 parent a267ec4 commit af51f88
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 133 deletions.
10 changes: 0 additions & 10 deletions application/modules/default/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,11 @@ public function ajaxConsultationAction()
$this->renderScript('_partials/consultationPreviews.phtml');
}

public function facebookAuthenticateAction()
{
$this->webserviceAuthenticate('Service_Webservice_Facebook');
}

public function googleAuthenticateAction()
{
$this->webserviceAuthenticate('Service_Webservice_Google');
}

public function facebookRegisterAction()
{
$this->webserviceRegister('Service_Webservice_Facebook');
}

public function googleRegisterAction()
{
$this->webserviceRegister('Service_Webservice_Google');
Expand Down
14 changes: 0 additions & 14 deletions application/modules/default/views/scripts/_helpers/login.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@
</button>
<?php endif;?>

<?php if (!empty(Zend_Registry::get('systemconfig')->webservice->facebook->appId)): ?>
<div id="fb-root"></div>
<div
class="fb-login-button"
data-max-rows="1"
data-size="large"
data-show-faces="false"
data-auto-logout-link="false"
data-onlogin="facebookAuthenticateCallback"
data-scope="public_profile,email"
data-app-id="<?=Zend_Registry::get('systemconfig')->webservice->facebook->appId;?>"
></div>
<?php endif;?>

<hr class="divider" />

<a href="<?=$this->url(['controller' => 'user', 'action' => 'passwordrecover'], 'default', true);?>">
Expand Down
51 changes: 0 additions & 51 deletions application/services/Webservice/Facebook.php

This file was deleted.

58 changes: 0 additions & 58 deletions assets/front/js/front.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
bindVotingRate();
bindToggleVotingContributionExplanation();
bindAddContribution();
initFB(document, 'script', 'facebook-jssdk');
$('.js-has-password-meter').pwstrength({
'ui': {
'verdicts': [
Expand Down Expand Up @@ -216,25 +215,6 @@
}
};

window.facebookAuthenticateCallback = function() {
return FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
indicateLoginInProgress();
return $.post(baseUrl + '/index/facebook-authenticate', {
token: response['authResponse']['accessToken'],
webserviceLoginCsrf: $('#webserviceLoginCsrf').val()
}, function(data) {
if (data === 'true') {
return location.reload();
} else {
loginProcessEnd();
return $('body').prepend(data);
}
});
}
});
};

window.googleRegisterCallback = function(authResult) {
if (authResult.status.method === 'PROMPT') {
if (authResult['status']['signed_in']) {
Expand All @@ -257,28 +237,6 @@
}
};

window.facebookRegisterCallback = function() {
return FB.getLoginStatus(function(response) {
if (response.status === 'connected') {
indicateLoginInProgress();
return $.post(baseUrl + '/index/facebook-register', {
token: response['authResponse']['accessToken'],
webserviceLoginCsrf: $('#webserviceLoginCsrf').val()
}, function(data) {
var $emailEl, $emailField;
loginProcessEnd();
if (data !== 'false') {
$emailField = $('#email');
$emailField.prop('disabled', true).val(data);
$emailEl = $('<input name="email" type="hidden" />');
$emailEl.val(data);
$emailField.closest('form').append($emailEl);
}
});
}
});
};

indicateLoginInProgress = function() {
showOverlay();
return $('body').prepend($('<div id="loginFlashMessage" class="alert alert-info alert-on-overlay"> <span class="icon-offset glyphicon glyphicon-transfer"></span>' + jsTranslations['message_logging_in'] + '</div>'));
Expand All @@ -299,22 +257,6 @@
return $('body').removeClass('has-overlay');
};

initFB = function(d, s, id) {
var appId, fjs, js;
fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
appId = $('.fb-login-button').data('app-id');
if (!appId || appId === '') {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=" + appId + "&version=v2.0";
return fjs.parentNode.insertBefore(js, fjs);
};

window.initGoogle = function() {
var registerButton = gapi.signin.render('googleRegisterButton', {
'callback': $('#googleRegisterButton').data('callback'),
Expand Down

0 comments on commit af51f88

Please sign in to comment.