Topic-icon SC-Login not working due unkown block of otpcheck.php

Active Subscriptions:

None
8 years 5 months ago - 8 years 5 months ago #57737 by Magick
Hi there,

I tried to solve this on my own, but I got stuck.
I have a 500 internal server error for otpcheck.php when hitting the Login Button.
As it is very similiar to a problem I've got here , I checked Admin Tools (Free) and added
##### Advanced server protection rules exceptions -- BEGIN
RewriteRule ^modules/mod_sclogin/ajax/otpcheck.php$ - [L] 
##### Advanced server protection rules exceptions -- END
to .htaccess.
But this didn't bring the solution, so I tried URLRewrite ON, uninstalled AdminTools, purged the cache, reinstalled SC-Login.
Still not working. Still Error 500.
As far as I know I don't have any Firewall active.
Possibly a Template update which I made after upgrading to J! 3.5 is a problem, probably a jQuery Conflict although nothing shows up in Firebug or Firefox and Chrome Dev Tools.
Maybe some of you can figure out the issue.
zoner-hq.de
fichtehaus.com
Last edit: 8 years 5 months ago by Magick.
The topic has been locked.
Support Specialist
If you go to:
<Your-domain>/modules/mod_sclogin/ajax/otpcheck.php
You'll see the following error message:

Error displaying the error page: Application Instantiation Error: Could not connect to MySQL.

I've never seen that message appear before. That file basically tries to load Joomla up and do a database query (when called from our Javascript). That error means that the normal configuration.php file can't be found or there's some other unique directory structure change on your site that other sites don't have.

Is there something unique about your filesystem, Joomla configuration or anything else you can let us know about? That will help us understand what the issue may be.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 5 months ago - 8 years 5 months ago #57752 by Magick
Not that I'm aware of. :(
The configuration.php is in root, they have the password and secret stored.
zoner-hq.de running PHP 5.6, fichtehaus.com on PHP 7.

If necessary I would give you an admin or FTP acc to check yourself.

edit: I have this MySQL-Error also on a functioning installation. *shrug*
Last edit: 8 years 5 months ago by Magick.
The topic has been locked.
Support Specialist
If you can Private Message admin credentials for your site along with FTP credentials, we'll gladly investigate further. You can PM me by clicking the mail icon under my name to the left.

edit: I have this MySQL-Error also on a functioning installation. *shrug*

Can you clarify what you mean here? What's functioning and what isn't?

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 5 months ago #57765 by Magick

alzander wrote:

edit: I have this MySQL-Error also on a functioning installation. *shrug*

Can you clarify what you mean here? What's functioning and what isn't?

Thanks,
Alex


Sure. I meant, that I'm using SC Login on another webpage which has the same error when I try to go to otpcheck.php directly, but on this page it seemed to work. I checked it now with multiple accounts and...it's the same issue. I was wrong. Creds coming in soon.
The topic has been locked.
Support Specialist
Whew... after a lot of debugging, we think we have a solution. There was a very subtle change in Joomla 3.5 that's causing this problem. On your .de site, I've already implemented the change. Please test there if it seems to work.

For your other site(s), the change is really easy and I'd love to hear your feedback. To make the change, open the modules/mod_sclogin/ajax/otpcheck.php file. Around line 24, you'll see:
ini_set('display_errors', 0);
Directly after that line, add the following:
require_once JPATH_BASE . '/includes/framework.php';

Let us know how that goes. We'll continue testing and are looking to add this into the next release.

Thanks,
Alex
The topic has been locked.
Support Specialist
Actually, as quickly as I posted that, we found a much better solution. Instead of the replacement line I noted above, please use:
require_once JPATH_CONFIGURATION . '/configuration.php';
Test that and let us know how it goes.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 5 months ago - 8 years 5 months ago #57775 by Magick
Thanks a lot!
Seems that this will be in the next patch :)
Glad I could sort out that bug.

On zoner-hq.de and another website I got:
mod_sclogin.js:38 Uncaught TypeError: jfbcJQuery(...)[0].clone is not a function
mod_sclogin.js:38 Uncaught TypeError: jfbcJQuery(...)[0].clone is not a function

I've reinstalled SC_Login 4.5.3, tweaked the PHP-File again and on the other website it worked after that.

But on zoner-hq.de I still had this error.
I've tried with the SC jQuery and without and the very same mod_ Settings from the functioning websites. Without luck.
I used this tweak out of curiosity and it worked.

On fichtehaus.com it works flawlessly right on the first try.
Therefore I revoked your credentials for fichtehaus.com.
But you still can login on zoner-hq.de, if you want to check the error yourself.
Last edit: 8 years 5 months ago by Magick.
The topic has been locked.
Support Specialist
So the tweak you tried worked on zoner-hq? Can you tell me specifically what you changed? In the thread, there are a few different posts with minor changes.. want to make sure I know the right one.

Either way, if I'm reading correctly, you have things working now. The change I noted above will be in the next release. We'll have to investigate the tweak you did to determine if it's the right thing to do for all sites.

Thanks for your patience, and glad things are going for you!

Alex
The topic has been locked.
Active Subscriptions:

None
8 years 5 months ago - 8 years 5 months ago #57777 by Magick
Yes, you read right. Everything is working now as excpected. :)


I've used this code and replaced the original in media/sourcecoast/js/mod_sclogin.js with it completly.
// Copy the username/password fields
var usernameField = jfbcJQuery(formId + ' :input[name=username]').clone();
usernameField.val = username;
usernameFieldHTML = '<input type=\"hidden\" name=\"username\" value=\"' + usernameField.val + '\"\>';
jfbcJQuery(otpForm).find("form").append(usernameFieldHTML);

var passwordField = jfbcJQuery(formId + ' :input[name=password]').clone();
passwordField.val = password;
passwordFieldHTML = '<input type=\"hidden\" name=\"password\" value=\"' + passwordField.val + '\"\>';
jfbcJQuery(otpForm).find("form").append(passwordFieldHTML);

I really don't know why only zoner-hq needed this additional change and not the two other sites.
If you need any further information please let me know. :)
Last edit: 8 years 5 months ago by Magick.
The topic has been locked.