Skip to content

Commit

Permalink
Cherry on the top
Browse files Browse the repository at this point in the history
  • Loading branch information
p0psicles committed Jun 14, 2016
1 parent 2ae13de commit 64a4b64
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions gui/slick/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,10 @@ select .selected {
background-position: -488px 0px;
}

div.g-recaptcha {
visibility: visible!important;
}

/* =======================================================================
config_postProcessing.mako
========================================================================== */
Expand Down
11 changes: 8 additions & 3 deletions gui/slick/js/configProviders.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,23 +575,28 @@ $(document).ready(function(){
return false;
});

$( "#captcha-modal" ).on( "click", function(event) {
if (event.target.value === 'Sign In') {
var gCaptchaResponse = $('textarea#g-recaptcha-response').val();
$("#captcha-modal, #captcha-ok-button").on("click", function(event) {
debugger;
var params = {'provider_id': 'torrentday', captcha: gCaptchaResponse};
var gCaptchaResponse = $('textarea#g-recaptcha-response').val();
if (event.target.value === 'Sign In' || event.target.id === 'captcha-ok-button') {
if (gCaptchaResponse){
var params = {'provider_id': 'torrentday', captcha: gCaptchaResponse};
$.getJSON(srRoot + '/config/providers/getProviderCaptchaCookie', params, function(data){
if (data.error !== undefined) {
alert(data.error);
$('#myModal').modal("hide");
return false;
}

});
}

} else {
//Not the sign in button
return false;
}
$('#myModal').modal("hide");
return false;
})

Expand Down
6 changes: 3 additions & 3 deletions gui/slick/views/config_providers.mako
Original file line number Diff line number Diff line change
Expand Up @@ -812,18 +812,18 @@ $('#config-components').tabs();
</form>
</div>
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" style="width: 750px; margin-left: auto; margin-right:auto; background-color: white;">
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" style="width: 750px; margin-left: auto; margin-right:auto; background-color: white; display: none;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>This is CSS-less representation of your providers login page. <br/>
You might need to authenticate with captcha. If that's the case, you can do it here.<br/>
Make sure you click on the Sign-In button after performing the captcha test.
You don't need to enter your credentials, Medusa already has those!</h3>
</div>
<div id="captcha-modal" class="modal-body">
<div id="captcha-modal" class="modal-body" style="visibility: hidden">
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal">OK</button>
<button id="captcha-ok-button" class="btn" data-dismiss="modal">OK</button>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sickbeard/server/web/config/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def loadReCaptcha(provider_id, url=None, params=None, post_data=None, headers=No
url = provider.urls.get('login')
mysession = make_session()
# captcha_page = provider.get_url(url, post_data=post_data, params=params, verify=False, returns='response')
captcha_page = getURL(url, post_data=post_data, session=mysession, params=params, verify=False, returns='text')
captcha_page = getURL(url, post_data=post_data, session=mysession, params=params, returns='text')
return captcha_page

@staticmethod
Expand Down

0 comments on commit 64a4b64

Please sign in to comment.