mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
add security check, echo error for each missing function, class, php-ext
This commit is contained in:
parent
bc70af210d
commit
b480439397
|
@ -106,6 +106,13 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
||||||
|
|
||||||
$this->contentHeading(getMLText("missing_php_extensions"));
|
$this->contentHeading(getMLText("missing_php_extensions"));
|
||||||
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick', 'openssl');
|
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick', 'openssl');
|
||||||
|
$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'));
|
||||||
|
}
|
||||||
echo implode(', ', array_diff($requiredext, $phpextensions));
|
echo implode(', ', array_diff($requiredext, $phpextensions));
|
||||||
|
|
||||||
$this->contentHeading(getMLText("missing_php_functions_and_classes"));
|
$this->contentHeading(getMLText("missing_php_functions_and_classes"));
|
||||||
|
@ -121,6 +128,14 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
||||||
$missingclass[] = $classname; //getMLText('func_'.$classname."_missing")
|
$missingclass[] = $classname; //getMLText('func_'.$classname."_missing")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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'));
|
||||||
|
}
|
||||||
echo '<p>'.implode(', ', $missingfunc).'</p>';
|
echo '<p>'.implode(', ', $missingfunc).'</p>';
|
||||||
echo '<p>'.implode(', ', $missingclass).'</p>';
|
echo '<p>'.implode(', ', $missingclass).'</p>';
|
||||||
|
|
||||||
|
@ -130,6 +145,13 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
|
||||||
echo implode(', ', $apacheextensions);
|
echo implode(', ', $apacheextensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$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'));
|
||||||
|
}
|
||||||
|
|
||||||
function check_result($name, $res) {
|
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";
|
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";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user