AVE.CMS v3.28
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

659 lines
21 KiB

7 years ago
<?php
7 years ago
/**
* AVE.cms
*
* @package AVE.cms
* @version 3.x
* @filesource
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
*
* @license GPL v.2
*/
6 years ago
7 years ago
/**
6 years ago
* Проверка подключения к БД
*
* @param string $dbhost
* @param string $dbuser
* @param string $dbpass
*
* @return bool
7 years ago
*/
6 years ago
function check_mysql_connect ($dbhost = '', $dbuser = '', $dbpass = '')
7 years ago
{
7 years ago
if ($dbhost != '' && $dbuser != '')
6 years ago
if (@mysqli_connect($dbhost, $dbuser, $dbpass))
return true;
7 years ago
7 years ago
return false;
}
7 years ago
6 years ago
/**
* Проверка запроса к БД
*
* @param object $mysql_connect
* @param string $sql
*
* @return bool
*/
function check_mysql_query ($mysql_connect, $sql = '')
7 years ago
{
5 years ago
if ($sql != '' && $mysql_connect != '')
6 years ago
if (@mysqli_query($mysql_connect, $sql))
return true;
7 years ago
7 years ago
return false;
}
7 years ago
6 years ago
/**
* @param string $dbhost
* @param string $dbuser
* @param string $dbpass
* @param string $dbname
*
* @return bool
*/
function check_db_connect ($dbhost = '', $dbuser = '', $dbpass = '', $dbname = '')
7 years ago
{
7 years ago
if ($dbhost != '' && $dbuser != '' && $dbname != '')
6 years ago
if (@mysqli_select_db(@mysqli_connect($dbhost, $dbuser, $dbpass), $dbname))
return true;
7 years ago
return false;
7 years ago
}
6 years ago
/**
* @param $prefix
*
* @return bool
*/
function check_installed ($prefix)
7 years ago
{
global $config;
7 years ago
7 years ago
$mysql = @mysqli_connect($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']);
$query = @mysqli_query($mysql, "SELECT 1 FROM " . $prefix . "_users LIMIT 1");
7 years ago
6 years ago
if (@mysqli_num_rows($query))
return true;
else
return false;
7 years ago
}
7 years ago
6 years ago
/**
*
*/
function check_required ()
7 years ago
{
global $error_is_required, $lang_i;
7 years ago
7 years ago
$required_php = 522;
$required = array();
$required[] = '/install/eula/ru.tpl';
7 years ago
7 years ago
foreach ($required as $is_required)
{
if (@!is_file(BASE_DIR . $is_required))
array_push($error_is_required, $lang_i['error_is_required'] . $is_required . $lang_i['error_is_required_2'] );
}
7 years ago
7 years ago
$myphp = @PHP_VERSION;
6 years ago
7 years ago
if ($myphp)
7 years ago
{
7 years ago
$myphp_v = str_replace('.', '', $myphp);
6 years ago
7 years ago
if ($myphp_v < $required_php)
array_push($error_is_required, $lang_i['phpversion_toold'] . $required_php);
7 years ago
}
}
6 years ago
/**
*
*/
function check_writable ()
7 years ago
{
7 years ago
global $error_is_required, $lang_i;
$writeable = array();
$writeable[] = '/tmp/';
$writeable[] = '/tmp/cache/';
$writeable[] = '/uploads/';
$writeable[] = '/config/db.config.php';
foreach ($writeable as $must_writeable)
7 years ago
{
7 years ago
if (! is_writable(BASE_DIR . $must_writeable))
array_push($error_is_required, $lang_i['error_is_writeable'] . $must_writeable . $lang_i['error_is_writeable_2'] );
7 years ago
}
}
6 years ago
/**
* @param string $name
* @param string $prefix
* @param $mysql_connect
*/
function clean_db ($name, $prefix, $mysql_connect)
7 years ago
{
@mysqli_select_db($mysql_connect, $name);
6 years ago
7 years ago
$query = @mysqli_query($mysql_connect, "SHOW TABLES FROM " . $name);
7 years ago
6 years ago
while ($row = @mysqli_fetch_array($query, MYSQLI_NUM))
7 years ago
if (preg_match("/^" . $prefix . "/", $row[0]))
@mysqli_query($mysql_connect ,"DROP TABLE " . $row[0]);
}
7 years ago
6 years ago
7 years ago
/**
* Convert size from 10M to bytes
*
* @param string $str e.g. 10M
* @return int
*/
function convertSizeToBytes($str)
7 years ago
{
7 years ago
$str = trim($str);
if (strlen($str) > 0)
{
$cLastAlpha = strtolower(substr($str, -1));
$size = intval($str);
switch($cLastAlpha)
{
case 't':
$size *= 1024;
case 'g':
$size *= 1024;
case 'm':
$size *= 1024;
case 'k':
$size *= 1024;
}
}
else
7 years ago
{
7 years ago
$size = 0;
7 years ago
}
7 years ago
return $size;
7 years ago
}
6 years ago
7 years ago
/**
* Get GD version
* @return string
*/
function getGdVersion()
7 years ago
{
7 years ago
if (function_exists('gd_info'))
7 years ago
{
7 years ago
$gd_info = @gd_info();
return preg_replace('/[^0-9\.]/', '', $gd_info['GD Version']);
7 years ago
}
7 years ago
return NULL;
7 years ago
}
7 years ago
6 years ago
7 years ago
/**
* Get PCRE version
* @return string
*/
function getPcreVersion()
{
defined('PCRE_VERSION')
? list($version) = explode(' ', constant('PCRE_VERSION'))
: $version = NULL;
return $version;
}
6 years ago
7 years ago
/**
* Get MySQL version
* @return string
*/
function getMySQLVersion() {
$output = mysqli_get_client_info();
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
return $version[0];
}
6 years ago
/**
* @param $level
* @param $text
*
* @return string
*/
7 years ago
function check_param($level, $text)
7 years ago
{
7 years ago
$level = intval($level);
switch ($level)
7 years ago
{
7 years ago
//Параметр не соответствует.
case 2:
$img = 'ico_delete';
break;
//Несоответствие, не влияющее на функционирование системы.
case 1:
$img = 'ico_ok';
break;
//Параметр соответствует.
case 0:
$img = 'ico_ok_green';
break;
//По умолчанию
default:
$img = 'ico_ok_noproblem';
break;
7 years ago
}
6 years ago
7 years ago
return $img;
7 years ago
}
7 years ago
6 years ago
/* @subpackage install */
error_reporting(E_ERROR);
ini_set('display_errors', 7);
7 years ago
global $config;
ob_start();
define('SETUP', 1);
define('BASE_DIR', str_replace("\\", "/", dirname(dirname(__FILE__))));
6 years ago
//-- Debug Class
require (BASE_DIR . '/class/class.debug.php');
$Debug = new Debug;
7 years ago
if (! is_writable(BASE_DIR . '/tmp/cache/smarty/'))
7 years ago
die('Cache folder is not writeable!');
6 years ago
include (BASE_DIR . '/config/db.config.php');
include (BASE_DIR . '/inc/config.php');
include (BASE_DIR . '/functions/func.common.php');
include (BASE_DIR . '/functions/func.logs.php');
include (BASE_DIR . '/functions/func.helpers.php');
include (BASE_DIR . '/class/class.template.php');
7 years ago
$AVE_Template = new AVE_Template(BASE_DIR . '/install/tpl/');
$lang_file = BASE_DIR . '/install/lang/ru.txt';
$AVE_Template->config_load($lang_file);
$ver = APP_NAME . ' v' . APP_VERSION;
$db_connect = check_db_connect($config['dbhost'], $config['dbuser'], $config['dbpass'], $config['dbname']);
$check_installed = check_installed($config['dbpref']);
7 years ago
if ((true === $db_connect) && $_REQUEST['step'] != 'finish' && check_installed($config['dbpref']))
{
7 years ago
echo '<pre>' . $AVE_Template->get_config_vars('installed') . '</pre>';
exit;
};
$error_is_required = array();
check_required();
check_writable();
// include_once(BASE_DIR . '/inc/errors.php');
$count_error = sizeof((array) $error_is_required);
7 years ago
7 years ago
if (1 == $count_error)
7 years ago
{
7 years ago
$AVE_Template->assign('error_header', $AVE_Template->get_config_vars('erroro'));
7 years ago
}
7 years ago
elseif ($count_error > 1)
7 years ago
{
$AVE_Template->assign('error_header', $AVE_Template->get_config_vars('erroro_more'));
}
7 years ago
7 years ago
if ($count_error > 0 && ! (isset($_REQUEST['force']) && 1 == $_REQUEST['force']))
7 years ago
{
7 years ago
$AVE_Template->assign('error_is_required', $error_is_required);
$AVE_Template->display('error.tpl');
exit;
7 years ago
}
7 years ago
$_REQUEST['step'] = isset($_REQUEST['step']) ? $_REQUEST['step'] : '';
// Минимальные требования к системе
define('PHP_version', '5.6');
define('MySQL_version', '5.0.0');
define('GD_version', '2.0');
define('PCRE_version', '7.0');
define('JSON', $AVE_Template->get_config_vars('mess_on'));
define('MbString', $AVE_Template->get_config_vars('mess_on'));
define('SimpleXML', $AVE_Template->get_config_vars('mess_on'));
define('Iconv', $AVE_Template->get_config_vars('mess_on'));
define('XSLT', $AVE_Template->get_config_vars('mess_supported'));
define('Data_limit', '2'); // Mb
define('TIME_limit', '30'); // Sec
define('DISC_space', '30'); // Mb
define('RAM_space', '32M'); // Mb
define('SAFE_MODE', $AVE_Template->get_config_vars('mess_off'));
define('REGISTER_GLOBALS', $AVE_Template->get_config_vars('mess_off'));
define('MAGIC_QUOTES_GPC', $AVE_Template->get_config_vars('mess_off'));
switch ($_REQUEST['step'])
{
//Начало
case '' :
//Шаг 1
case '1' :
$AVE_Template->display('step1.tpl');
break;
//Шаг 2
case '2' :
$AVE_Template->display('step2.tpl');
break;
//Шаг 3
case '3' :
$test['php_version'] = phpversion();
$test['mysql_version'] = getMySQLVersion();
$test['gd_version'] = getGdVersion();
$test['pcre_version'] = getPcreVersion();
$test['json'] = function_exists('json_encode') ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$test['simplexml'] = function_exists('simplexml_load_string') ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$test['mbstring'] = function_exists('mb_internal_encoding') ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$test['iconv'] = function_exists('iconv') ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$test['xslt'] = (function_exists('xslt_create') || function_exists('domxml_xslt_stylesheet') || (class_exists('DomDocument') && class_exists('XsltProcessor'))) ? XSLT : $AVE_Template->get_config_vars('mess_unsupported');
$test['data_limit'] = ini_get('post_max_size') ? ini_get('post_max_size') : $AVE_Template->get_config_vars('mess_undefined');
$test['time_limit'] = ini_get('max_execution_time') ? ini_get('max_execution_time') : $AVE_Template->get_config_vars('mess_undefined');
$test['disk_space'] = round(@disk_free_space($_SERVER['DOCUMENT_ROOT']) / 1024 / 1024, 2);
$test['memmory_limit'] = ini_get('memory_limit') ? ini_get('memory_limit') : $AVE_Template->get_config_vars('mess_undefined');
$test['s_m'] = (ini_get('safe_mode') == 1) ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$test['r_g'] = (ini_get('register_globals') == 1) ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$test['m_q'] = (ini_get('magic_quotes_gpc') == 1 || ini_get('magic_quotes_runtime') == 1 || ini_get('magic_quotes_sybase') == 1) ? $AVE_Template->get_config_vars('mess_on') : $AVE_Template->get_config_vars('mess_off');
$check['php_version'] = check_param(version_compare(phpversion(), PHP_version, ">=") ? 0 : 2, $test['php_version']);
$check['mysql_version'] = check_param(version_compare(getMySQLVersion(), MySQL_version, ">=") ? 0 : 2, $test['mysql_version']);
$check['gd_version'] = check_param(version_compare($test['gd_version'], GD_version, ">=") ? 0 : 2, $test['gd_version']);
$check['pcre_version'] = check_param(version_compare($test['pcre_version'], PCRE_version, ">=") ? 0 : 2, $test['pcre_version']);
$check['mbstring'] = check_param(function_exists('mb_internal_encoding') ? 0 : 2, $test['mbstring']);
$check['json'] = check_param(function_exists('json_encode') ? 0 : 2, $test['json']);
$check['simplexml'] = check_param(function_exists('simplexml_load_string') ? 0 : 2, $test['simplexml']);
$check['iconv'] = check_param(function_exists('iconv') ? 0 : 2, $test['iconv']);
$check['xslt'] = check_param(($test['xslt'] == XSLT) ? 0 : 2, $test['xslt']);
$check['data_limit'] = check_param(($test['data_limit'] != $AVE_Template->get_config_vars('mess_undefined') && version_compare($test['data_limit'], Data_limit, ">=")) ? 0 : 2, $test['data_limit']);
$check['time_limit'] = check_param(($test['time_limit'] != $AVE_Template->get_config_vars('mess_undefined') && $test['time_limit'] >= TIME_limit) ? 0 : 2, ($test['time_limit'] != $AVE_Template->get_config_vars('mess_undefined')) ? $test['time_limit'] . " " . $AVE_Template->get_config_vars('seconds') : $t_l);
$check['disk_space'] = check_param(($test['disk_space'] != $AVE_Template->get_config_vars('mess_undefined') && $test['disk_space'] >= DISC_space) ? 0 : 2, ($test['disk_space'] != $AVE_Template->get_config_vars('mess_undefined')) ? $test['disk_space'].$AVE_Template->get_config_vars('megabytes') : $test['disk_space']);
$check['memmory_limit'] = check_param(($test['memmory_limit'] != $AVE_Template->get_config_vars('mess_undefined') && convertSizeToBytes($test['memmory_limit']) >= convertSizeToBytes(RAM_space)) ? 0 : (($test['memmory_limit'] != $AVE_Template->get_config_vars('mess_undefined')) ? 2 : 1), $test['memmory_limit']);
$check['s_m'] = check_param(($test['s_m'] == SAFE_MODE) ? 0 : 1, $test['s_m']);
$check['r_g'] = check_param(($test['r_g'] == REGISTER_GLOBALS) ? 0 : 1, $test['r_g']);
$check['m_q'] = check_param(($test['m_q'] == MAGIC_QUOTES_GPC) ? 0 : 1, $test['m_q']);
$AVE_Template->assign('check', $check);
$AVE_Template->assign('test', $test);
$AVE_Template->display('step3.tpl');
break;
//Шаг 4
case '4' :
if (!empty($_POST['dbname']) && !empty($_POST['dbprefix']))
{
$db_connect = check_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']);
7 years ago
7 years ago
if (true === $db_connect) {
$mysql_connect = @mysqli_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass']);
@mysqli_select_db($mysql_connect, $_POST['dbname']);
}
7 years ago
7 years ago
// Очищаем бд (по префиксу)
if (isset($_REQUEST["dbclean"]) && $_REQUEST["dbclean"] == "1") {
clean_db($_POST['dbname'], $_POST['dbprefix'], $mysql_connect);
}
7 years ago
7 years ago
// Создать новую БД
6 years ago
if (isset($_REQUEST['dbcreat']))
{
7 years ago
$link = check_mysql_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass']);
7 years ago
6 years ago
if (false === $link)
5 years ago
$AVE_Template->assign('warning', $AVE_Template->get_config_vars('error_is_link') . mysqli_error());
6 years ago
else
7 years ago
$mysqli_connect = @mysqli_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass']);
7 years ago
6 years ago
if (false === $db_connect)
{
7 years ago
@mysqli_query($mysqli_connect, "SET collation_server = 'utf8_general_ci'");
@mysqli_query($mysqli_connect, "SET character_set_server = 'utf8'");
7 years ago
7 years ago
$sql = 'CREATE DATABASE ' . $_POST['dbname'];
7 years ago
6 years ago
if (false === check_mysql_query($mysqli_connect, $sql))
5 years ago
$AVE_Template->assign('warning', $AVE_Template->get_config_vars('error_is_create') . mysqli_error() . "\n");
7 years ago
}
}
7 years ago
$check_installed = check_installed($_POST['dbprefix']);
7 years ago
7 years ago
$connect = check_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']);
7 years ago
5 years ago
$config = [
'dbhost' => $_POST['dbhost'],
'dbuser' => $_POST['dbuser'],
'dbpass' => $_POST['dbpass'],
'dbname' => $_POST['dbname'],
'dbpref' => $_POST['dbpref'],
'dbport' => null,
'dbsock' => null
];
7 years ago
if (true === $connect && false === $check_installed)
7 years ago
{
7 years ago
if (! @is_writeable(BASE_DIR . '/config/db.config.php'))
{
$AVE_Template->assign('config_isnt_writeable', 1);
$AVE_Template->display('error.tpl');
exit;
}
7 years ago
7 years ago
$fp = @fopen(BASE_DIR . '/config/db.config.php', 'w+');
6 years ago
// Записываем данные для подключения
7 years ago
@fwrite($fp, "<?php\n"
6 years ago
. "\t\$config = [\n"
. "\t\t'dbhost' => \"" . stripslashes(trim($_POST['dbhost'])) . "\",\n"
. "\t\t'dbuser' => \"" . stripslashes(trim($_POST['dbuser'])) . "\",\n"
. "\t\t'dbpass' => \"" . stripslashes(trim($_POST['dbpass'])) . "\",\n"
. "\t\t'dbname' => \"" . stripslashes(trim($_POST['dbname'])) . "\",\n"
. "\t\t'dbpref' => \"" . stripslashes(trim($_POST['dbprefix'])) . "\",\n"
. "\t\t'dbport' => null,\n"
. "\t\t'dbsock' => null\n"
. "\t];\n"
7 years ago
. "?>"
);
6 years ago
7 years ago
@fclose($fp);
7 years ago
5 years ago
//-- Если параметры не указаны, прерываем работу
if (! file_exists(BASE_DIR . '/config/db.config.php') || ! filesize(BASE_DIR . '/config/db.config.php'))
die('Not writing config file');
6 years ago
// Класс для работы с БД
require_once (BASE_DIR . '/class/class.database.php');
5 years ago
//-- Подключаем конфигурационный файл с параметрами подключения
require_once (BASE_DIR . '/config/db.config.php');
6 years ago
//-- Если не существует объекта по работе с БД
if (! isset($AVE_DB))
{
//-- Если параметры не указаны, прерываем работу
5 years ago
if (! isset($config) || empty($config))
die('No config data');
6 years ago
//-- Если константа префикса таблиц не задана, принудительно определяем ее на основании параметров в файле db.config.php
if (! defined('PREFIX'))
define('PREFIX', $config['dbpref']);
//-- Создаем объект для работы с БД
try {
$AVE_DB = AVE_DB::getInstance($config)
//-- Назначаем кодировку
->setCharset('utf8')
//-- Назначаем БД
->setDatabaseName($config['dbname']);
}
catch (AVE_DB_Exception $e)
{
ob_start();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
header('X-Powered-By:');
echo $e->getMessage();
die;
}
unset ($config);
}
// Открываем файл структуры БД
7 years ago
$filename = BASE_DIR . '/install/structure_base.sql';
7 years ago
7 years ago
$handle = fopen($filename, 'r');
$db_structure = fread($handle, filesize($filename));
6 years ago
7 years ago
fclose($handle);
7 years ago
6 years ago
// Подставляем префикс
7 years ago
$db_structure = str_replace('%%PRFX%%', $_POST['dbprefix'], $db_structure);
7 years ago
6 years ago
// Массив запросов
7 years ago
$ar = explode('#inst#', $db_structure);
6 years ago
foreach ($ar as $sql)
if (! empty($sql))
$AVE_DB->Query($sql);
7 years ago
$AVE_Template->display('step5.tpl');
exit;
}
elseif (true === $connect && true === $check_installed)
$AVE_Template->assign('installed', $AVE_Template->get_config_vars('database_installed'));
else
$AVE_Template->assign('warning', $AVE_Template->get_config_vars('database_not_connect'));
7 years ago
}
else
{
7 years ago
$dbpref = make_random_string(5, 'abcdefghijklmnopqrstuvwxyz0123456789');
$AVE_Template->assign('dbpref', $dbpref);
7 years ago
}
7 years ago
$AVE_Template->display('step4.tpl');
break;
7 years ago
7 years ago
case '5' :
$_POST['email'] = chop($_POST['email']);
$_POST['username'] = chop($_POST['username']);
7 years ago
7 years ago
$regex_username = '/[^\w-]/';
$regex_password = '/[^\x20-\xFF]/';
$regex_email = '/^[\w.-]+@[a-z0-9.-]+\.(?:[a-z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)$/i';
7 years ago
6 years ago
// Класс для работы с БД
require_once (BASE_DIR . '/class/class.database.php');
//-- Если не существует объекта по работе с БД
if (! isset($AVE_DB))
{
//-- Подключаем конфигурационный файл с параметрами подключения
require_once (BASE_DIR . '/config/db.config.php');
//-- Если параметры не указаны, прерываем работу
if (! isset($config))
exit;
//-- Если константа префикса таблиц не задана, принудительно определяем ее на основании параметров в файле db.config.php
if (! defined('PREFIX'))
define('PREFIX', $config['dbpref']);
//-- Создаем объект для работы с БД
try {
$AVE_DB = AVE_DB::getInstance($config)
//-- Назначаем кодировку
->setCharset('utf8')
//-- Назначаем БД
->setDatabaseName($config['dbname']);
}
catch (AVE_DB_Exception $e)
{
ob_start();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
header('X-Powered-By:');
echo $e->getMessage();
die;
}
}
7 years ago
$errors = array();
if ($_POST['email'] == '') array_push($errors, $AVE_Template->get_config_vars('noemail'));
if (! preg_match($regex_email, $_POST['email'])) array_push($errors, $AVE_Template->get_config_vars('email_no_specialchars'));
if (empty($_POST['pass']) || preg_match($regex_password, $_POST['pass'])) array_push($errors, $AVE_Template->get_config_vars('check_pass'));
if (strlen($_POST['pass']) < 5) array_push($errors, $AVE_Template->get_config_vars('pass_too_small'));
if (empty($_POST['username']) || preg_match($regex_username, $_POST['username'])) array_push($errors, $AVE_Template->get_config_vars('check_username'));
7 years ago
7 years ago
$AVE_Template->assign('errors', $errors);
7 years ago
7 years ago
if (true === $db_connect && ! sizeof($errors))
7 years ago
{
7 years ago
if (isset($_POST['demo']) && 1 == $_POST['demo'])
$filename = BASE_DIR . '/install/data_demo.sql';
else
6 years ago
$filename = BASE_DIR . '/install/data_base.sql';
7 years ago
$handle = fopen($filename, 'r');
$dbin = fread($handle, filesize($filename));
fclose($handle);
$salt = make_random_string();
$hash = md5(md5($_POST['pass'] . $salt));
$dbin = str_replace('%%SITENAME%%', $ver, $dbin);
$dbin = str_replace('%%PRFX%%', $config['dbpref'], $dbin);
$dbin = str_replace('%%EMAIL%%', $_POST['email'], $dbin);
$dbin = str_replace('%%SALT%%', $salt, $dbin);
$dbin = str_replace('%%PASS%%', $hash, $dbin);
$dbin = str_replace('%%TIME%%', time(), $dbin);
$dbin = str_replace('%%FIRSTNAME%%', $_POST['firstname'], $dbin);
$dbin = str_replace('%%LASTNAME%%', $_POST['lastname'], $dbin);
$dbin = str_replace('%%USERNAME%%', $_POST['username'], $dbin);
7 years ago
7 years ago
$ar = explode('#inst#', $dbin);
7 years ago
6 years ago
foreach ($ar as $sql)
if (! empty($sql))
$AVE_DB->Query($sql);
7 years ago
7 years ago
$AVE_Template->display('step6.tpl');
7 years ago
7 years ago
exit;
}
$AVE_Template->display('step5.tpl');
break;
}
7 years ago
?>