Open elite123 opened 9 years ago
I was looking to how to fix same problem. Maybe its not good way but I find a solution.
I added this bottom of the routes.php Now It works.
use Senrty;
if(Sentry::check())
{
\Config::set('elfinder.roots.0.path', Sentry::getUser()->userid);
\Config::set('elfinder.roots.0.alias', Sentry::getUser()->username);
}
Found better way at L5. Create a middleware.
public function handle($request, Closure $next)
{
if(Sentry::check())
{
\Config::set('elfinder.roots.0.path', Sentry::getUser()->userid);
\Config::set('elfinder.roots.0.alias', Sentry::getUser()->username);
}
return $next($request);
}
Then set middleware at config.
'route' => [
'prefix' => 'elfinder',
'middleware' => 'App\Http\Middleware\FileBrowser',
],
Can I ask how can I do same thing without Sentry::class?
I am trying to set a root to the currently logged in user:
/files/1/ - user 1's files /files/2/ - user 2's files
Therefore I tried to override the config in ElfinderController:
However, these config values never get used - is there anyway to get this working or am I taking the wrong approach?