OJS 3 Can't Login

The hosting tech team reset the password for me since I have no idea on
“UPDATE users SET password=SHA1(CONCAT(username,‘newPasswordHere’)) WHERE username=‘usernameHere’;”
I can login until now as admin. However, a new issue comes up. I just try to register with different email. I login but it does not work. It says invalid username or password. How i can solve this?

big hope for a solution on login problem so that I can start using ojs 3 for my journal.

Hi all,

It seems as though the password_compat library, which OJS uses to ensure that the PHP environment supports the password hashing tools OJS needs, is returning 0 for password hashes. This library might log a number of error messages (e.g. Crypt must be loaded for password_hash to function). Can you check to see whether anything like this is logged?

If you’re able, can you try using the same installation in a different hosting/development environment to help establish whether this is related to your platform?

I believe OJS 2.4.x had the same requirements for password hashing, and indeed uses the same code, and we haven’t had reports of this problem arising with OJS 2.4.x – have any of you tried that on the same hosting platform to see whether it behaves the same?

Regards,
Alec Smecher
Public Knowledge Project Team

Where I can check the library?
In my hosting, I have installed ojs 3 twice using different domain. I got same login problem at second installation. If it is same with previous version, then my hosting platform seems to have problem. Beside that, when I open my site and click login, it cannot load perfectly as shown in the attached screenshot below

this is my url http://jurnalbeta.com/index.php/beta
this problem appears recently. After installation, it was normal

Hi @kawahyu,

Could you try installing OJS 2.4.x to see if it behaves as expected?

Regards,
Alec Smecher
Public Knowledge Project Team

Ok, I will try.

Okay so i tried that bit of SQL again, and this time logged in, wasn’t prompted with the GUI version of the password reset. So i was able to logout and log back in successfully. So I guess for now the key for us to resetting passwords will be with the SQL line you provided

Hi @Oneill381,

Given the fact that at least two of you have encountered the same problem, and the password hash of 0 in the database is obviously wrong, I’m wondering if we can track down the problem rather than working around it with a bit of SQL. Can anyone summarize the conditions that led to the password hash being set to 0? I haven’t been able to replicate this locally.

Regards,
Alec Smecher
Public Knowledge Project Team

Dear @asmecher
I have installed OJS 2.4.8.1, http://jurnalbeta.com/index.php/BETA, and registered as user
I can directly login without username and password invalid problem
I installed it on the same hosting as OJS 3

How is this login problem? anyway to resolve this?

Hi all,

I haven’t been able to duplicate the problem locally, so I suspect it’s somehow related to your hosting platform. If anyone can clarify a set of steps that lead to a 0 being stored in the users.password column of the database, I can investigate further.

Regards,
Alec Smecher
Public Knowledge Project Team

Since I am just an editor, I think I need a hint or further reading how to do it. Or anybody in this forum can do a favour for checking the steps

Hi @kawahyu,

Are you able to recreate this problem simply by installing OJS on your hosting provider (i.e. the credentials on the administration form immediately don’t work upon trying to login)? If that’s the case, if you’re willing to provide me temporarily with credentials to access your hosting provider, I could take a look.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi all,

This turned out to be causef by a version of PHP that was too old for the password hashing library we use. Make sure your PHP meets the system requirements in docs/README.

Regards,
Alec Smecher
Public Knowledge Project Team

As @asmecher said, it is about old version of PHP so the registered users cannot login in OJS 3. I have switched my shared hosting platform which supports newer version. No problems for login

Thank you all

Hi @asmecher on the system requirement page on the website, it states that you needs php 5.3.x, we have 5.3.3, and at least MySQL 4.1, we have 5.6.19. Seems like we meet the requirments, so I’m not sure why we would’ve had this issue

Hi @Oneill381,

OJS 3.0 requires specifically PHP 5.3.7 or newer – I’ve updated the download page to reflect that. See also the documentation included in each release, which is more detailed than the download page. It’s available in docs/README.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

We have PHP 5.3.3 installed also. I initially couldn’t login with admin either. I tried resetting the password by clicking “Reset Password” button. I was able to reset password and log in then.

There are tight server dependencies between the PHP version and OS and security packages that we cannot easily upgrade PHP. Are you aware of any other feature that might not work with 5.3.3?

I had upgraded from 2.4.6 to 3.0.1 using an existing database.

Regards
Ghazal

Hi @salehig,

As far as I’m aware, it’s only the password-compat library that’s going to cause problems with PHP < 5.3.7.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello,

I am installing to OJS 3 in a web hosting shared with PHP 5.3, I trying to modify the script to create and validate the user password with the password-compat library.

Somebody knows the path to source code to change it?

Thanks