/** * @return DataResponse */ public function check() { return new DataResponse( [ 'serverHasInternetConnection' => $this->isInternetConnectionWorking(), 'dataDirectoryProtected' => $this->util->isHtaccessWorking($this->config), 'isMemcacheConfigured' => $this->isMemcacheConfigured(), 'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'), 'isUrandomAvailable' => $this->isUrandomAvailable(), 'securityDocs' => $this->urlGenerator->linkToDocs('admin-security'), ] ); }
/** * Gathers system information like database type and does * a few system checks. * * @return array of system info, including an "errors" value * in case of errors/warnings */ public function getSystemInfo($allowAllDatabases = false) { $databases = $this->getSupportedDatabases($allowAllDatabases); $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); $errors = array(); // Create data directory to test whether the .htaccess works // Notice that this is not necessarily the same data directory as the one // that will effectively be used. @mkdir($dataDir); $htAccessWorking = true; if (is_dir($dataDir) && is_writable($dataDir)) { // Protect data directory here, so we can test if the protection is working \OC\Setup::protectDataDirectory(); try { $util = new \OC_Util(); $htAccessWorking = $util->isHtaccessWorking(\OC::$server->getConfig()); } catch (\OC\HintException $e) { $errors[] = array('error' => $e->getMessage(), 'hint' => $e->getHint()); $htAccessWorking = false; } } if (\OC_Util::runningOnMac()) { $errors[] = array('error' => $this->l10n->t('Mac OS X is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk! ', $this->defaults->getName()), 'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.')); } if ($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) { $errors[] = array('error' => $this->l10n->t('It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' . 'This will lead to problems with files over 4 GB and is highly discouraged.', $this->defaults->getName()), 'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP.')); } return array('hasSQLite' => isset($databases['sqlite']), 'hasMySQL' => isset($databases['mysql']), 'hasPostgreSQL' => isset($databases['pgsql']), 'hasOracle' => isset($databases['oci']), 'databases' => $databases, 'directory' => $dataDir, 'htaccessWorking' => $htAccessWorking, 'errors' => $errors); }
/** * Gathers system information like database type and does * a few system checks. * * @return array of system info, including an "errors" value * in case of errors/warnings */ public function getSystemInfo() { $hasSQLite = class_exists('SQLite3'); $hasMySQL = is_callable('mysql_connect'); $hasPostgreSQL = is_callable('pg_connect'); $hasOracle = is_callable('oci_connect'); $hasMSSQL = is_callable('sqlsrv_connect'); $databases = array(); if ($hasSQLite) { $databases['sqlite'] = 'SQLite'; } if ($hasMySQL) { $databases['mysql'] = 'MySQL/MariaDB'; } if ($hasPostgreSQL) { $databases['pgsql'] = 'PostgreSQL'; } if ($hasOracle) { $databases['oci'] = 'Oracle'; } if ($hasMSSQL) { $databases['mssql'] = 'MS SQL'; } $datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data'); $vulnerableToNullByte = false; if (@file_exists(__FILE__ . "Nullbyte")) { // Check if the used PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243) $vulnerableToNullByte = true; } $errors = array(); // Protect data directory here, so we can test if the protection is working \OC_Setup::protectDataDirectory(); try { $htaccessWorking = \OC_Util::isHtaccessWorking(); } catch (\OC\HintException $e) { $errors[] = array('error' => $e->getMessage(), 'hint' => $e->getHint()); $htaccessWorking = false; } if (\OC_Util::runningOnMac()) { $l10n = \OC::$server->getL10N('core'); $themeName = \OC_Util::getTheme(); $theme = new \OC_Defaults(); $errors[] = array('error' => $l10n->t('Mac OS X is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk! ', $theme->getName()), 'hint' => $l10n->t('For the best results, please consider using a GNU/Linux server instead.')); } return array('hasSQLite' => $hasSQLite, 'hasMySQL' => $hasMySQL, 'hasPostgreSQL' => $hasPostgreSQL, 'hasOracle' => $hasOracle, 'hasMSSQL' => $hasMSSQL, 'databases' => $databases, 'directory' => $datadir, 'htaccessWorking' => $htaccessWorking, 'vulnerableToNullByte' => $vulnerableToNullByte, 'errors' => $errors); }
/** * Gathers system information like database type and does * a few system checks. * * @return array of system info, including an "errors" value * in case of errors/warnings */ public function getSystemInfo() { $setup = new \OC_Setup($this->config); $databases = $setup->getSupportedDatabases(); $dataDir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); $vulnerableToNullByte = false; if (@file_exists(__FILE__ . "Nullbyte")) { // Check if the used PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243) $vulnerableToNullByte = true; } $errors = array(); // Create data directory to test whether the .htaccess works // Notice that this is not necessarily the same data directory as the one // that will effectively be used. @mkdir($dataDir); $htAccessWorking = true; if (is_dir($dataDir) && is_writable($dataDir)) { // Protect data directory here, so we can test if the protection is working \OC_Setup::protectDataDirectory(); try { $htAccessWorking = \OC_Util::isHtaccessWorking(); } catch (\OC\HintException $e) { $errors[] = array('error' => $e->getMessage(), 'hint' => $e->getHint()); $htAccessWorking = false; } } if (\OC_Util::runningOnMac()) { $errors[] = array('error' => $this->l10n->t('Mac OS X is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk! ', $this->defaults->getName()), 'hint' => $this->l10n->t('For the best results, please consider using a GNU/Linux server instead.')); } if ($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) { $errors[] = array('error' => $this->l10n->t('It seems that this %s instance is running on a 32bit PHP environment and the open_basedir has been configured in php.ini. ' . 'This will lead to problems with files over 4GB and is highly discouraged.', $this->defaults->getName()), 'hint' => $this->l10n->t('Please remove the open_basedir setting within your php.ini or switch to 64bit PHP.')); } if (!function_exists('curl_init') && PHP_INT_SIZE === 4) { $errors[] = array('error' => $this->l10n->t('It seems that this %s instance is running on a 32bit PHP environment and cURL is not installed. ' . 'This will lead to problems with files over 4GB and is highly discouraged.', $this->defaults->getName()), 'hint' => $this->l10n->t('Please install the cURL extension and restart your webserver.')); } return array('hasSQLite' => isset($databases['sqlite']), 'hasMySQL' => isset($databases['mysql']), 'hasPostgreSQL' => isset($databases['pgsql']), 'hasOracle' => isset($databases['oci']), 'hasMSSQL' => isset($databases['mssql']), 'databases' => $databases, 'directory' => $dataDir, 'htaccessWorking' => $htAccessWorking, 'vulnerableToNullByte' => $vulnerableToNullByte, 'errors' => $errors); }
/** * @return DataResponse */ public function check() { return new DataResponse(['serverHasInternetConnection' => $this->isInternetConnectionWorking(), 'dataDirectoryProtected' => $this->util->isHtaccessWorking($this->config), 'isMemcacheConfigured' => $this->isMemcacheConfigured(), 'memcacheDocs' => $this->urlGenerator->linkToDocs('admin-performance'), 'isUrandomAvailable' => $this->isUrandomAvailable(), 'securityDocs' => $this->urlGenerator->linkToDocs('admin-security'), 'isUsedTlsLibOutdated' => $this->isUsedTlsLibOutdated(), 'phpSupported' => $this->isPhpSupported(), 'forwardedForHeadersWorking' => $this->forwardedForHeadersWorking(), 'reverseProxyDocs' => $this->urlGenerator->linkToDocs('admin-reverse-proxy'), 'isCorrectMemcachedPHPModuleInstalled' => $this->isCorrectMemcachedPHPModuleInstalled()]); }
<?php /** * Copyright (c) 2014, Vincent Petry <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ OCP\JSON::checkAdminUser(); OCP\JSON::callCheck(); \OC::$server->getSession()->close(); // no warning when has_internet_connection is false in the config $hasInternet = true; if (OC_Util::isInternetConnectionEnabled()) { $hasInternet = OC_Util::isInternetConnectionWorking(); } OCP\JSON::success(array('serverHasInternetConnection' => $hasInternet, 'dataDirectoryProtected' => OC_Util::isHtaccessWorking(), 'hasCurlInstalled' => function_exists('curl_init')));
* This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ OC_Util::checkAdminUser(); OCP\Util::addStyle('settings', 'settings'); OCP\Util::addScript('settings', 'settings'); OCP\Util::addScript("settings", "admin"); OCP\Util::addScript("settings", "log"); OCP\Util::addScript('core', 'multiselect'); OCP\Util::addScript('core', 'select2/select2'); OCP\Util::addStyle('core', 'select2/select2'); OCP\Util::addScript('core', 'setupchecks'); OC_App::setActiveNavigationEntry("admin"); $tmpl = new OC_Template('settings', 'admin', 'user'); $forms = OC_App::getForms('admin'); $htaccessworking = OC_Util::isHtaccessWorking(); $entries = OC_Log_Owncloud::getEntries(3); $entriesremain = count(OC_Log_Owncloud::getEntries(4)) > 3; $config = \OC::$server->getConfig(); // Should we display sendmail as an option? $tmpl->assign('sendmail_is_available', (bool) findBinaryPath('sendmail')); $tmpl->assign('loglevel', OC_Config::getValue("loglevel", 2)); $tmpl->assign('mail_domain', OC_Config::getValue("mail_domain", '')); $tmpl->assign('mail_from_address', OC_Config::getValue("mail_from_address", '')); $tmpl->assign('mail_smtpmode', OC_Config::getValue("mail_smtpmode", '')); $tmpl->assign('mail_smtpsecure', OC_Config::getValue("mail_smtpsecure", '')); $tmpl->assign('mail_smtphost', OC_Config::getValue("mail_smtphost", '')); $tmpl->assign('mail_smtpport', OC_Config::getValue("mail_smtpport", '')); $tmpl->assign('mail_smtpauthtype', OC_Config::getValue("mail_smtpauthtype", '')); $tmpl->assign('mail_smtpauth', OC_Config::getValue("mail_smtpauth", false)); $tmpl->assign('mail_smtpname', OC_Config::getValue("mail_smtpname", ''));
/** * Gathers system information like database type and does * a few system checks. * * @return array of system info, including an "errors" value * in case of errors/warnings */ public function getSystemInfo() { $setup = new \OC_Setup($this->config); $databases = $setup->getSupportedDatabases(); $datadir = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); $vulnerableToNullByte = false; if (@file_exists(__FILE__ . "Nullbyte")) { // Check if the used PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243) $vulnerableToNullByte = true; } $errors = array(); // Create data directory to test whether the .htaccess works // Notice that this is not necessarily the same data directory as the one // that will effectively be used. @mkdir($datadir); if (is_dir($datadir) && is_writable($datadir)) { // Protect data directory here, so we can test if the protection is working \OC_Setup::protectDataDirectory(); try { $htaccessWorking = \OC_Util::isHtaccessWorking(); } catch (\OC\HintException $e) { $errors[] = array('error' => $e->getMessage(), 'hint' => $e->getHint()); $htaccessWorking = false; } } if (\OC_Util::runningOnMac()) { $l10n = \OC_L10N::get('core'); $themeName = \OC_Util::getTheme(); $theme = new \OC_Defaults(); $errors[] = array('error' => $l10n->t('Mac OS X is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk! ', $theme->getName()), 'hint' => $l10n->t('For the best results, please consider using a GNU/Linux server instead.')); } return array('hasSQLite' => isset($databases['sqlite']), 'hasMySQL' => isset($databases['mysql']), 'hasPostgreSQL' => isset($databases['pgsql']), 'hasOracle' => isset($databases['oci']), 'hasMSSQL' => isset($databases['mssql']), 'databases' => $databases, 'directory' => $datadir, 'secureRNG' => \OC_Util::secureRNGAvailable(), 'htaccessWorking' => $htaccessWorking, 'vulnerableToNullByte' => $vulnerableToNullByte, 'errors' => $errors); }