Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
  • Loading branch information
NaysKutzu committed Oct 17, 2023
1 parent c41ee50 commit c48087f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions public/FIRST_USER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dummy file
1 change: 1 addition & 0 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
});

$router->route();

} else {
$router->add('/', function () {
require("../include/main.php");
Expand Down
10 changes: 10 additions & 0 deletions view/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand All @@ -117,6 +122,7 @@
`password`,
`api_key`,
`avatar`,
`role`,
`coins`,
`ram`,
`disk`,
Expand All @@ -135,6 +141,7 @@
'" . $password . "',
'" . $skey . "',
'" . $grav_url . "',
'".$role."',
'" . $settings['def_coins'] . "',
'" . $settings['def_memory'] . "',
'" . $settings['def_disk_space'] . "',
Expand All @@ -146,6 +153,9 @@
'" . $ip_addres . "'
);");
$conn->close();
if (file_exists("FIRST_USER")) {
unlink("FIRST_USER");
}
NewUser();
header('location: /auth/login');
die();
Expand Down

0 comments on commit c48087f

Please sign in to comment.