Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always display security warning on home page #22858

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
44 changes: 21 additions & 23 deletions htdocs/index.php
Expand Up @@ -106,33 +106,31 @@
* Show security warnings
*/

// Security warning repertoire install existe (si utilisateur admin)
if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) {
$message = '';

// Check if install lock file is present
$lockfile = DOL_DATA_ROOT.'/install.lock';
if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) {
$langs->load("errors");
//if (! empty($message)) $message.='<br>';
$message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
}
$message = '';

// Check if install lock file is present
$lockfile = DOL_DATA_ROOT.'/install.lock';
if (!empty($lockfile) && !file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install")) {
$langs->load("errors");
//if (! empty($message)) $message.='<br>';
$message .= info_admin($langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT).' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
}

// Conf files must be in read only mode
if (is_writable($conffile)) {
$langs->load("errors");
//$langs->load("other");
//if (! empty($message)) $message.='<br>';
$message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
}
// Conf files must be in read only mode
if (is_writable($conffile)) {
$langs->load("errors");
//$langs->load("other");
//if (! empty($message)) $message.='<br>';
$message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth');
}

if ($message) {
print $message;
//$message.='<br>';
//print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install"));
}
if ($message) {
print $message;
//$message.='<br>';
//print info_admin($langs->trans("WarningUntilDirRemoved",DOL_DOCUMENT_ROOT."/install"));
}


/*
* Dashboard Dolibarr states (statistics)
* Hidden for external users
Expand Down