Resource icon

AJAX File Manager for your Admin Control Panel (XF1) 1.0

No permission to download

RSI

Active member
#21
I went ahead and worked on this again during lunch and completely removing my .htacess file didn't change anything. Neither does changing the public_html folder permissions to 755.

Below is the full error when trying to make it come up in the public_html root folder.
Code:
Error Info
scandir(home/me/public_html): failed to open dir: No such file or directory - library/FileManager/Model/FileManager.php:30

Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'scandir(home/me...', '/home/me/p...', 30, Array)
#1 /home/me/public_html/library/FileManager/Model/FileManager.php(30): scandir('home/me/pu...')
#2 /home/me/public_html/library/FileManager/Model/FileManager.php(21): FileManager_Model_FileManager->subDir('home/me/pu...', 1, 0, '')
#3 /home/me/public_html/library/FileManager/ControllerAdmin/FileManager.php(19): FileManager_Model_FileManager->dirTree()
#4 /home/me/public_html/library/XenForo/FrontController.php(369): FileManager_ControllerAdmin_FileManager->actionIndex()
#5 /home/me/public_html/library/XenForo/FrontController.php(152): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#6 /home/me/public_html/admin.php(13): XenForo_FrontController->run()
#7 {main}

Request State
Array
(
    [url] => https://mydomain.net/admin.php?filemanager/
    [_GET] => Array
        (
            [filemanager/] =>
        )

    [_POST] => Array
        (
        )

)
P.S. I'm also on CloudFare, but I did try pausing it and that didn't do anything either.
.
 
Last edited:

Nerbert

Active member
#22
In your forum's URL what's the folder name following the domain name e.g, my-site.com/forum/threads/some-thread.12345678 ? See what happens with /home/me/forum or whatever? public_html is kind of a generic folder name but it never appears in the URL, somewhere somehow a different name is substituted
 

RSI

Active member
#23
In your forum's URL what's the folder name following the domain name e.g, my-site.com/forum/threads/some-thread.12345678 ? See what happens with /home/me/forum or whatever? public_html is kind of a generic folder name but it never appears in the URL, somewhere somehow a different name is substituted
Ok, I tried that and played around a little and none of that will make it work either. However, I now think if I had another folder within the public_html root location and then had xenforo installed within that other folder that I probably wouldn't be having this problem.

Anyway, I'm not going to change my install into another folder. I don’t want to go through the hassle of running sql queries and cron jobs to update all of the links on my board and in every location and in every post. It's not that difficult, but it's a hassle.

Is there anyway you could create a php file that could be placed in the public_html root location that the add-on could somehow source to solve the problem? Just an idea…
.
 
Last edited:

Nerbert

Active member
#24
I don't like bothering my other admin on matters not pertaining directly to my site but I'll see if he has any insights on this. He's a lot more familiar with overall site set up and management. I have no formal training in programming since the late 1970 when we used punch cards to program mainframes.

Another possibility is tap into the expertise of the scores of people here who would know what the problem is. There's got to be some people here who could help but aren't paying attention to this thread. If you post a thread I'll tell what I know about this. But I'm off to bed for now.
 

Nerbert

Active member
#25
Just noticed something: In the error message it shows "scandir(home/me/public_html)". There must be a slash at the beginning. I tested it without the slash and got an error on my site. But from what you've posted you're using a beginning slash.

So what happened to the slash?

Maybe you could hack in

PHP:
$pattern = "/home/me/public_html";
right after line 17 and see what happens
 

Nerbert

Active member
#26
Lets try this hack in Model/FileManager.php

PHP:
    public function dirTree()
    {
        $xenOptions = XenForo_Application::get('options');
        $path = $_SERVER["SCRIPT_FILENAME"];
        $pattern = $xenOptions->fmPath;
        $pattern = (substr($pattern, -1, 1) == "/") ? substr($pattern, 0, -1) : $pattern ;
        $pattern = ($pattern == "") ? substr($path, 0, strpos($path, "/", 1)) : $pattern ;

$path = realpath("");
echo "path = " . $path . "<BR>";
$path = dirname($path, 1);
echo "path = " . $path . "<BR>";
$pattern = $path;

        $dirTree = "";
        $level = 0;
        $html = "";
        $html = $this->subDir($pattern, 1, $level, "");
        return '<ul id="dir_list">' . $html . '</ul>';
    }
Now you should be able to see what's going on from the info showing at the top of the page;

If this gets you going you can use 2 or 3 for the second arg in dirname() to ascend the directory tree, and then comment out the echos. I'll work on a new version later. I have some other business to attend to right now.

By the way, what server are you using and what version of PHP?
 

Nerbert

Active member
#30
Well, I guess it's not the slash problem. It's frustrating that the error message says no such file or directory and then in the stack trace you see that very directory.

Your error message formatting is different from what I see on my site. What server are you using and what PHP version?

I'm stumped for now but I really want to get this straightened out. I'll have to do some research.
 

Nerbert

Active member
#31
In the error message it already shows the missing slash when it passes the $pattern value to subDir() (#2 in stack trace)

So let's try this hack at the top of subDir():

PHP:
    public function subDir( $pattern, $is_last, $level, $html)
    {
    
$pattern = "/" . $pattern;
$pattern = str_replace("//", "/", $pattern);

     ...........

    }
 

Nerbert

Active member
#33
I PMed my other admin about this. He's at work so I haven't heard back yet. If he can't figure this out I think I'll register at Stack Overflow and inquire there. I'm sure they'll want to know what server you're using so could you see if you can find that? Maybe in your hosting service's literature.

Meanwhile give that latest hack a try.
 

RSI

Active member
#35
Oh, this is interesting. After I went back and read your posts again I tried that last thing one more time. Below are the 2 paths after it timed out. The realpath and dirname are different. The dirname shows the public_html is not there. What does that mean?

path = /home/me/public_html
path = /home/me

Fatal error: Maximum execution time of 30 seconds exceeded in /home/me/public_html/library/FileManager/Model/FileManager.php on line 44
.
 

Nerbert

Active member
#36
dirname just cuts the last folder name off the end. If everything was working the dir tree would show everything in the me folder instead of public_html.

My other admin can't figure this out either. Actually I think it's Russian hackers!

I'm not surrendering yet.
 

RSI

Active member
#37
dirname just cuts the last folder name off the end. If everything was working the dir tree would show everything in the me folder instead of public_html.
Yeah, but the me folder is my account and the add-on wont have any access to it at all. It's my webhosting login username. It's not really me, I changed it just for posting here.

That could be what's wrong. Nothing has any access to me except me, pun intended. To get access to the me folder requires that username and password. Xenforo and this add-on will only have access down to the public_html folder and that's it. Everything down to me will be blocked.

Maybe I'm just missing something here, but if I'm right then is goes back to what I was saying about needing a way for the add-on to login.
.
 
Last edited:

Nerbert

Active member
#38
On my site I can set that to view the dir tree at any level I choose. So you could edit out that dirname() line and try to view public_html. The mystery is still what happens to the slash at the beginning. Get $pattern set to view public_html and try that hack in post #31 and see if that fixes it.
 

RSI

Active member
#39
On my site I can set that to view the dir tree at any level I choose. So you could edit out that dirname() line and try to view public_html. The mystery is still what happens to the slash at the beginning. Get $pattern set to view public_html and try that hack in post #31 and see if that fixes it.
Yeah, but I'm on a shared server with other accounts on it via a web hosting plan. The only way to get into the me directory is to enter that username and password so that's probably what it is. There is no other way to get access to it. It's pretty much the way most linux servers are set up for those web hosting plans on shared servers. It's kinda the norm.

Some people have websites and when they want to add a form later on like when using the xenforo package they will create a subfolder called forum or similar within the public_html root location and install xenforo there. Then they add a forum link or tab on their website's home page within the public_html root that links to xenforo in that subdirectory. With those types of installations I doubt this add-on would have a problem and might work fine because of that extra subfolder.

Then you have people like me where the xenforo package is our website so we don't have that extra subfolder. We just install xenforo directly in the public_html root location. Hope that explains the problem better.

Anyway, I'll try the other hack tonight or tomorrow when I have time and report back again.
.
 

RSI

Active member
#40
I tried all of that other stuff and it still wont work. I think the only way is to give the add-on the ability to login. You would have to add those extra fields in the File Manager Admin settings and figure out how to make it log in. It's probably not that difficult.

Anyway, at this point I'm uninstalling the add-on and if you ever figure out how or via another work around I can try it again later.
.
 
Top