diff --git a/site-settings.php b/site-settings.php index c8ad00c..2d2e0e8 100755 --- a/site-settings.php +++ b/site-settings.php @@ -28,6 +28,11 @@ if(file_exists('vendor/autoload.php')) { require_once 'vendor/autoload.php'; $Parsedown = new Parsedown(); + + if(!file_exists($dir_files.'/encryption.key')) { + $enckey = KeyFactory::generateEncryptionKey(); + KeyFactory::save($enckey, $dir_files.'/encryption.key'); + } } require_once 'site-functions.php'; @@ -35,7 +40,7 @@ - if(!empty($database_host) AND !empty($database_name) AND !empty($database_user) AND !empty($database_pass)) { + if(!empty($database_host) AND !empty($database_port) AND !empty($database_name) AND !empty($database_user) AND !empty($database_pass)) { try { $sql = new PDO('pgsql:host='.$database_host.';port='.$database_port.';dbname='.$database_name.';user='.$database_user.';password='.$database_pass); $sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);