NamelessMC / Nameless

NamelessMC is a free, easy to use & powerful website software for your Minecraft server, which includes a large range of features.
https://namelessmc.com/
MIT License
608 stars 311 forks source link

Database initialisation #539

Closed zikycz closed 7 years ago

zikycz commented 7 years ago

Hello, what can I do so that I can continue with the installation continue?

https://ctrlv.cz/ecRg

samerton commented 7 years ago

Can you check your database using something like phpMyAdmin to see if any tables have been created?

If not, can you try replacing pages/install.php with this code to see if any errors appear during the database step.

zikycz commented 7 years ago

<?php /*

require('core/includes/password.php'); // Require password compatibility require('core/integration/uuid.php'); // Require UUID integration

if(isset($_GET["step"])){ $step = strtolower(htmlspecialchars($_GET["step"])); } else { $step = "start"; } ?>

<!DOCTYPE html>

NamelessMC • Install

Are you upgrading from 0.4.1?

Note: if you're upgrading from a 1.x version to another 1.x version, you will need to follow the instructions from within the AdminCP's Update tab, rather than running through the installer again.

You will need the following:
  • A MySQL database on the webserver
  • PHP version 5.3+
The following are not required, but are recommended:
Currently data may be imported from:
  • XenForo
Support for the following is planned:
  • phpBB
  • IPBoard
  • MyBB
  • Vanilla
  • ModernBB
  • Wordpress (with optional support for bbPress)


'; $success = '


'; $warning = '


'; ?> '; // Remove error temporarily //$php_error = true; } else { echo 'PHP mysqlnd Extension - ' . $success; } if(!function_exists("mcrypt_encrypt")) { echo 'PHP mcrypt Extension - ' . $error; $php_error = true; } else { echo 'PHP mcrypt Extension - ' . $success; } if(!function_exists('curl_version')){ echo 'PHP cURL Extension - ' . $error; $php_error = true; } else { echo 'PHP cURL Extension - ' . $success; } if(!class_exists("DOMDocument")){ // if there is a fatal error on the Requirements step, this is missing echo 'PHP DOMDocument Class - ' . $error; $php_error = true; } else { echo 'PHP DOMDocument Class - ' . $success; } ?>
You must be running at least PHP version 5.3 with the required extensions enabled in order to proceed with installation.
check($_POST, array( 'db_address' => array( 'required' => true ), 'db_username' => array( 'required' => true ), 'db_name' => array( 'required' => true ) )); if($validation->passed()) { $db_password = Input::get('db_password'); if(!empty($db_password)){ $db_password = Input::get('db_password'); } else { $db_password = ''; } $prefix = Input::get('prefix'); if(empty($prefix)){ $prefix = ''; } $prefix = htmlspecialchars($prefix); $db_prefix = "nl1_"; $cookie_name = "nlmc"; /* * Test connection - use MySQLi here, as the config for PDO is not written */ $mysqli = new mysqli(Input::get('db_address'), Input::get('db_username'), $db_password, Input::get('db_name')); if($mysqli->connect_errno) { $mysql_error = $mysqli->connect_errno . ' - ' . $mysqli->connect_error; } else { /* * Write to config file */ $insert = ' array(' . PHP_EOL . ' "host" => "' . Input::get('db_address') . '", // Web server database IP (Likely to be 127.0.0.1)' . PHP_EOL . ' "username" => "' . Input::get('db_username') . '", // Web server database username' . PHP_EOL . ' "password" => \'' . $db_password . '\', // Web server database password' . PHP_EOL . ' "db" => "' . Input::get('db_name') . '", // Web server database name' . PHP_EOL . ' "prefix" => "' . $db_prefix . '" // Web server table prefix' . PHP_EOL . ' ),' . PHP_EOL . ' "remember" => array(' . PHP_EOL . ' "cookie_name" => "' . $cookie_name . '", // Name for website cookies' . PHP_EOL . ' "cookie_expiry" => 604800' . PHP_EOL . ' ),' . PHP_EOL . ' "session" => array(' . PHP_EOL . ' "session_name" => "user",' . PHP_EOL . ' "admin_name" => "admin",' . PHP_EOL . ' "token_name" => "token"' . PHP_EOL . ' )' . PHP_EOL . ');'; if(is_writable('core/config.php')){ $file = fopen('core/config.php','w'); fwrite($file, $insert); fclose($file); $queries = new Queries(); $queries->dbInitialise($db_prefix); // Initialise the database $query = $mysqli->query("SELECT * FROM {$prefix}custom_pages"); while($row = $query->fetch_assoc()){ $queries->create('custom_pages', array( 'url' => $row['url'], 'title' => $row['title'], 'content' => $row['content'], 'link_location' => 1 )); } $query = $mysqli->query("INSERT nl1_forums SELECT * FROM {$prefix}forums"); $query = $mysqli->query("INSERT nl1_forums_permissions SELECT * FROM {$prefix}forums_permissions"); $query = $mysqli->query("INSERT nl1_friends SELECT * FROM {$prefix}friends"); $query = $mysqli->query("SELECT * FROM {$prefix}groups"); while($row = $query->fetch_assoc()){ $mod_cp = 0; $admin_cp = 0; $staff = 0; if($row['id'] == 2){ $mod_cp = 1; $admin_cp = 1; $staff = 1; } else if($row['id'] == 3){ $mod_cp = 1; $staff = 1; } $queries->create('groups', array( 'id' => $row['id'], 'name' => $row['name'], 'buycraft_id' => $row['buycraft_id'], 'group_html' => $row['group_html'], 'group_html_lg' => $row['group_html_lg'], 'mod_cp' => $mod_cp, 'admin_cp' => $admin_cp, 'staff' => $staff )); } $query = $mysqli->query("INSERT nl1_infractions SELECT * FROM {$prefix}infractions"); $query = $mysqli->query("SELECT * FROM {$prefix}mc_servers"); while($row = $query->fetch_assoc()){ if(isset($row['pre'])){ $pre = $row['pre']; } else { $pre = 0; } if(isset($row['player_list'])){ $player_list = $row['player_list']; } else { $player_list = 0; } $queries->create('mc_servers', array( 'ip' => $row['ip'], 'name' => $row['name'], 'is_default' => $row['is_default'], 'display' => $row['display'], 'pre' => $pre, 'player_list' => $player_list )); } $query = $mysqli->query("INSERT nl1_posts SELECT * FROM {$prefix}posts"); $query = $mysqli->query("INSERT nl1_private_messages SELECT * FROM {$prefix}private_messages"); $query = $mysqli->query("INSERT nl1_private_messages_users SELECT * FROM {$prefix}private_messages_users"); $query = $mysqli->query("INSERT nl1_reports SELECT * FROM {$prefix}reports"); $query = $mysqli->query("INSERT nl1_reports_comments SELECT * FROM {$prefix}reports_comments"); $query = $mysqli->query("INSERT nl1_reputation SELECT * FROM {$prefix}reputation"); $query = $mysqli->query("INSERT nl1_settings SELECT * FROM {$prefix}settings"); $query = $mysqli->query("SELECT * FROM {$prefix}topics"); while($row = $query->fetch_assoc()){ $queries->create('topics', array( 'id' => $row['id'], 'forum_id' => $row['forum_id'], 'topic_title' => $row['topic_title'], 'topic_creator' => $row['topic_creator'], 'topic_last_user' => $row['topic_last_user'], 'topic_date' => $row['topic_date'], 'topic_reply_date' => $row['topic_reply_date'], 'topic_views' => $row['topic_views'], 'locked' => $row['locked'], 'sticky' => $row['sticky'], 'label' => null )); } $query = $mysqli->query("INSERT nl1_users SELECT * FROM {$prefix}users"); $query = $mysqli->query("INSERT nl1_users_admin_session SELECT * FROM {$prefix}users_admin_session"); $query = $mysqli->query("INSERT nl1_users_session SELECT * FROM {$prefix}users_session"); $query = $mysqli->query("INSERT nl1_uuid_cache SELECT * FROM {$prefix}uuid_cache"); // Core Modules $modules_initialised = $queries->getWhere('core_modules', array('id', '<>', 0)); if(!count($modules_initialised)){ $queries->create('core_modules', array( 'name' => 'Google_Analytics', 'enabled' => 0 )); $queries->create('core_modules', array( 'name' => 'Social_Media', 'enabled' => 1 )); $queries->create('core_modules', array( 'name' => 'Registration', 'enabled' => 1 )); $queries->create('core_modules', array( 'name' => 'Voice_Server_Module', 'enabled' => 0 )); $queries->create('core_modules', array( 'name' => 'Staff_Applications', 'enabled' => 0 )); } // Themes $themes_initialised = $queries->getWhere('themes', array('id', '<>', 0)); if(!count($themes_initialised)){ $themes = array( 1 => array( 'name' => 'Bootstrap', 'enabled' => 1 ), 2 => array( 'name' => 'Cerulean', 'enabled' => 0 ), 3 => array( 'name' => 'Cosmo', 'enabled' => 0 ), 4 => array( 'name' => 'Cyborg', 'enabled' => 0 ), 5 => array( 'name' => 'Darkly', 'enabled' => 0 ), 6 => array( 'name' => 'Flatly', 'enabled' => 0 ), 7 => array( 'name' => 'Journal', 'enabled' => 0 ), 8 => array( 'name' => 'Lumen', 'enabled' => 0 ), 9 => array( 'name' => 'Paper', 'enabled' => 0 ), 10 => array( 'name' => 'Readable', 'enabled' => 0 ), 11 => array( 'name' => 'Sandstone', 'enabled' => 0 ), 12 => array( 'name' => 'Simplex', 'enabled' => 0 ), 13 => array( 'name' => 'Slate', 'enabled' => 0 ), 14 => array( 'name' => 'Spacelab', 'enabled' => 0 ), 15 => array( 'name' => 'Superhero', 'enabled' => 0 ), 16 => array( 'name' => 'United', 'enabled' => 0 ), 17 => array( 'name' => 'Yeti', 'enabled' => 0 ) ); foreach($themes as $theme){ $queries->create('themes', array( 'enabled' => $theme['enabled'], 'name' => $theme['name'] )); } } // Templates $queries->create('templates', array( 'enabled' => 1, 'name' => 'Default' )); // Cache $c = new Cache(); $c->setCache('themecache'); $c->store('theme', 'Bootstrap'); $c->store('inverse_navbar', '0'); // Todo: update site name //$c->setCache('sitenamecache'); //$c->store('sitename', htmlspecialchars(Input::get('sitename'))); $c->setCache('templatecache'); $c->store('template', 'Default'); $c->setCache('languagecache'); $c->store('language', 'EnglishUK'); $c->setCache('page_load_cache'); $c->store('page_load', 0); $plugin_key = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 32); // New settings $queries->update('settings', 13, array( 'value' => 'By registering on our website, you agree to the following:

This website uses "Nameless" website software. The "Nameless" software creators will not be held responsible for any content that may be experienced whilst browsing this site, nor are they responsible for any loss of data which may come about, for example a hacking attempt. The website is run independently from the software creators, and any content is the responsibility of the website administration.

' )); $queries->create('settings', array( 'name' => 'mc_api_key', 'value' => $plugin_key )); $queries->create('settings', array( 'name' => 'phpmailer', 'value' => '0' )); $queries->create('settings', array( 'name' => 'phpmailer_type', 'value' => 'smtp' )); $external_query = $queries->getWhere('settings', array('name', '=', 'external_query')); if(!count($external_query)){ $queries->create('settings', array( 'name' => 'external_query', 'value' => 'false' )); } $queries->create('settings', array( 'name' => 'use_plugin', 'value' => '0' )); $queries->create('settings', array( 'name' => 'uuid_linking', 'value' => '1' )); $queries->create('settings', array( 'name' => 'inverse_navbar', 'value' => '0' )); $queries->create('settings', array( 'name' => 'error_reporting', 'value' => '0' )); $queries->create('settings', array( 'name' => 'ga_script', 'value' => 'null' )); $queries->create('settings', array( 'name' => 'avatar_api', 'value' => 'cravatar' )); // Languages $queries->create('settings', array( 'name' => 'language', 'value' => 'EnglishUK' )); $queries->create('settings', array( 'name' => 't_and_c_site', 'value' => '

You agree to be bound by our website rules and any laws which may apply to this website and your participation.

The website administration have the right to terminate your account at any time, delete any content you may have posted, and your IP address and any data you input to the website is recorded to assist the site staff with their moderation duties.

The site administration have the right to change these terms and conditions, and any site rules, at any point without warning. Whilst you may be informed of any changes, it is your responsibility to check these terms and the rules at any point.

' )); $queries->create('settings', array( 'name' => 'incoming_email', 'value' => '' )); $queries->create('settings', array( 'name' => 'query_update', 'value' => 'false' )); $queries->create('settings', array( 'name' => 'mc_status_module', 'value' => 'false' )); $queries->create('settings', array( 'name' => 'recaptcha_secret', 'value' => 'null' )); $queries->create('settings', array( 'name' => 'email_verification', 'value' => '1' )); $queries->create('settings', array( 'name' => 'play_page_enabled', 'value' => '1' )); $queries->create('settings', array( 'name' => 'followers', 'value' => '0' )); $queries->create('settings', array( 'name' => 'discord', 'value' => '0' )); $queries->create('settings', array( 'name' => 'avatar_type', 'value' => 'helmavatar' )); $queries->create('settings', array( 'name' => 'use_mcassoc', 'value' => '0' )); $queries->create('settings', array( 'name' => 'mcassoc_key', 'value' => '' )); $queries->create('settings', array( 'name' => 'mcassoc_instance', 'value' => '' )); $queries->create('settings', array( 'name' => 'twitter_style', 'value' => 'light' )); // Version update $version_id = $queries->getWhere('settings', array('name', '=', 'version')); $queries->update('settings', $version_id[0]->id, array( 'value' => '1.0.15' )); // Close connections $mysqli->close(); echo ''; die(); } else { /* * File not writeable */ ?>
Your core/config.php file is not writeable. Please check your file permissions.

check($_POST, array( 'db_address' => array( 'required' => true ), 'db_username' => array( 'required' => true ), 'db_name' => array( 'required' => true ) )); if($validation->passed()) { $db_password = ""; $db_prefix = "nl1_"; $cookie_name = "nlmc"; $db_password = Input::get('db_password'); if(!empty($db_password)){ $db_password = Input::get('db_password'); } /* * Test connection - use MySQLi here, as the config for PDO is not written */ $mysqli = new mysqli(Input::get('db_address'), Input::get('db_username'), $db_password, Input::get('db_name')); if($mysqli->connect_errno) { $mysql_error = $mysqli->connect_errno . ' - ' . $mysqli->connect_error; } else { /* * Write to config file */ $insert = ' array(' . PHP_EOL . ' "host" => "' . Input::get('db_address') . '", // Web server database IP (Likely to be 127.0.0.1)' . PHP_EOL . ' "username" => "' . Input::get('db_username') . '", // Web server database username' . PHP_EOL . ' "password" => \'' . $db_password . '\', // Web server database password' . PHP_EOL . ' "db" => "' . Input::get('db_name') . '", // Web server database name' . PHP_EOL . ' "prefix" => "' . $db_prefix . '" // Web server table prefix' . PHP_EOL . ' ),' . PHP_EOL . ' "remember" => array(' . PHP_EOL . ' "cookie_name" => "' . $cookie_name . '", // Name for website cookies' . PHP_EOL . ' "cookie_expiry" => 604800' . PHP_EOL . ' ),' . PHP_EOL . ' "session" => array(' . PHP_EOL . ' "session_name" => "user",' . PHP_EOL . ' "admin_name" => "admin",' . PHP_EOL . ' "token_name" => "token"' . PHP_EOL . ' )' . PHP_EOL . ');'; if(is_writable('core/config.php')){ $file = fopen('core/config.php','w'); fwrite($file, $insert); fclose($file); echo ''; die(); } else { /* * File not writeable */ ?>
Your core/config.php file is not writeable. Please check your file permissions.
errors() as $error){ if(strstr($error, 'db_address')){ $errors .= "Please input a database address
"; } if(strstr($error, "db_username")){ $errors .= "Please input a database username
"; } if(strstr($error, "db_name")){ $errors .= "Please input a database name
"; } } } } ?>
Fields marked * are required
dbInitialise($prefix)) { ?>
The database was initialised successfully, and you may now progress with the installation.
Database initialisation failed.
'; } } else if($step === "settings"){ if(Input::exists()){ $validate = new Validate(); $validation = $validate->check($_POST, array( 'site_name' => array( 'required' => true, 'min' => 2, 'max' => 1024 ), 'outgoing_email' => array( 'required' => true, 'min' => 2, 'max' => 1024 ), 'incoming_email' => array( 'required' => true, 'min' => 2, 'max' => 1024 ) )); if($validation->passed()) { if(!isset($queries)){ $queries = new Queries(); // Initialise queries } $plugin_key = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 32); $uid = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 62); // Get current unix time $date = new DateTime(); $date = $date->getTimestamp(); $data = array( 0 => array( 'name' => 'sitename', 'value' => htmlspecialchars(Input::get('site_name')) ), 1 => array( 'name' => 'maintenance', 'value' => 'false' ), 2 => array( 'name' => 'outgoing_email', 'value' => htmlspecialchars(Input::get('outgoing_email')) ), 3 => array( 'name' => 'incoming_email', 'value' => htmlspecialchars(Input::get('incoming_email')) ), 4 => array( 'name' => 'youtube_url', 'value' => 'null' ), 5 => array( 'name' => 'twitter_url', 'value' => 'null' ), 6 => array( 'name' => 'gplus_url', 'value' => 'null' ), 7 => array( 'name' => 'fb_url', 'value' => 'null' ), 8 => array( 'name' => 'twitter_feed_id', 'value' => 'null' ), 9 => array( 'name' => 'recaptcha', 'value' => 'false' ), 10 => array( 'name' => 'recaptcha_key', 'value' => 'null' ), 11 => array( 'name' => 't_and_c', 'value' => 'By registering on our website, you agree to the following:

This website uses "Nameless" website software. The "Nameless" software creators will not be held responsible for any content that may be experienced whilst browsing this site, nor are they responsible for any loss of data which may come about, for example a hacking attempt. The website is run independently from the software creators, and any content is the responsibility of the website administration.

' ), 12 => array( 'name' => 't_and_c_site', 'value' => '

You agree to be bound by our website rules and any laws which may apply to this website and your participation.

The website administration have the right to terminate your account at any time, delete any content you may have posted, and your IP address and any data you input to the website is recorded to assist the site staff with their moderation duties.

The site administration have the right to change these terms and conditions, and any site rules, at any point without warning. Whilst you may be informed of any changes, it is your responsibility to check these terms and the rules at any point.

' ), 13 => array( 'name' => 'displaynames', 'value' => 'false' ), 14 => array( 'name' => 'ga_script', 'value' => 'null' ), 15 => array( 'name' => 'avatar_api', 'value' => 'cravatar' ), 16 => array( 'name' => 'language', 'value' => 'EnglishUK' ), 17 => array( 'name' => 'forum_layout', 'value' => '1' ), 18 => array( 'name' => 'error_reporting', 'value' => '0' ), 19 => array( 'name' => 'inverse_navbar', 'value' => '0' ), 20 => array( 'name' => 'unique_id', 'value' => $uid ), 21 => array( 'name' => 'uuid_linking', 'value' => '1' ), 22 => array( 'name' => 'user_avatars', 'value' => '0' ), 23 => array( 'name' => 'use_plugin', 'value' => '0' ), 24 => array( 'name' => 'external_query', 'value' => 'false' ), 25 => array( 'name' => 'phpmailer', 'value' => '0' ), 26 => array( 'name' => 'phpmailer_type', 'value' => 'smtp' ), 27 => array( 'name' => 'mc_api_key', 'value' => $plugin_key ), 28 => array( 'name' => 'version', 'value' => '1.0.15' ), 29 => array( 'name' => 'version_checked', 'value' => $date ), 30 => array( 'name' => 'version_update', 'value' => 'false' ), 31 => array( 'name' => 'query_update', 'value' => 'false' ), 32 => array( 'name' => 'mc_status_module', 'value' => 'false' ), 33 => array( 'name' => 'recaptcha_secret', 'value' => 'null' ), 34 => array( 'name' => 'email_verification', 'value' => '1' ), 35 => array( 'name' => 'play_page_enabled', 'value' => '1' ), 36 => array( 'name' => 'followers', 'value' => '0' ), 37 => array( 'name' => 'discord', 'value' => '0' ), 38 => array( 'name' => 'avatar_type', 'value' => 'helmavatar' ), 39 => array( 'name' => 'use_mcassoc', 'value' => '0' ), 40 => array( 'name' => 'mcassoc_key', 'value' => '' ), 41 => array( 'name' => 'mcassoc_instance', 'value' => '' ), 42 => array( 'name' => 'twitter_style', 'value' => 'light' ) ); $youtube_url = Input::get('youtube_url'); if(!empty($youtube_url)){ $data[4]["value"] = htmlspecialchars($youtube_url); } $twitter_url = Input::get('twitter_url'); if(!empty($twitter_url)){ $data[5]["value"] = htmlspecialchars($twitter_url); } $twitter_feed = Input::get('twitter_feed'); if(!empty($twitter_feed)){ $data[8]["value"] = htmlspecialchars($twitter_feed); } $gplus_url = Input::get('gplus_url'); if(!empty($gplus_url)){ $data[6]["value"] = htmlspecialchars($gplus_url); } $fb_url = Input::get('fb_url'); if(!empty($fb_url)){ $data[7]["value"] = htmlspecialchars($fb_url); } if(Input::get('user_usernames') == 1){ $data[13]["value"] = "true"; } if(Input::get('user_avatars') == 1){ $data[22]["value"] = "1"; } try { foreach($data as $setting){ $queries->create("settings", array( 'name' => $setting["name"], 'value' => $setting["value"] )); } $queries->create('custom_pages', array( 'url' => '/help/', 'title' => 'Help', 'content' => 'Default help page. Customise in the admin panel.', 'link_location' => 3 )); // Core Modules $modules_initialised = $queries->getWhere('core_modules', array('id', '<>', 0)); if(!count($modules_initialised)){ $queries->create('core_modules', array( 'name' => 'Google_Analytics', 'enabled' => 0 )); $queries->create('core_modules', array( 'name' => 'Social_Media', 'enabled' => 1 )); $queries->create('core_modules', array( 'name' => 'Registration', 'enabled' => 1 )); $queries->create('core_modules', array( 'name' => 'Voice_Server_Module', 'enabled' => 0 )); $queries->create('core_modules', array( 'name' => 'Staff_Applications', 'enabled' => 0 )); } // Themes $themes_initialised = $queries->getWhere('themes', array('id', '<>', 0)); if(!count($themes_initialised)){ $themes = array( 1 => array( 'name' => 'Bootstrap', 'enabled' => 1 ), 2 => array( 'name' => 'Cerulean', 'enabled' => 0 ), 3 => array( 'name' => 'Cosmo', 'enabled' => 0 ), 4 => array( 'name' => 'Cyborg', 'enabled' => 0 ), 5 => array( 'name' => 'Darkly', 'enabled' => 0 ), 6 => array( 'name' => 'Flatly', 'enabled' => 0 ), 7 => array( 'name' => 'Journal', 'enabled' => 0 ), 8 => array( 'name' => 'Lumen', 'enabled' => 0 ), 9 => array( 'name' => 'Paper', 'enabled' => 0 ), 10 => array( 'name' => 'Readable', 'enabled' => 0 ), 11 => array( 'name' => 'Sandstone', 'enabled' => 0 ), 12 => array( 'name' => 'Simplex', 'enabled' => 0 ), 13 => array( 'name' => 'Slate', 'enabled' => 0 ), 14 => array( 'name' => 'Spacelab', 'enabled' => 0 ), 15 => array( 'name' => 'Superhero', 'enabled' => 0 ), 16 => array( 'name' => 'United', 'enabled' => 0 ), 17 => array( 'name' => 'Yeti', 'enabled' => 0 ) ); foreach($themes as $theme){ $queries->create('themes', array( 'enabled' => $theme['enabled'], 'name' => $theme['name'] )); } } // Templates $queries->create('templates', array( 'enabled' => 1, 'name' => 'Default' )); // Cache $c = new Cache(); $c->setCache('themecache'); $c->store('theme', 'Bootstrap'); $c->store('inverse_navbar', '0'); $c->setCache('sitenamecache'); $c->store('sitename', htmlspecialchars(Input::get('site_name'))); $c->setCache('templatecache'); $c->store('template', 'Default'); $c->setCache('languagecache'); $c->store('language', 'EnglishUK'); $c->setCache('page_load_cache'); $c->store('page_load', 0); echo ''; die(); } catch(Exception $e){ echo "
".$e->getMessage()."
"; die(); } } else { $errors = ""; foreach($validation->errors() as $error){ if(strstr($error, 'site_name')){ $errors .= "Please input a site name
"; } if(strstr($error, "outgoing_email")){ $errors .= "Please input an outgoing email address
"; } if(strstr($error, "incoming_email")){ $errors .= "Please input an incoming email address
"; } } } } ?>

General

Fields marked * are required

User Accounts


getWhere("settings", array("name", "=", "displaynames")); $allow_mcnames = $allow_mcnames[0]->value; // Can the user register with a non-Minecraft username? if(Input::exists()){ $validate = new Validate(); $data = array( 'email' => array( 'required' => true, 'min' => 2, 'max' => 64 ), 'password' => array( 'required' => true, 'min' => 6, 'max' => 64 ), 'password_again' => array( 'required' => true, 'matches' => 'password' ) ); if($allow_mcnames === "false"){ // Custom usernames are disabled $data['username'] = array( 'min' => 2, 'max' => 20 ); } else { // Custom usernames are enabled $data['username'] = array( 'min' => 2, 'max' => 20 ); $data['mcname'] = array( 'min' => 2, 'max' => 20 ); } $validation = $validate->check($_POST, $data); // validate if($validation->passed()){ $user = new User(); // Get Minecraft UUID of user if($allow_mcnames !== "false"){ $mcname = Input::get('mcname'); $profile = ProfileUtils::getProfile($mcname); } else { $mcname = Input::get('username'); $profile = ProfileUtils::getProfile(Input::get('username')); } if(!empty($profile)){ $uuid = $profile->getProfileAsArray(); $uuid = $uuid['uuid']; if(empty($uuid)){ $uuid = ''; } } else { $uuid = ''; } if($uuid == ''){ // Error getting UUID, display an error asking user to update manually $uuid_error = true; } // Hash password $password = password_hash(Input::get('password'), PASSWORD_BCRYPT, array("cost" => 13)); // Get current unix time $date = new DateTime(); $date = $date->getTimestamp(); try { // Create groups // Only create if they don't already exist for some reason $group_exists = $queries->getWhere("groups", array("id", "=", 1)); if(!count($group_exists)){ $queries->create("groups", array( 'id' => 1, 'name' => 'Standard', 'group_html' => 'Member', 'group_html_lg' => 'Member' )); } $group_exists = $queries->getWhere("groups", array("id", "=", 2)); if(!count($group_exists)){ $queries->create("groups", array( 'id' => 2, 'name' => 'Admin', 'group_html' => 'Admin', 'group_html_lg' => 'Admin', 'mod_cp' => 1, 'admin_cp' => 1, 'staff' => 1 )); } $group_exists = $queries->getWhere("groups", array("id", "=", 3)); if(!count($group_exists)){ $queries->create("groups", array( 'id' => 3, 'name' => 'Moderator', 'group_html' => 'Moderator', 'group_html_lg' => 'Moderator', 'mod_cp' => 1, 'staff' => 1 )); } // Create admin account $user->create(array( 'username' => Input::get('username'), 'password' => $password, 'pass_method' => 'default', 'mcname' => $mcname, 'uuid' => $uuid, 'joined' => $date, 'group_id' => 2, 'email' => Input::get('email'), 'lastip' => "", 'active' => 1 )); $login = $user->login(Input::get('username'), Input::get('password'), true); if($login) { if(!isset($uuid_error)){ echo ''; } else { echo ''; } die(); } else { echo '

Sorry, there was an unknown error logging you in. Try again

'; die(); } } catch(Exception $e){ echo "
".$e->getMessage()."
"; die(); } } else { Session::flash('admin-acc-error', '
Unable to create account. Please check:
- You have entered a username between 4 and 20 characters long
- Your Minecraft username is a valid account
- Your passwords are at between 6 and 64 characters long and they match
- Your email address is between 4 and 64 characters
'); } } ?>
Fields marked * are required
isLoggedIn() || $user->data()->group_id != 2){ echo ''; die(); } if(isset($_GET["convert"]) && !isset($_GET["from"])){ ?>

Which forum software are you converting from?

XenForo

Converting from ModernBB:

Error connecting to the database. Are you sure you entered the correct credentials?
Cancel
Successfully imported ModernBB data. Important: Please redefine any private categories in the Admin panel.

Converting from phpBB:

Coming soon. This won't work yet!
Error connecting to the database. Are you sure you entered the correct credentials?
Cancel
Successfully imported phpBB data. Important: Please redefine any private categories in the Admin panel.

Converting from WordPress:

Error connecting to the database. Are you sure you entered the correct credentials?
WordPress conversion script created by dwilson390.
Cancel
Successfully imported Wordpress data. Important: Please redefine any private categories in the Admin panel.

Converting from MyBB:

Coming Soon

Converting from XenForo:

Error connecting to the database. Are you sure you entered the correct credentials?
Cancel
Successfully imported XenForo data. Important: Please check your forum and group permissions, and update users' Minecraft usernames and UUID through the AdminCP.

Convert

Notice: There was an error querying the Minecraft API to retrieve the admin account's UUID. Please update this manually from the AdminCP's users section.

Convert from another forum software?

Please note that tables from your old NamelessMC installation have not been deleted. If you'd like to delete the old tables, you can manually delete the tables with your old prefix. The new tables have the prefix nl1_.

Thanks for using NamelessMC for your servers website. If you need support you can visit the support forums here or you can visit also the offical repository here.


© NamelessMC

samerton commented 7 years ago

Can you edit the pages/install.php file again, but delete everything in there, and then add this inside?

samerton commented 7 years ago

I'll mark this as closed (#546)