Jump to content

Codeigniter Authme PasswordHash.php and PHP7


moshair

Recommended Posts

Hello,

 

I'm using Codeigniter Authme as user login system, I made a test to see if it works on php7, I got this warning

 
A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; PasswordHash has a deprecated constructor

Filename: vendor/PasswordHash.php

Line Number: 27

 

 

PasswordHash.php available at:

 

https://github.com/thewasiullah/CodeIgniter-Authme/tree/master/application/vendor

 

Can any one help me to make it compatible with php7+

 

Regards,

 

Link to comment
Share on other sites

Thank you Jacques1, I don't have a lot knowledge in php classes I modified the PasswordHash.php to be:

class PasswordHash {
    function HashPassword($password)
    {
    return password_hash($password, PASSWORD_DEFAULT);
    }

    function CheckPassword($password, $stored_hash)
    {
    return password_verify($password , $stored_hash );
    }
}

I seems working :), the PHP warning disappeared and I logged in with the same password , do you have any comment or suggestion about the code?

Edited by moshair
Link to comment
Share on other sites

I wouldn't rely on a one-guy-project that was last updated 4 years ago, especially since authentication is kinda critical.

 

If CodeIgniter is any good, there's an official or at least well-established authentication module. Look for that, not random GitHub repositories.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.