if ($db_connect && $_REQUEST['step'] != 'finish' && check_installed($config['dbpref'])) { echo '<pre>' . $lang_i['installed'] . '</pre>'; exit; } $error_is_required = array(); check_required(); check_writable(); $count_error = sizeof((array) $error_is_required); if (1 == $count_error) { $AVE_Template->assign('error_header', $lang_i['erroro']); } elseif ($count_error > 1) { $AVE_Template->assign('error_header', $lang_i['erroro_more']); } if ($count_error > 0 && !(isset($_REQUEST['force']) && 1 == $_REQUEST['force'])) { $AVE_Template->assign('error_is_required', $error_is_required); $AVE_Template->display('error.tpl'); exit; } $_REQUEST['step'] = isset($_REQUEST['step']) ? $_REQUEST['step'] : ''; switch ($_REQUEST['step']) { case '': case '1': $AVE_Template->display('step1.tpl'); break; case '2': if (false === $db_connect && !empty($_POST['dbname']) && !empty($_POST['dbprefix'])) { $db_connect = check_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']); if ($_REQUEST["clean_db"]) { clean_db($_POST['dbname'], $_POST['dbprefix']); } $check_installed = check_installed($_POST['dbprefix']);
} require BASE_DIR . '/inc/init.php'; if (!isset($_SESSION['user_id'])) { header('Location:index.php'); exit; } define('ACP', 1); define('SESSION', session_id()); $tpl_dir = 'templates/' . (empty($_SESSION['admin_theme']) ? DEFAULT_ADMIN_THEME_FOLDER : $_SESSION['admin_theme']); $AVE_Template = new AVE_Template($tpl_dir . '/browser'); $AVE_Template->assign('tpl_dir', $tpl_dir); $AVE_Template->assign('sess', SESSION); $AVE_Template->config_load(BASE_DIR . '/admin/lang/' . (empty($_SESSION['admin_language']) ? $_SESSION['user_language'] : $_SESSION['admin_language']) . '/main.txt'); $_REQUEST['action'] = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; if ($_REQUEST['action'] == 'upload') { $AVE_Template->display('browser_upload.tpl'); exit; } if ($_REQUEST['action'] == 'upload2') { for ($i = 0; $i < count($_FILES['upfile']['tmp_name']); $i++) { $d_name = strtolower(trim($_FILES['upfile']['name'][$i])); $d_name = str_replace(' ', '', $d_name); $d_tmp = $_FILES['upfile']['tmp_name'][$i]; if ($_FILES['upfile']['type'][$i] == 'image/pjpeg' || $_FILES['upfile']['type'][$i] == 'image/jpeg' || $_FILES['upfile']['type'][$i] == 'image/x-png' || $_FILES['upfile']['type'][$i] == 'image/png') { if (file_exists(UPDIR . $_REQUEST['pfad'] . $d_name)) { $expl = explode('.', $d_name); $d_name = $expl[0] . date('dhi') . '.' . $expl[1]; } reportLog($_SESSION['user_name'] . ' - загрузил изображение в (' . stripslashes($_REQUEST['pfad']) . $d_name . ')', 2, 2); @move_uploaded_file($d_tmp, UPDIR . $_REQUEST['pfad'] . $d_name); @chmod(UPDIR . $_REQUEST['pfad'] . $d_name, 0777);