芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/minscoop.com/install/admin.php
systemDirectory, '\\/ ') . DIRECTORY_SEPARATOR . 'bootstrap.php'; $app = require realpath($bootstrap) ?: $bootstrap; $dbArray = new \Config\Database(); $db_host = ''; $db_user = ''; $db_password = ''; $db_name = ''; $timezone = ''; if (!empty($dbArray) && !empty($dbArray->default)) { $db_host = $dbArray->default['hostname']; $db_user = $dbArray->default['username']; $db_password = $dbArray->default['password']; $db_name = $dbArray->default['database']; } require_once 'functions.php'; if (isset($_POST["btn_admin"])) { $license_code = $_POST["license_code"]; $purchase_code = $_POST["purchase_code"]; if (!isset($license_code) || !isset($purchase_code)) { header("Location: index.php"); exit(); } $timezone = trim($_POST['timezone']); $base_url = trim($_POST['base_url']); $admin_username = trim($_POST['admin_username']); $admin_email = trim($_POST['admin_email']); $admin_password = trim($_POST['admin_password']); $password = password_hash($admin_password, PASSWORD_DEFAULT); $slug = str_slug($admin_username); /* Connect */ $connection = mysqli_connect($db_host, $db_user, $db_password, $db_name); $connection->query("SET CHARACTER SET utf8"); $connection->query("SET NAMES utf8"); /* check connection */ if (mysqli_connect_errno()) { $error = 0; } else { $token = uniqid("", TRUE); $token = str_replace(".", "-", $token); $token = $token . "-" . rand(10000000, 99999999); mysqli_query($connection, "INSERT INTO users (id, username, slug, email, email_status, token, password, role, user_type, status, show_email_on_profile, show_rss_feeds) VALUES (1, '" . $admin_username . "', '" . $slug . "', '" . $admin_email . "',1 ,'" . $token . "', '" . $password . "', 'admin', 'registered', 1, 1, 1)"); mysqli_query($connection, "UPDATE general_settings SET timezone='" . $timezone . "' WHERE id='1'"); /* close connection */ mysqli_close($connection); /*write env file*/ $env = "#-------------------------------------------------------------------- # ENVIRONMENT #-------------------------------------------------------------------- CI_ENVIRONMENT = production #-------------------------------------------------------------------- # APP #-------------------------------------------------------------------- app.baseURL = " . trim($base_url) . " #-------------------------------------------------------------------- # LICENSE #-------------------------------------------------------------------- PURCHASE_CODE = " . trim($purchase_code) . " LICENSE_KEY = " . trim($license_code) . " #-------------------------------------------------------------------- # COOKIE #-------------------------------------------------------------------- cookie.prefix = 'vr_'"; $handle = fopen("../.env", "w"); fwrite($handle, trim($env)); fclose($handle); $redir = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); $redir .= "://" . $_SERVER['HTTP_HOST']; $redir .= str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']); $redir = str_replace('install/', '', $redir); header("refresh:5;url=" . $redir); $success = 1; } } else { $license_code = $_GET["license_code"]; $purchase_code = $_GET["purchase_code"]; if (!isset($license_code) || !isset($purchase_code)) { header("Location: index.php"); exit(); } } ?>
Varient - Installer
Varient
Welcome to the Installer
Start
System Requirements
Folder Permissions
Database
Settings
Connect failed! Please check your database credentials.
Completing installation... Please wait!
Settings
Site URL (Examples:
https://abc.com, https://abc.com/blog, https://test.abc.com
)
(If your site does not have SSL, you must enter your site URL with "http". Example: http://abc.com)
Timezone
Select Your Timezone
>
Admin Account
Username
Email
Password
Prev
Finish