Google recaptcha v2 all of a sudden will not respond with success - callback

I have Google Recaptcha v2 on 4 different sites. They have been working fine for years (a very long time at least). Dont know when it started as I was just recently informed about it, but all of the Recaptcha's are no longer working.
The response is always the same: "Cannot verify that you are human". In other words, I am no longer getting a successful response.
Nothing has changed in the sites or the code. Could it be that I updated to latest php version? Or did Google change something? Have no idea why they are not working or how to fix.
if(isset($_POST['g-recaptcha-response'])){
$captcha=$_POST['g-recaptcha-response'];
}
if(!$captcha){
include ('./forms/sectionhead.tpl');
echo '<h4 style="color:#c30000;text-align:center;">You must check the reCaptcha form to send this email.</h4>';
include ('./forms/contactform.php');
include ('./forms/contactend.php');
exit;
}
$ip = $_SERVER['REMOTE_ADDR'];
$response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$captcha."&remoteip=".$ip);
$responseKeys = json_decode($response,true);
if(intval($responseKeys["success"]) !== 1) {
echo '<h4 style="color:#c30000;text-align:center;">Sorry, we cannot verify that you are human</h4><br><br>';
} else {
//send email
Any thoughts and help would be greatly appreciated as I am lost ATM
Thanx

THIS IS RIDICULOUS !!!
I had found the issue with allow_url_fopen in another post. And checked that it was on and it was.
/$ grep allow_url_fopen /usr/local/lib/php.ini
allow_url_fopen = On
Rather than ssh, decided to turn on php error reporting through cpanel WHM and in the Multiphp ini editor it said allow_url_fopen DISABLED !!!
WTF !!
Enabled and all working - dont want to even think of the hours wasted on this.
Why ssh says ON and cpanel says OFF ???

Related

issue in fetching yahoo contact list in iOS

yos-social-objc-master
I have also the problem with yos-social-objc-master project i found in github. after login with yahoo credential. I always got a page and a code xxxx with below lines
"To complete sharing of yahoo! info with xxxx, enter code xxxx into xxxx"
So, I am not getting that where I should enter this code? And how will it redirect to my application.
So that I can get contact list. I have done R&D on it. but didnt get any appropriate solution. Please help me out,how can i resolve this issue.
I have found the solution though with a little overheads.
Steps are: 1> Create a PHP script in you own server (say named, YRedirect.php).
2> Pest the following code in it-
<?php
$query = $_SERVER['QUERY_STRING'];
header("Location: YOUR_APP_ID_OR_BUNDLE_ID://oauth-response?" . $query);
?>
3> Add an URL Scheme in your info.plist file with the YOUR_APP_ID_OR_BUNDLE_ID.
That's it and you are DONE with the authentication problem.
And then use YQL to fetch contacts.

Magento registration not completed , $this->_welcomeCustomer($customer) empty

I am getting a problem at the time of account creation in magneto. it starts loading and not redirect on index page but data saved in database and redirect URL is empty when i checked.
Even not send account confirmation mail if required confirmation enabled.
please help and tell me what setting should be done here because it's working on local but not on live.
You might use the custom extension for that registration.
Or, the AccountController might be rewritten by the other module.
Please check it ( \app\code\core\Mage\Customer\controllers\AccountController.php )
createPostAction()
And also, in your site the magento session might not work properly.
OK, i got the solution as in app\code\core\Mage\Customer\controllers\AccountController.php $url = $this->_welcomeCustomer($customer); was empty so i replaced it with $url = Mage::getBaseUrl()."customer/account/index/"; and it's working.

Magento Checkout is stuck on Billing information step

I am new to the magento, and right now, i was working one website.
I did my initial development on my local machine and everything was fine. few days ago I moved the website into test server from my localhost. after that the checkout function is not working properly.
the problem is that i have almost have nothing on that page.
if user is not logged in, then he(she) sees 2 steps as log in, and billing information, but without content. only the titles.
if user is logged in, then he(she) sees step 1 billing information title, and again no content
the website is http://guerrilla.webionaria.com/
user:teste#mail.ru
password:testtest
can anyone help me with this please
There is a 'Fatal error' on your page.
The rendering stops with
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id',
The error appears in app/design/frontend/{interface}/{theme}/template/checkout/onepage/billing.phtml or in app/design/frontend/{interface}/{theme}/template/persistent/checkout/onepage/billing.phtml (if you have cart persistence enabled).
In both of the cases, for some reason this code gives an error:
<?php echo $this->helper('directory')->getRegionJson() ?>
To find out what the error is you need to enable error reporting and display_errors.
You can do that from index.php.
error_reporting(E_ALL | E_STRICT);
...
ini_set('display_errors', 1);
You can also enable the developer mode by changing this:
if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
}
to this
//if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
Mage::setIsDeveloperMode(true);
//}
Then try again. If the error does not appear on your screen look at the source of the page.
If the error does not tell you anything update the question with its contents.
Just installed Magento for the first time on my Localhost. And found the same problem. I found the solution in following way:
-- Enabled the error logs in System > Configuration > Developer Tools
-- Then attempted a checkout.
Bam! found the error in var/logs/system.log
The error was due to SOAP. I needed to enable PHP's soap library. And it proceeded well.
Hope it helps someone :)

Cannot log in to admin after upgrade

I need some help troubleshooting.
I've just upgraded my 1.3 site to 2.0 (with the intent of going on to 2.1). I get the actual page running, content is read from DB etc, but I cannot log in to the admin panel!
Just to make sure I didn't forget the password I did
<?php echo sha1('password' . 'salt'); ?>
Taking the salt from the DB, and the output is the same as is stored in the DB. But still I cannot log in. The log in prompt just reloads, no error message or anything. Any ideas?
I've also tried clearing cache/sessions/etc, and even a different browser to no affect.
Crossposted from the PyroCMS forum: https://www.pyrocms.com/forums/topics/view/19323
OK, since there doesn't seem to be any good suggestions found either here or on the PyroCMS forums and my site is very small content wise I decided to just wipe everything and do a clean install of the latest build instead.
Not a very good solution for future reference, but it will have to do.
From my checklist (it's been a while since I had this happen to me):
If you didn't get an incorrect password error, it may well be you were just being redirected back to the login page before the details were even checked. You can run into issues with enabling the 'Remove index.php from URL' in .htaccess - in /system/cms/config/config.php try changing
$config['index_page'] = 'index.php';
to $config['index_page'] = '';
or (as you've hinted):
clear the contents of default_ci_sessions table
clear the cookies for the domain (a quicker way is to just open a new Google Incognito window which won't have any cookies).
Also - you can initiate a password reset for the admin password using the ordinary user login form if you or someone else does ever forget it (don't though).

IMAP "Invalid Credentials" via GMail XOAUTH

I'm trying to get into the IMAP server with OAuth, using the PHP Sample Code provided by Google which uses the Zend Imap class but I am failing to authenticate. Zend is giving me the error:
Zend_Mail_Storage_Exception [ Error ]: cannot select INBOX, is this a valid transport?
Annoyingly this is a rather confusing error message, for what is essentially "Invalid Credentials". How did I know that? By debugging the actual commands being send to the IMAP socket I see this:
string(44) "NO Invalid credentials ey9if1544983wid.142
"
I have tried with telnet and a Ruby gmail_xoauth gem which suggests it is not a code issue, but something else.
Looking at the most basic level of all this, I am getting commands like this:
TAG1 AUTHENTICATE XOAUTH R0VUIGh0dHBzOi8vbWFpbC5nb29nbGUuY29tL21h......etc
This is where I get NO Invalid credentials then:
TAG2 SELECT "INBOX"
This returns BAD Unknown command and kicks me out.
I have tried searching around for people having the same problem but I find only questions and no answers. There are a few similar StackOverflow questions:
One post shows somebody having the exact same problem in Python.
This post shows somebody trying to be awkward and do it with OAuth 2, with no report of success.
There is a thread on the GMail Google Group that suggests an "Invalid Credentials" error can be resolved by going to https://accounts.google.com/DisplayUnlockCaptcha for GMail accounts and https://www.google.com/a/[YOURDOMAIN.COM]/UnlockCaptcha if you are using Google Apps, but the latter just said that my username and password were wrong when they clearly were not. Using this https://accounts.google.com/DisplayUnlockCaptcha worked fine - even though my account is a hosted App, not plain old GMail - however I still get the same errors when trying to log back in with the PHP sample code provided by Google.
I've tried with various hosted Google App accounts and a plain GMail account. I've tried switching the IMAP server from imap.gmail.com to imap.googlemail.com, nothing makes any difference.
/**
* Make the IMAP connection and send the auth request
*/
$imap = new Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', true);
$authenticateParams = array('XOAUTH', $initClientRequestEncoded);
$imap->requestAndResponse('AUTHENTICATE', $authenticateParams);
/**
* Print the INBOX message count and the subject of all messages
* in the INBOX
*/
$storage = new Zend_Mail_Storage_Imap($imap);
echo '<h1>Total messages: ' . $storage->countMessages() . "</h1>\n";
For those with an interest, this is the specific PHP code that sets up the connection, all XOauth is handled by Google's PHP in the same file but I skipped it.
I had this exact same error, and eventually realised I was using the wrong scope when requesting the OAuth permissions.
You need to have...
scope=https://mail.google.com/
access_type=offline
And also IMAP enabled in your Gmail account obviously. All seems good now.
One problem you may have is that the third parameter of Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', true); should not be true. It should be a string, as either "SSL" or "TLS". I believe you want "SSL" if going over port 993. It's only a boolean when it is FALSE.
Try replacing that first line with this:
$imap = new Zend_Mail_Protocol_Imap('imap.googlemail.com', '993', 'SSL');
When i had this same error message, it was because
$options['consumerSecret'] = $THREE_LEGGED_CONSUMER_SECRET_HMAC;
I was doing that in a function and variable $THREE_LEGGED... wasn't in the scope. Pretty stupid and i'm sure that you'd have spotted that but just in case somebody new is reading that.