jeudi 26 janvier 2017

How can I use a Laravel function in my IPS Forum?

So I'm trying to integrate a fresh install of IPS into my Laravel website.

Please note that the forum was installed in a directory inside the public folder of the Laravel website, called forum, and that I am using Laravel 5.4.

Part of this process is making the IPS Forum use the Laravel username/passwords for login.

To do this, I've activated IPS' External Login module and added a third encryption type to External.php called "bcrypt".

My current issue is that I want to be able to use the Laravel Hash::make('password') inside of IPS' External.php....

So I tried to import it like so...

use Illuminate\Support\Facades\Hash;

I then changed the encryptedPassword() function in IPS' external.php to this...

/**
 * Encrypt Password
 *
 * @param   string  $password   The password
 * @return  bool
 */
protected function encryptedPassword( $password )
{
    switch ( $this->settings['db_encryption'] )
    {
        case 'md5':
            return md5( $password );

        case 'sha1':
            return sha1( $password );

        case 'bcrypt':
            return Hash::make( $password );

        default:
            return $password;
    }
}

Which result in me getting this error...

Fatal error: Class 'Illuminate\Support\Facades\Hash' not found in C:\wamp64\www\MainSite\public\forum\system\Login\External.php on line 154

Does anyone know how I can get this working?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire