public static function getAll() { global $lC_Language; if (!defined('LC_ADMIN_FILE_MANAGER_ROOT_PATH')) { define('LC_ADMIN_FILE_MANAGER_ROOT_PATH', substr(DIR_FS_CATALOG, 0, -1)); } $media = $_GET['media']; $goto_array = array(array('id' => '', 'text' => $lC_Language->get('top_level'))); if ($_SESSION['fm_directory'] != LC_ADMIN_FILE_MANAGER_ROOT_PATH) { $path_array = explode('/', substr($_SESSION['fm_directory'], strlen(LC_ADMIN_FILE_MANAGER_ROOT_PATH) + 1)); foreach ($path_array as $value) { if (sizeof($goto_array) < 2) { $goto_array[] = array('id' => $value, 'text' => $value); } else { $parent = end($goto_array); $goto_array[] = array('id' => $parent['id'] . '/' . $value, 'text' => $parent['id'] . '/' . $value); } } } $lC_DirectoryListing = new lC_DirectoryListing($_SESSION['fm_directory']); $lC_DirectoryListing->setStats(true); $result = array('aaData' => array()); if ($_SESSION['fm_directory'] != LC_ADMIN_FILE_MANAGER_ROOT_PATH) { $files = '<td>' . lc_link_object(lc_href_link_admin(FILENAME_DEFAULT, 'file_manager&goto=' . $goto_array[sizeof($goto_array) - 2]['id']), '<span class="icon-up-fat icon-blue"> ' . $lC_Language->get('parent_level')) . '</td>'; $result['aaData'][] = array("{$files}", "", "", "", "", "", "", ""); } $cnt = 0; foreach ($lC_DirectoryListing->getFiles() as $file) { $file_owner = posix_getpwuid($file['user_id']); $group_owner = posix_getgrgid($file['group_id']); if ($file['is_directory'] === true) { $entry_url = lc_href_link_admin(FILENAME_DEFAULT, 'file_manager&directory=' . $file['name']); $files = '<td>' . lc_link_object($entry_url, '<span class="icon-folder icon-orange"> ' . $file['name']) . '</td>'; } else { $entry_url = lc_href_link_admin(FILENAME_DEFAULT, 'file_manager&entry=' . $file['name'] . '&action=save'); $files = '<td><a href="javascript:void(0);" onclick="editEntry(\'' . $file['name'] . '\')">' . '<span class="icon-page-list icon-blue"> ' . $file['name'] . '</a></td>'; } $size = '<td>' . number_format($file['size']) . '</td>'; $perms = '<td>' . lc_get_file_permissions($file['permissions']) . '</td>'; $user = '******' . $file_owner['name'] . '</td>'; $group = '<td>' . $group_owner['name'] . '</td>'; $write = '<td>' . is_writable($lC_DirectoryListing->getDirectory() . '/' . $file['name']) ? '<span class="icon-tick icon-green">' : '<span class="icon-cross icon-red">' . '</td>'; $last = '<td>' . lC_DateTime::getShort(@date('Y-m-d H:i:s', $file['last_modified']), true) . '</td>'; if ($file['is_directory'] === false) { $action_links = '<a href="' . ((int) ($_SESSION['admin']['access']['file_manager'] < 3) ? '#' : 'javascript://" onclick="editEntry(\'' . $file['name'] . '\')') . '" class="button icon-pencil' . ((int) ($_SESSION['admin']['access']['file_manager'] < 3) ? ' disabled' : NULL) . '">' . ($media === 'mobile-portrait' || $media === 'mobile-landscape' ? NULL : $lC_Language->get('icon_edit')) . '</a>' . '<a href="' . ((int) ($_SESSION['admin']['access']['file_manager'] < 2) ? '#' : lc_href_link_admin(FILENAME_DEFAULT, 'file_manager&entry=' . $file['name'] . '&action=download')) . '" class="button icon-download with-tooltip' . ((int) ($_SESSION['admin']['access']['file_manager'] < 2) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_download') . '"></a>' . '<a href="' . ((int) ($_SESSION['admin']['access']['file_manager'] < 4) ? '#' : 'javascript://" onclick="deleteEntry(\'' . $file['name'] . '\', \'' . urlencode($file['name']) . '\')"') . '" class="button icon-trash with-tooltip' . ((int) ($_SESSION['admin']['access']['file_manager'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>'; } else { $action_links = '<a href="' . ((int) ($_SESSION['admin']['access']['file_manager'] < 4) ? '#' : 'javascript://" onclick="deleteEntry(\'' . $file['name'] . '\', \'' . urlencode($file['name']) . '\')"') . '" class="button icon-trash' . ((int) ($_SESSION['admin']['access']['file_manager'] < 4) ? ' disabled' : NULL) . '" title="' . $lC_Language->get('icon_delete') . '"></a>'; } $action = '<td class="align-right vertical-center"><span class="button-group compact"> ' . $action_links . ' </span></td>'; $result['aaData'][] = array("{$files}", "{$size}", "{$perms}", "{$user}", "{$group}", "{$write}", "{$last}", "{$action}"); $cnt++; } $result['total'] = $cnt; return $result; }
public function __construct() { global $lC_Language; if (!isset($_GET['set'])) { $_GET['set'] = ''; } $lC_DirectoryListing = new lC_DirectoryListing('../includes/modules/' . $_GET['set']); $lC_DirectoryListing->setIncludeDirectories(false); $_SESSION['modules_location'] = $lC_DirectoryListing->getDirectory(); switch ($_GET['set']) { case 'content': $this->_page_title = $lC_Language->get('heading_title_content'); break; case 'boxes': default: $_GET['set'] = 'boxes'; $this->_page_title = $lC_Language->get('heading_title_boxes'); break; } }
/** * Get the administrator access modules * * @access public * @return array */ public static function getAccessModules() { global $lC_Language; $lC_DirectoryListing = new lC_DirectoryListing('includes/modules/access'); $lC_DirectoryListing->setIncludeDirectories(false); $modules = array(); foreach ($lC_DirectoryListing->getFiles() as $file) { $module = substr($file['name'], 0, strrpos($file['name'], '.')); if (!class_exists('lC_Access_' . ucfirst($module))) { $lC_Language->loadIniFile('modules/access/' . $file['name']); include $lC_DirectoryListing->getDirectory() . '/' . $file['name']; } $tmp_module = ''; if ($module == 'product_variants' || $module == 'product_settings') { $tmp_module = $module; } $module = 'lC_Access_' . ucfirst($module); $module = new $module(); $module_group = lC_Access::getGroupTitle($module->getGroup()); $module_group = str_replace(" ", "_", $module_group); $modules[$module_group][] = array('id' => $tmp_module != '' ? $tmp_module : $module->getModule(), 'text' => $module->getTitle()); } ksort($modules); return $modules; }
if (isset($https_url['port']) && !empty($https_url['port'])) { $https_server .= ':' . $https_url['port']; } if (substr($https_catalog, -1) != '/') { $https_catalog .= '/'; } } $http_work_directory = $_POST['HTTP_WORK_DIRECTORY']; if (substr($http_work_directory, -1) != '/') { $http_work_directory .= '/'; } $lC_DirectoryListing = new lC_DirectoryListing($http_work_directory . 'cache/'); $lC_DirectoryListing->setIncludeDirectories(false); $lC_DirectoryListing->setCheckExtension('cache'); foreach ($lC_DirectoryListing->getFiles() as $files) { @unlink($lC_DirectoryListing->getDirectory() . '/' . $files['name']); } $file_contents = '<?php' . "\n" . ' define(\'HTTP_SERVER\', \'' . $http_server . '\');' . "\n" . ' define(\'HTTPS_SERVER\', \'' . $https_server . '\');' . "\n" . ' define(\'ENABLE_SSL\', ' . $enable_ssl . ');' . "\n" . ' define(\'HTTP_COOKIE_DOMAIN\', \'' . $http_url['host'] . '\');' . "\n" . ' define(\'HTTPS_COOKIE_DOMAIN\', \'' . $https_url['host'] . '\');' . "\n" . ' define(\'HTTP_COOKIE_PATH\', \'' . $http_catalog . '\');' . "\n" . ' define(\'HTTPS_COOKIE_PATH\', \'' . $https_catalog . '\');' . "\n" . ' define(\'DIR_WS_HTTP_CATALOG\', \'' . $http_catalog . '\');' . "\n" . ' define(\'DIR_WS_HTTPS_CATALOG\', \'' . $https_catalog . '\');' . "\n" . ' define(\'DIR_WS_ADMIN\', \'admin/\');' . "\n" . ' define(\'DIR_WS_IMAGES\', \'images/\');' . "\n\n" . ' define(\'DIR_WS_DOWNLOAD_PUBLIC\', \'pub/\');' . "\n" . ' define(\'DIR_FS_CATALOG\', \'' . $dir_fs_document_root . '\');' . "\n" . ' define(\'DIR_FS_ADMIN\', \'' . $dir_fs_document_root . 'admin/\');' . "\n" . ' define(\'DIR_FS_WORK\', \'' . $http_work_directory . '\');' . "\n" . ' define(\'DIR_FS_DOWNLOAD\', DIR_FS_CATALOG . \'download/\');' . "\n" . ' define(\'DIR_FS_DOWNLOAD_PUBLIC\', DIR_FS_CATALOG . \'pub/\');' . "\n" . ' define(\'DIR_FS_BACKUP\', \'' . $dir_fs_document_root . 'admin/backups/\');' . "\n\n" . ' define(\'DB_SERVER\', \'' . $_POST['DB_SERVER'] . '\');' . "\n" . ' define(\'DB_SERVER_USERNAME\', \'' . $_POST['DB_SERVER_USERNAME'] . '\');' . "\n" . ' define(\'DB_SERVER_PASSWORD\', \'' . $_POST['DB_SERVER_PASSWORD'] . '\');' . "\n" . ' define(\'DB_DATABASE\', \'' . $_POST['DB_DATABASE'] . '\');' . "\n" . ' define(\'DB_DATABASE_CLASS\', \'' . $_POST['DB_DATABASE_CLASS'] . '\');' . "\n" . ' define(\'DB_TABLE_PREFIX\', \'' . $_POST['DB_TABLE_PREFIX'] . '\');' . "\n" . ' define(\'USE_PCONNECT\', \'false\');' . "\n" . ' define(\'STORE_SESSIONS\', \'database\');' . "\n" . '?>'; if (file_exists($dir_fs_document_root . 'includes/config.php') && !is_writeable($dir_fs_document_root . 'includes/config.php')) { @chmod($dir_fs_document_root . 'includes/config.php', 0777); } else { @touch($dir_fs_document_root . 'includes/config.php'); @chmod($dir_fs_document_root . 'includes/config.php', 0777); } if (file_exists($dir_fs_document_root . 'includes/config.php') && is_writeable($dir_fs_document_root . 'includes/config.php')) { $fp = fopen($dir_fs_document_root . 'includes/config.php', 'w'); fputs($fp, $file_contents); fclose($fp); ?> <div class="field-block margin-bottom" style="padding-left:20px;">