2012-12-14 07:53:13 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of Info view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2012-12-14 07:53:13 +00:00
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2012-12-14 07:53:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for Info view
|
|
|
|
*
|
|
|
|
* @category DMS
|
2013-02-14 11:10:53 +00:00
|
|
|
* @package SeedDMS
|
2012-12-14 07:53:13 +00:00
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2012 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
2012-12-14 07:53:13 +00:00
|
|
|
|
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
2021-04-23 08:18:23 +00:00
|
|
|
$settings = $this->params['settings'];
|
2023-01-09 15:15:18 +00:00
|
|
|
$httproot = $settings->_httpRoot;
|
2012-12-14 07:53:13 +00:00
|
|
|
$version = $this->params['version'];
|
2014-04-10 09:19:45 +00:00
|
|
|
$availversions = $this->params['availversions'];
|
2020-06-12 13:02:29 +00:00
|
|
|
$extmgr = $this->params['extmgr'];
|
2012-12-14 07:53:13 +00:00
|
|
|
|
2012-12-17 08:44:52 +00:00
|
|
|
$this->htmlStartPage(getMLText("admin_tools"));
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
2012-12-17 08:44:52 +00:00
|
|
|
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
2014-04-10 09:19:45 +00:00
|
|
|
if($availversions) {
|
|
|
|
$newversion = '';
|
|
|
|
foreach($availversions as $availversion) {
|
|
|
|
if($availversion[0] == 'stable')
|
|
|
|
$newversion = $availversion[1];
|
|
|
|
}
|
2020-02-28 08:47:23 +00:00
|
|
|
if($newversion > $version->version()) {
|
2014-04-10 09:19:45 +00:00
|
|
|
$this->warningMsg(getMLText('no_current_version', array('latestversion'=>$newversion)));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
$this->warningMsg(getMLText('no_version_check'));
|
|
|
|
}
|
2020-10-07 16:33:22 +00:00
|
|
|
|
|
|
|
$this->rowStart();
|
|
|
|
$this->columnStart(6);
|
2020-06-12 13:02:29 +00:00
|
|
|
$this->contentHeading(getMLText("seeddms_info"));
|
|
|
|
$seedextensions = $extmgr->getExtensionConfiguration();
|
2021-04-23 07:55:58 +00:00
|
|
|
echo "<table class=\"table table-condensed table-sm\">\n";
|
2020-06-12 13:02:29 +00:00
|
|
|
echo "<thead>\n<tr>\n";
|
2021-04-23 08:18:23 +00:00
|
|
|
echo "<th></th>";
|
2020-06-12 13:02:29 +00:00
|
|
|
echo "<th>".getMLText("name");
|
|
|
|
echo "</th>\n";
|
|
|
|
echo "</tr>\n</thead>\n<tbody>\n";
|
|
|
|
$dbversion = $dms->getDBVersion();
|
2023-01-09 15:15:18 +00:00
|
|
|
echo "<tr><td></td><td></td><td>".getMLText('seeddms_version')."</td><td>".$version->version()."</td></tr>\n";
|
2020-06-12 13:02:29 +00:00
|
|
|
if($user->isAdmin()) {
|
2023-01-09 15:15:18 +00:00
|
|
|
echo "<tr><td></td><td></td><td>".getMLText('database_schema_version')."</td><td>".$dbversion['major'].".".$dbversion['minor'].".".$dbversion['subminor']."</td></tr>\n";
|
2021-04-23 08:18:23 +00:00
|
|
|
foreach($seedextensions as $extname=>$extconf) {
|
|
|
|
echo "<tr><td>";
|
|
|
|
if(!$settings->extensionIsDisabled($extname))
|
|
|
|
echo "<i class=\"fa fa-circle text-success\"></i> ";
|
|
|
|
else
|
|
|
|
echo "<i class=\"fa fa-circle text-danger text-error\"></i> ";
|
2023-01-09 15:15:18 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "<td width=\"32\">";
|
|
|
|
if($extconf['icon'])
|
|
|
|
echo "<img width=\"32\" height=\"32\" src=\"".$httproot."ext/".$extname."/".$extconf['icon']."\" alt=\"".$extname."\" title=\"".$extname."\">";
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td>".$extname."<br />".$extconf['title']."</td><td>".$extconf['version']."</td>";
|
2021-04-23 08:18:23 +00:00
|
|
|
echo "</tr>\n";
|
|
|
|
}
|
2020-06-12 13:02:29 +00:00
|
|
|
}
|
|
|
|
echo "</tbody>\n</table>\n";
|
2020-10-07 16:33:22 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->columnStart(6);
|
2020-06-12 13:02:29 +00:00
|
|
|
if($user->isAdmin()) {
|
|
|
|
$this->contentHeading(getMLText("php_info"));
|
2021-04-23 07:55:58 +00:00
|
|
|
echo "<table class=\"table table-condensed table-sm\">\n";
|
2020-06-12 13:02:29 +00:00
|
|
|
echo "<thead>\n<tr>\n";
|
|
|
|
echo "<th>".getMLText("name");
|
|
|
|
echo "</th>\n";
|
|
|
|
echo "</tr>\n</thead>\n<tbody>\n";
|
|
|
|
echo "<tr><td>PHP</td><td>".phpversion()."</td></tr>\n";
|
|
|
|
echo "<tr><td>Path to php.ini</td><td>".php_ini_loaded_file()."</td></tr>\n";
|
|
|
|
echo "</tbody>\n</table>\n";
|
|
|
|
|
|
|
|
$this->contentHeading(getMLText("installed_php_extensions"));
|
|
|
|
$phpextensions = get_loaded_extensions(false);
|
2023-04-03 10:02:21 +00:00
|
|
|
echo implode(', ', $phpextensions);
|
2020-06-12 13:02:29 +00:00
|
|
|
|
|
|
|
$this->contentHeading(getMLText("missing_php_extensions"));
|
2023-04-19 04:41:52 +00:00
|
|
|
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick', 'openssl');
|
2023-10-11 06:38:33 +00:00
|
|
|
$missingext = array_diff($requiredext, $phpextensions);
|
|
|
|
if($missingext) {
|
|
|
|
foreach($missingext as $mext)
|
|
|
|
echo $this->errorMsg(getMLText('missing_php_extension', ['extname'=>$mext]));
|
|
|
|
} else {
|
|
|
|
echo $this->successMsg(getMLText('check_passed'));
|
|
|
|
}
|
2020-12-22 16:05:45 +00:00
|
|
|
|
2021-04-23 07:55:58 +00:00
|
|
|
$this->contentHeading(getMLText("missing_php_functions_and_classes"));
|
2023-04-03 10:02:21 +00:00
|
|
|
$missingfunc = [];
|
2023-04-19 04:41:52 +00:00
|
|
|
foreach(array('proc_open', 'openssl_cipher_iv_length') as $funcname) {
|
2021-03-30 11:03:26 +00:00
|
|
|
if(!function_exists($funcname)) {
|
2023-04-03 10:02:21 +00:00
|
|
|
$missingfunc[] = $funcname; //getMLText('func_'.$funcname."_missing")
|
2021-03-30 11:03:26 +00:00
|
|
|
}
|
|
|
|
}
|
2023-04-03 10:02:21 +00:00
|
|
|
$missingclass = [];
|
2021-04-23 07:55:58 +00:00
|
|
|
foreach(array('finfo') as $classname) {
|
|
|
|
if(!class_exists($classname)) {
|
2023-04-03 10:02:21 +00:00
|
|
|
$missingclass[] = $classname; //getMLText('func_'.$classname."_missing")
|
2021-04-23 07:55:58 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-11 06:38:33 +00:00
|
|
|
if($missingclass || $missingfunc) {
|
|
|
|
foreach($missingclass as $mclass)
|
|
|
|
echo $this->errorMsg(getMLText('missing_php_class', ['classname'=>$mclass]));
|
|
|
|
foreach($missingfunc as $mfunc)
|
|
|
|
echo $this->errorMsg(getMLText('missing_php_function', ['funcname'=>$mfunc]));
|
|
|
|
} else {
|
|
|
|
echo $this->successMsg(getMLText('check_passed'));
|
|
|
|
}
|
2021-03-30 11:03:26 +00:00
|
|
|
|
2020-12-22 16:05:45 +00:00
|
|
|
if(function_exists('apache_get_modules')) {
|
|
|
|
$this->contentHeading(getMLText("installed_apache_extensions"));
|
|
|
|
$apacheextensions = apache_get_modules();
|
2023-04-03 10:02:21 +00:00
|
|
|
echo implode(', ', $apacheextensions);
|
|
|
|
}
|
|
|
|
|
2023-10-11 06:38:33 +00:00
|
|
|
$this->contentHeading(getMLText("check_secure_installation"));
|
|
|
|
if(file_exists($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.'conf') || file_exists($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.'data')) {
|
|
|
|
echo $this->errorMsg(getMLText('insecure_installation'));
|
|
|
|
} else {
|
|
|
|
echo $this->successMsg(getMLText('check_passed'));
|
|
|
|
}
|
|
|
|
|
2023-04-03 10:02:21 +00:00
|
|
|
function check_result($name, $res) {
|
|
|
|
echo "<tr ".($res ? 'class="table-success success"' : 'class="table-danger error"')."><td>".getMLText($name)."</td><td>".getMLText($res ? 'check_passed' : 'check_failed')."</td></tr>\n";
|
2020-12-22 16:05:45 +00:00
|
|
|
}
|
2023-04-03 10:02:21 +00:00
|
|
|
$this->contentHeading(getMLText("check_directory_layout"));
|
|
|
|
echo "<table class=\"table table-condensed table-sm\">\n";
|
|
|
|
echo "<thead>\n<tr>\n";
|
|
|
|
echo "<th>".getMLText("directory_check")."</th>\n";
|
|
|
|
echo "<th>".getMLText("directory_check_result")."</th>\n";
|
|
|
|
echo "</tr>\n</thead>\n<tbody>\n";
|
|
|
|
check_result('directory_check_ext_exists', is_dir($settings->_rootDir."/ext"));
|
2023-08-18 04:38:25 +00:00
|
|
|
check_result('directory_check_ext_below_docroot', is_dir($_SERVER['DOCUMENT_ROOT']."/ext"));
|
2023-04-03 10:02:21 +00:00
|
|
|
check_result('directory_check_ext_writable', is_writable($settings->_rootDir."/ext"));
|
|
|
|
check_result('directory_check_data_exists', is_dir($settings->_contentDir));
|
|
|
|
check_result('directory_check_data_writable', is_writable($settings->_contentDir));
|
|
|
|
check_result('directory_check_cache_exists', is_dir($settings->_cacheDir));
|
|
|
|
check_result('directory_check_cache_writable', is_writable($settings->_cacheDir));
|
|
|
|
check_result('directory_check_index_exists', is_dir($settings->_luceneDir));
|
|
|
|
check_result('directory_check_index_writable', is_writable($settings->_luceneDir));
|
|
|
|
check_result('directory_check_conf_writable', is_writable($settings->_configFilePath));
|
|
|
|
$res = !str_starts_with($settings->_contentDir, $settings->_rootDir);
|
|
|
|
check_result('directory_check_data_below_root', $res);
|
|
|
|
echo "</tbody>\n</table>\n";
|
|
|
|
|
2020-06-12 13:02:29 +00:00
|
|
|
}
|
2020-10-07 16:33:22 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->rowEnd();
|
2016-03-15 07:30:53 +00:00
|
|
|
$this->contentEnd();
|
2012-12-14 07:53:13 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|