Generate random token during installation.

pull/3064/head
Julio Montoya 5 years ago
parent 8cd85a7c69
commit 4c0f287ace
  1. 2
      .env
  2. 2
      main/install/index.php
  3. 8
      main/install/install.lib.php

@ -21,7 +21,7 @@ MAILER_PORT=''
###> symfony/framework-bundle ###
APP_ENV='dev'
APP_DEBUG='1'
APP_SECRET='141af65f23c7935a37b504c422f113b0'
APP_SECRET='{{APP_SECRET}}'
###< symfony/framework-bundle ###
###> chamilo ###

@ -573,6 +573,7 @@ if (isset($_POST['step2'])) {
'{{APP_INSTALLED}}' => 1,
'{{APP_ENCRYPT_METHOD}}' => $encryptPassForm,
'{{APP_URL_APPEND}}' => $urlAppendPath,
'{{APP_SECRET}}' => generateRandomToken(),
];
error_log('Update env file');
@ -633,6 +634,7 @@ if (isset($_POST['step2'])) {
'{{APP_INSTALLED}}' => 1,
'{{APP_ENCRYPT_METHOD}}' => $encryptPassForm,
'{{APP_URL_APPEND}}' => $urlAppendPath,
'{{APP_SECRET}}' => generateRandomToken(),
];
updateEnvFile($distFile, $envFile, $params);

@ -3750,3 +3750,11 @@ function fixPostGroupIds($connection)
}
error_log('End - Fix work documents');
}
/**
* @return string
*/
function generateRandomToken()
{
return hash('sha1', uniqid(mt_rand(), true));
}

Loading…
Cancel
Save