mardi 6 octobre 2015

Laravel 5 - Recover SESSION for PGRFileManager.php

Please, with my PGRFileManager.php (with my ckeditor), The visitors can unfortunately access to file to this adress : http://ift.tt/1MXEcNd

To secure I want to ensure that if it is not a user of my admin, redirect (exit) the visitor ...

At Login I create a new SESSION "usercms" :

<?php
public function postLogin(Request $request)
{
        $login = Auth::attempt([
                                                        'username' => $request->input('username'),
                                                        'password' => $request->input('password')
                                                ], $request->input('remember'));

        if ($login) {
                Session::put('usercms', 'EXISTE');  // CREATE SESSION
                ...
        }
}

        
OK. _But the prolem, in my PGRFileManager.php, with this code :
<?php
session_start();
var_dump($_SESSION['usercms']);

Wamp return this error : "Notice: Undefined index: usercms in C:\wamp\www___Laravel\my-web-site\ckeditor\plugins\pgrfilemanager\PGRFileManager.php on line 4"

What is the solution please? Thank You.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire