ensure the encryption key is alwasy set

This commit is contained in:
Uwe Steinmann 2021-04-06 11:15:47 +02:00
parent 34b1574cc1
commit 67ab1e23e5
2 changed files with 6 additions and 4 deletions

View File

@ -29,6 +29,12 @@ if(!defined("SEEDDMS_INSTALL") && file_exists(dirname($settings->_configFilePath
die("SeedDMS won't run unless your remove the file ENABLE_INSTALL_TOOL from your configuration directory.");
}
/* Set an encryption key if is not set */
if(!trim($settings->_encryptionKey)) {
$settings->_encryptionKey = md5(uniqid());
$settings->save();
}
if(isset($settings->_extraPath))
ini_set('include_path', $settings->_extraPath. PATH_SEPARATOR .ini_get('include_path'));

View File

@ -33,10 +33,6 @@ if (!$user->isAdmin()) {
UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
}
/* Set an encryption key if is not set */
if(!trim($settings->_encryptionKey))
$settings->_encryptionKey = md5(uniqid());
$users = $dms->getAllUsers($settings->_sortUsersInList);
$groups = $dms->getAllGroups();