public static function getLogPath($version) { $result = ''; if (static::logExists($version)) { $result = FileSystem::displayPath(OSCOM::BASE_DIR . 'Work/OnlineUpdates/' . $version . '-log.txt'); } return $result; }
<div class="col-xs-12 col-sm-push-3 col-sm-9"> <h1>Web Server</h1> <form name="install" id="installForm" action="install.php?step=3" method="post"> <div class="form-group has-feedback"> <label for="wwwAddress">WWW Address</label> <?php echo HTML::inputField('HTTP_WWW_ADDRESS', $www_location, 'required aria-required="true" id="wwwAddress" placeholder="http://"'); ?> <span class="help-block">The web address to the online store.</span> </div> <div class="form-group has-feedback"> <label for="webRoot">Webserver Root Directory</label> <?php echo HTML::inputField('DIR_FS_DOCUMENT_ROOT', str_replace('\\', '/', FileSystem::displayPath($dir_fs_www_root)), 'required aria-required="true" id="webRoot"'); ?> <span class="help-block">The directory where the online store is installed on the server.</span> </div> <p><?php echo HTML::button('Continue to Step 3', 'triangle-1-e', null, null, 'btn-success'); ?> </p> <?php foreach ($_POST as $key => $value) { if ($key != 'x' && $key != 'y') { echo HTML::hiddenField($key, $value); } }
<p><i>Changing webserver configuration parameters may require the webserver service to be restarted before the changes take affect.</i></p> </div> <?php } if (!empty($configfile_array)) { ?> <div class="alert alert-danger"> <p>The webserver is not able to save to the following installation configuration files. Please update the file permissions of the following files to world-writable (chmod 777) and try the installation procedure again:</p> <ul style="margin-top: 20px;"> <?php foreach ($configfile_array as $file) { echo '<li>' . FileSystem::displayPath($file) . '</li>'; } ?> </ul> </div> <?php } if (!empty($configfile_array) || !empty($warning_array)) { ?> <p><a href="index.php" class="btn btn-danger" role="button">Retry Installation</a></p> <?php } else {
</td> <td class="text-right"><?php echo $f['size']; ?> </td> <td class="action"><a href="<?php echo OSCOM::link('error_log.php', 'action=view&log=' . $f['key']); ?> "><i class="fa fa-file-text-o" title="<?php echo OSCOM::getDef('button_view'); ?> "></i></a></td> </tr> <?php } ?> </tbody> </table> <p> <?php echo OSCOM::getDef('log_directory', ['path' => FileSystem::displayPath(ErrorHandler::getDirectory())]); ?> </p> <?php } require $oscTemplate->getFile('template_bottom.php'); require 'includes/application_bottom.php';
?> </td> <td class="text-right"><?php echo count($cache_files[$key]); ?> </td> <td class="action"><a href="<?php echo OSCOM::link(FILENAME_CACHE, 'action=reset&block=' . $key); ?> "><i class="fa fa-recycle" title="<?php echo OSCOM::getDef('image_delete'); ?> "></i></a></td> </tr> <?php } ?> </tbody> </table> <p> <?php echo '<strong>' . OSCOM::getDef('text_cache_directory') . '</strong> ' . FileSystem::displayPath(Cache::getPath()); ?> </p> <?php require $oscTemplate->getFile('template_bottom.php'); require 'includes/application_bottom.php';
} else { OnlineUpdate::log('--- DELETE ERROR: Could not delete the following file: ' . FileSystem::displayPath($file_source), $_POST['version']); } } } } } } if (isset($OU) && $OU instanceof \OSC\OM\OnlineUpdate\Update && method_exists($OU, 'runAfter')) { OnlineUpdate::log('Executing update package runAfter()', $_POST['version']); $OU->runAfter(); } if (file_put_contents(OSCOM::BASE_DIR . 'version.txt', $_POST['version'])) { OnlineUpdate::log('+ UPDATED: ' . FileSystem::displayPath(OSCOM::BASE_DIR . 'version.txt'), $_POST['version']); } else { OnlineUpdate::log('+++ UPDATE ERROR: Could not update the following file: ' . FileSystem::displayPath(OSCOM::BASE_DIR . 'version.txt'), $_POST['version']); } OnlineUpdate::log('Finished update', $_POST['version']); $result['result'] = 1; FileSystem::rmdir($work_dir); } catch (\Exception $e) { OnlineUpdate::log($e->getMessage(), $_POST['version']); } echo json_encode($result); exit; break; } } $new_version = []; if (is_array($releases) && !empty($releases)) { if (!empty($versions)) {
protected function init() { global $PHP_SELF, $login_request, $cfgModules, $oscTemplate; $OSCOM_Cookies = new Cookies(); Registry::set('Cookies', $OSCOM_Cookies); try { $OSCOM_Db = Db::initialize(); Registry::set('Db', $OSCOM_Db); } catch (\Exception $e) { include OSCOM::getConfig('dir_root', 'Shop') . 'includes/error_documents/maintenance.php'; exit; } Registry::set('Hooks', new Hooks()); Registry::set('MessageStack', new MessageStack()); // set the application parameters $Qcfg = $OSCOM_Db->get('configuration', ['configuration_key as k', 'configuration_value as v']); //, null, null, null, 'configuration'); // TODO add cache when supported by admin while ($Qcfg->fetch()) { define($Qcfg->value('k'), $Qcfg->value('v')); } // Used in the "Backup Manager" to compress backups define('LOCAL_EXE_GZIP', 'gzip'); define('LOCAL_EXE_GUNZIP', 'gunzip'); define('LOCAL_EXE_ZIP', 'zip'); define('LOCAL_EXE_UNZIP', 'unzip'); // set php_self in the global scope $req = parse_url($_SERVER['SCRIPT_NAME']); $PHP_SELF = substr($req['path'], strlen(OSCOM::getConfig('http_path'))); $OSCOM_Session = Session::load(); Registry::set('Session', $OSCOM_Session); $OSCOM_Session->start(); $OSCOM_Language = new Language(); Registry::set('Language', $OSCOM_Language); // set the language if (!isset($_SESSION['language']) || isset($_GET['language'])) { if (isset($_GET['language']) && !empty($_GET['language']) && $OSCOM_Language->exists($_GET['language'])) { $OSCOM_Language->set($_GET['language']); } $_SESSION['language'] = $OSCOM_Language->get('code'); } // redirect to login page if administrator is not yet logged in if (!isset($_SESSION['admin'])) { $redirect = false; $current_page = $PHP_SELF; // if the first page request is to the login page, set the current page to the index page // so the redirection on a successful login is not made to the login page again if ($current_page == FILENAME_LOGIN && !isset($_SESSION['redirect_origin'])) { $current_page = FILENAME_DEFAULT; } if ($current_page != FILENAME_LOGIN) { if (!isset($_SESSION['redirect_origin'])) { $_SESSION['redirect_origin'] = ['page' => $current_page, 'get' => []]; } // try to automatically login with the HTTP Authentication values if it exists if (!isset($_SESSION['auth_ignore'])) { if (isset($_SERVER['PHP_AUTH_USER']) && !empty($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) && !empty($_SERVER['PHP_AUTH_PW'])) { $_SESSION['redirect_origin']['auth_user'] = $_SERVER['PHP_AUTH_USER']; $_SESSION['redirect_origin']['auth_pw'] = $_SERVER['PHP_AUTH_PW']; } } $redirect = true; } if (!isset($login_request) || isset($_GET['login_request']) || isset($_POST['login_request']) || isset($_COOKIE['login_request']) || isset($_SESSION['login_request']) || isset($_FILES['login_request']) || isset($_SERVER['login_request'])) { $redirect = true; } if ($redirect == true) { OSCOM::redirect(FILENAME_LOGIN, isset($_SESSION['redirect_origin']['auth_user']) ? 'action=process' : ''); } } // include the language translations $OSCOM_Language->loadDefinitions('main'); // Prevent LC_ALL from setting LC_NUMERIC to a locale with 1,0 float/decimal values instead of 1.0 (see bug #634) $system_locale_numeric = setlocale(LC_NUMERIC, 0); setlocale(LC_ALL, explode(';', OSCOM::getDef('system_locale'))); setlocale(LC_NUMERIC, $system_locale_numeric); $current_page = basename($PHP_SELF); if ($OSCOM_Language->definitionsExist(pathinfo($current_page, PATHINFO_FILENAME))) { $OSCOM_Language->loadDefinitions(pathinfo($current_page, PATHINFO_FILENAME)); } $oscTemplate = new \oscTemplate(); $cfgModules = new \cfg_modules(); if (!FileSystem::isWritable(ErrorHandler::getDirectory())) { Registry::get('MessageStack')->add('The log directory is not writable. Please allow the web server to write to: ' . FileSystem::displayPath(ErrorHandler::getDirectory())); } }