Skip to content

Path problem on shared server  #10

@tolbaruvalentin

Description

@tolbaruvalentin

Ok, your file manager is great and is working fine on localhost , but on server I don't know what is the problem :(

My shared tree from the server in the image below

http://cleverideas.ro/serverarhitecture.jpg

I get this error The directory / does not exist.

The problem is in default.config.php
This line of code :

$folderPath = $app->basePath() . '/public/filemanager/userfiles/';

The code frome default.config.php

`<?php
/**

  • Filemanager PHP connector
  • This file should at least declare auth() function
  • and instantiate the Filemanager as '$fm'
  • IMPORTANT : by default Read and Write access is granted to everyone
  • Copy/paste this file to 'user.config.php' file to implement your own auth() function
  • to grant access to wanted users only
  • filemanager.php
  • use for ckeditor filemanager

// Laravel init
require getcwd() . '/../../../../laravel/bootstrap/autoload.php';
$app = require_once getcwd() . '/../../../../laravel/bootstrap/app.php';

$kernel = $app->make('Illuminate\Contracts\Http\Kernel');

$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);

$id = $app['encrypter']->decrypt($_COOKIE[$app['config']['session.cookie']]);
$app['session']->driver()->setId($id);
$app['session']->driver()->start();

// Folder path
$folderPath = $app->basePath() . '/public_html/filemanager/userfiles/';

// Check if user in authentified
if(!$app['auth']->check())
{
$laravelAuth = false;
}
else
{
// Check if user has all access
if($app['auth']->user()->accessMediasAll())
{
$laravelAuth = true;
}
elseif(method_exists($app['auth']->user(), 'accessMediasFolder'))
{
// Check if user has access to one folder
if($app['auth']->user()->accessMediasFolder())
{
// Folder name with user id
$folderPath .= 'user' . $app['auth']->id();
// Create folder if doesn't exist
if (!is_dir($folderPath))
{
mkdir($folderPath);
}
$laravelAuth = true;
}
else
{
$laravelAuth = false;
}
}
else
{
$laravelAuth = false;
}
}

/**

  • Check if user is authorized
  • @return boolean true if access granted, false if no access
    */
    function auth()
    {
    return $GLOBALS['laravelAuth'];
    }

$fm = new Filemanager();

$fm->setFileRoot($folderPath);

?>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions