<?php

# Security settings
if (!defined('INSTALLED') || INSTALLED) {
	include_once(APP . 'Config/config.php');

	if (!preg_match('~^[a-z0-9]{40,}$~ i', SECURITY_SALT)) {
		die('Security salt incorrect. Please reinstall.');
	}

	if (!preg_match('~^[0-9]{30}$~', SECURITY_SEED)) {
		die('Security seed incorrect. Please reinstall.');
	}

	# Security values for installation
} else {
	define('SECURITY_SEED', '91090975810790879157629159707');            # [0-9]{20}
	define('SECURITY_SALT', 'SDJj128jsajdSDSd12djaolacks0923kfDo219sd'); # [a-zA-Z0-9]{40}
}

# Global security
Configure::write('Security.level', 'medium');
Configure::write('Security.seed', SECURITY_SEED);
Configure::write('Security.salt', SECURITY_SALT);
