"; +} + +?> + + + +
diff --git a/install/include/accounts.php b/install/include/accounts.php new file mode 100644 index 00000000..d9ffbb43 --- /dev/null +++ b/install/include/accounts.php @@ -0,0 +1,87 @@ + 'define("ADMIN_RECEIVE_SUPPORT_MESSAGES", '.($_POST['admin_support_msgs'] == 'true' ? 'true' : 'false').');', + '/define\("ADMIN_ALLOW_INCOMING_RAIDS",[^)]+\);/' => 'define("ADMIN_ALLOW_INCOMING_RAIDS", '.($_POST['admin_raidable'] == 'true' ? 'true' : 'false').');', + '/define\("INCLUDE_ADMIN",[^)]+\);/' => 'define("INCLUDE_ADMIN", '.($_POST['admin_rank'] == 'true' ? 'true' : 'false').');' + ]; + + $gameConfig = preg_replace(array_keys($regexFindReplace), array_values($regexFindReplace), $gameConfig); + file_put_contents($configFile, $gameConfig); + + // create Admin user, if details were provided and was not created yet + if ( + !empty($_POST['aname']) && + !empty($_POST['aemail']) && + !empty($_POST['apass']) && + !empty($_POST['atribe']) && + strtolower($_POST['aname']) != 'multihunter' && + strtolower($_POST['aname']) != 'support' + ) { + mysqli_query($database->dblink, "INSERT INTO " . TB_PREFIX . "users SET username = '".$database->escape($_POST['aname'])."', password = '" . password_hash($_POST['apass'], PASSWORD_BCRYPT, ['cost' => 12]) . "', email = '".$database->escape($_POST['aemail'])."', tribe = ".(int) $_POST['atribe'].", access = 9, is_bcrypt = 1") OR DIE (mysqli_error($database->dblink)); + $uid = mysqli_insert_id($database->dblink); + $admin_village_created = false; + $xcoor = 50; + while (!$admin_village_created) { + $wid = $admin->getWref($xcoor++, 50); + $status = $database->getVillageState($wid); + if($status == 0) { + $database->setFieldTaken($wid); + $database->addVillage($wid, $uid, $_POST['aname'], 1); + $database->addResourceFields($wid, $database->getVillageType($wid)); + $database->addUnits($wid); + $database->addTech($wid); + $database->addABTech($wid); + $admin_village_created = true; + } + } + } + + // set up MultiHunter + $password = $_POST['mhpw']; + mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users SET password = '" . password_hash($password, PASSWORD_BCRYPT,['cost' => 12]) . "' WHERE username = 'Multihunter'"); + $wid = $admin->getWref(0, 0); + $uid = 5; + $status = $database->getVillageState($wid); + if($status == 0) { + $database->setFieldTaken($wid); + $database->addVillage($wid, $uid, 'Multihunter', '0'); + $database->addResourceFields($wid, $database->getVillageType($wid)); + $database->addUnits($wid); + $database->addTech($wid); + $database->addABTech($wid); + } + + // set up Support + $password = $_POST['spw']; + mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users SET password = '" . password_hash($password, PASSWORD_BCRYPT,['cost' => 12]) . "' WHERE username = 'Support'"); + + $gameinstall = 0; + header("Location: ../index.php?s=5"); + +?> \ No newline at end of file diff --git a/install/include/multihunter.php b/install/include/multihunter.php deleted file mode 100644 index 6a551611..00000000 --- a/install/include/multihunter.php +++ /dev/null @@ -1,34 +0,0 @@ - 12]) . "' WHERE username = 'Multihunter'"); - $wid = $admin->getWref(0, 0); - $uid = 5; - $status = $database->getVillageState($wid); - if($status == 0) { - $database->setFieldTaken($wid); - $database->addVillage($wid, $uid, 'Multihunter', '0'); - $database->addResourceFields($wid, $database->getVillageType($wid)); - $database->addUnits($wid); - $database->addTech($wid); - $database->addABTech($wid); - } - } - -$gameinstall = 0; - header("Location: ../index.php?s=5"); - -?> \ No newline at end of file diff --git a/install/include/support.php b/install/include/support.php deleted file mode 100644 index 6cd1bab4..00000000 --- a/install/include/support.php +++ /dev/null @@ -1,23 +0,0 @@ - 12]) . "' WHERE username = 'Support'"); - } - - $gameinstall = 0; - header("Location: ../index.php?s=6"); - -?> \ No newline at end of file diff --git a/install/index.php b/install/index.php index 5546de4a..6c6def4a 100644 --- a/install/index.php +++ b/install/index.php @@ -82,7 +82,7 @@ function proceed() {
- ADMIN ACCOUNT -
| Admin name: | -- |
| Admin email: | -- |
| Show admin in stats: | -- - | -
| Include Support Messages in Admin Mailbox: | -- - | -
| Allow Administrative Accounts to be Raided and Attacked: | -- - | -
SQL RELATED