diff --git a/public/FIRST_USER b/public/FIRST_USER new file mode 100644 index 0000000..3acac56 --- /dev/null +++ b/public/FIRST_USER @@ -0,0 +1 @@ +Dummy file \ No newline at end of file diff --git a/public/index.php b/public/index.php index baa8ca6..109e81b 100644 --- a/public/index.php +++ b/public/index.php @@ -35,6 +35,7 @@ }); $router->route(); + } else { $router->add('/', function () { require("../include/main.php"); diff --git a/view/auth/register.php b/view/auth/register.php index e57cb30..3643919 100644 --- a/view/auth/register.php +++ b/view/auth/register.php @@ -108,6 +108,11 @@ $conn->query("INSERT INTO mythicaldash_login_logs (ipaddr, userkey) VALUES ('" . $ip_addres . "', '$skey')"); $default = "https://www.gravatar.com/avatar/00000000000000000000000000000000"; $grav_url = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($email))) . "?d=" . urlencode($default); + if (file_exists("FIRST_USER")) { + $role = "Administrator"; + } else { + $role = "User"; + } $conn->query("INSERT INTO `mythicaldash_users` (`panel_id`, `email`, @@ -117,6 +122,7 @@ `password`, `api_key`, `avatar`, + `role`, `coins`, `ram`, `disk`, @@ -135,6 +141,7 @@ '" . $password . "', '" . $skey . "', '" . $grav_url . "', + '".$role."', '" . $settings['def_coins'] . "', '" . $settings['def_memory'] . "', '" . $settings['def_disk_space'] . "', @@ -146,6 +153,9 @@ '" . $ip_addres . "' );"); $conn->close(); + if (file_exists("FIRST_USER")) { + unlink("FIRST_USER"); + } NewUser(); header('location: /auth/login'); die();