Better error report on id command that failed

This commit is contained in:
Laurent Destailleur 2021-11-24 22:35:10 +01:00
parent 733ca28d8c
commit 01038b190d
2 changed files with 7 additions and 1 deletions

View File

@ -70,9 +70,14 @@ if ($labeluser && $labelgroup) {
if (function_exists('exec')) {
$arrayout = array(); $varout = 0;
exec('id', $arrayout, $varout);
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
if (empty($varout)) { // Test command is ok. Work only on Linux OS.
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n";
print join(',', $arrayout);
} else {
$langs->load("errors");
print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
}
print "</td></tr>\n";
}
print '</table>';
print '</div>';

View File

@ -270,6 +270,7 @@ ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Ev
CheckVersionFail=Version check fail
ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it
ErrorNotInDictionaryPaymentConditions=Not in Payment Terms Dictionary, please modify.
ErrorExecIdFailed=Can't execute command "id"
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.