Example #1
0
 public static function execute()
 {
     $OSCOM_Language = Registry::get('Language');
     $module_files = array();
     $DLapps = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Core/Site/' . OSCOM::getSite() . '/Application');
     $DLapps->setIncludeFiles(false);
     foreach ($DLapps->getFiles() as $file) {
         if (!in_array($file['name'], call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Controller', 'getGuestApplications'))) && file_exists($DLapps->getDirectory() . '/' . $file['name'] . '/Controller.php')) {
             $module_files[] = $file['name'];
         }
     }
     $modules = array();
     foreach ($module_files as $module) {
         $application_class = 'osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . $module . '\\Controller';
         if (class_exists($application_class)) {
             if ($module == OSCOM::getSiteApplication()) {
                 $OSCOM_Application = Registry::get('Application');
             } else {
                 Registry::get('Language')->loadIniFile($module . '.php');
                 $OSCOM_Application = new $application_class(false);
             }
             $modules[Access::getGroupTitle($OSCOM_Application->getGroup())][] = array('id' => $module, 'text' => $OSCOM_Application->getTitle(), 'icon' => $OSCOM_Application->getIcon());
         }
     }
     ksort($modules);
     return $modules;
 }
Example #2
0
<?php 
$http_url = parse_url($_POST['HTTP_WWW_ADDRESS']);
$http_server = $http_url['scheme'] . '://' . $http_url['host'];
$http_catalog = $http_url['path'];
if (isset($http_url['port']) && !empty($http_url['port'])) {
    $http_server .= ':' . $http_url['port'];
}
if (substr($http_catalog, -1) != '/') {
    $http_catalog .= '/';
}
$dir_fs_document_root = realpath(OSCOM::BASE_DIRECTORY . '../../') . '/';
$OSCOM_DirectoryListing = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Work/Cache');
$OSCOM_DirectoryListing->setIncludeDirectories(false);
$OSCOM_DirectoryListing->setCheckExtension('cache');
foreach ($OSCOM_DirectoryListing->getFiles() as $files) {
    @unlink($OSCOM_DirectoryListing->getDirectory() . '/' . $files['name']);
}
$file_contents = 'OSCOM_BOOTSTRAP_FILE = "index.php"' . "\n" . 'OSCOM_DEFAULT_SITE = "Shop"' . "\n" . 'HTTP_SERVER = "' . $http_server . '"' . "\n" . 'HTTPS_SERVER = "' . $http_server . '"' . "\n" . 'ENABLE_SSL = "false"' . "\n" . 'HTTP_COOKIE_DOMAIN = ""' . "\n" . 'HTTPS_COOKIE_DOMAIN = ""' . "\n" . 'HTTP_COOKIE_PATH = "' . $http_catalog . '"' . "\n" . 'HTTPS_COOKIE_PATH = "' . $http_catalog . '"' . "\n" . 'DIR_WS_HTTP_CATALOG = "' . $http_catalog . '"' . "\n" . 'DIR_WS_HTTPS_CATALOG = "' . $http_catalog . '"' . "\n" . 'DIR_WS_IMAGES = "images/"' . "\n" . 'DIR_WS_DOWNLOAD_PUBLIC = "pub/"' . "\n" . 'DIR_FS_CATALOG = "' . $dir_fs_document_root . '"' . "\n" . 'DIR_FS_WORK = "' . OSCOM::BASE_DIRECTORY . 'work/' . '"' . "\n" . 'DIR_FS_DOWNLOAD = "' . $dir_fs_document_root . 'download/"' . "\n" . 'DIR_FS_DOWNLOAD_PUBLIC = "' . $dir_fs_document_root . 'pub/"' . "\n" . 'DIR_FS_BACKUP = "' . OSCOM::BASE_DIRECTORY . 'Core/Site/Admin/backups/"' . "\n" . 'DB_SERVER = "' . $_POST['DB_SERVER'] . '"' . "\n" . 'DB_SERVER_USERNAME = "******"' . "\n" . 'DB_SERVER_PASSWORD = "******"' . "\n" . 'DB_SERVER_PORT = "' . $_POST['DB_SERVER_PORT'] . '"' . "\n" . 'DB_DATABASE = "' . $_POST['DB_DATABASE'] . '"' . "\n" . 'DB_DATABASE_CLASS = "' . str_replace('_', '\\', $_POST['DB_DATABASE_CLASS']) . '"' . "\n" . 'DB_TABLE_PREFIX = "' . $_POST['DB_TABLE_PREFIX'] . '"' . "\n" . 'DB_SERVER_PERSISTENT_CONNECTIONS = "false"' . "\n" . 'STORE_SESSIONS = "Database"' . "\n";
if (is_writable(OSCOM::BASE_DIRECTORY . 'Config/settings.ini')) {
    file_put_contents(OSCOM::BASE_DIRECTORY . 'Config/settings.ini', $file_contents);
    ?>

    <p><?php 
    echo OSCOM::getDef('text_successful_installation');
    ?>
</p>

<?php 
} else {
    ?>
Example #3
0
if (isset($http_url['port']) && !empty($http_url['port'])) {
    $http_server .= ':' . $http_url['port'];
}
if (substr($http_dir_ws, -1) != '/') {
    $http_dir_ws .= '/';
}
$http_cookie_domain = '';
if (substr_count($http_url['host'], '.') > 1 && !filter_var($http_url['host'], FILTER_VALIDATE_IP)) {
    $http_cookie_domain = $http_url['host'];
}
$dir_fs_document_root = OSCOM_PUBLIC_BASE_DIRECTORY;
$DL_Cache = new DirectoryListing(OSCOM::BASE_DIRECTORY . 'Work/Cache');
$DL_Cache->setIncludeDirectories(false);
$DL_Cache->setCheckExtension('cache');
foreach ($DL_Cache->getFiles() as $files) {
    @unlink($DL_Cache->getDirectory() . '/' . $files['name']);
}
$db_class = str_replace('_', '\\', $_POST['DB_DATABASE_CLASS']);
$file_contents = <<<EOT
[OSCOM]
bootstrap_file = "index.php"
default_site = "Shop"
time_zone = "{$_POST['CFG_TIME_ZONE']}"
dir_fs_public = "{$dir_fs_document_root}public/"

[Admin]
enable_ssl = "false"
http_server = "{$http_server}"
https_server = "{$http_server}"
http_cookie_domain = "{$http_cookie_domain}"
https_cookie_domain = "{$http_cookie_domain}"