Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Done #43
  • Loading branch information
NaysKutzu committed Aug 22, 2023
1 parent e14b9c0 commit 34e873c
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion view/admin/users/view_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<div class="card">
<h5 class="card-header">
Users
<a href="/admin/users/new" class="btn btn-primary float-end">Create New User</a>
<!--<a href="/admin/users/new" class="btn btn-primary float-end">Create New User</a>-->
</h5>
<div class="table-responsive text-nowrap">
<table class="table">
Expand Down
2 changes: 1 addition & 1 deletion view/auth/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
header('location: /auth/register?e=Please only use characters from A-Z in your last name!');
die();
}
$password = password_hash($upassword, PASSWORD_DEFAULT);
$password = password_hash($upassword, PASSWORD_BCRYPT);
$skey = generate_key($email, $password);
if (!$username == "" || !$email == "" || !$first_name == "" || !$last_name == "" || !$upassword == "") {
$check_query = "SELECT * FROM mythicaldash_users WHERE username = '$username' OR email = '$email'";
Expand Down
2 changes: 1 addition & 1 deletion view/auth/reset-password.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if ($csrf->validate('reset-password-form')) {
$ucode = $conn->query("SELECT * FROM mythicaldash_resetpasswords WHERE `user-resetkeycode` = '" . $code . "'")->fetch_array();
$upassword = mysqli_real_escape_string($conn, $_GET['password']);
$password = password_hash($upassword, PASSWORD_DEFAULT);
$password = password_hash($upassword, PASSWORD_BCRYPT);
$conn->query("UPDATE `mythicaldash_users` SET `password` = '" . $password . "' WHERE `mythicaldash_users`.`api_key` = '" . $ucode['user-apikey'] . "';");
$conn->query("DELETE FROM mythicaldash_resetpasswords WHERE `mythicaldash_resetpasswords`.`id` = " . $ucode['id'] . "");
$conn->close();
Expand Down
17 changes: 2 additions & 15 deletions view/components/sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,11 @@ function is_active_page($page_urls)
<div>Application API</div>
</a>
</li>
<li
class="menu-item <?php echo is_active_page(['/admin/users/view', '/admin/users/edit', '/admin/users/new']) ? 'active' : ''; ?>">
<a href="javascript:void(0);" class="menu-link menu-toggle">
<li class="menu-item <?php echo is_active_page(['/admin/users/view', '/admin/users/edit', '/admin/users/new']) ? 'active' : ''; ?>">
<a href="/admin/users/view" class="menu-link">
<i class="menu-icon tf-icons ti ti-users"></i>
<div>Users</div>
</a>
<ul class="menu-sub">
<li class="menu-item <?php echo is_active_page(['/admin/users/view']) ? 'active' : ''; ?>">
<a href="/admin/users/view" class="menu-link">
<div>List</div>
</a>
</li>
<li class="menu-item <?php echo is_active_page(['/admin/users/new']) ? 'active' : ''; ?>">
<a href="/admin/users/new" class="menu-link">
<div>New</div>
</a>
</li>
</ul>
</li>
<li class="menu-item <?php echo is_active_page(['/admin/redeem']) ? 'active' : ''; ?>">
<a href="/admin/redeem" class="menu-link">
Expand Down
3 changes: 3 additions & 0 deletions view/dashboard.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
include('requirements/page.php');
if ($userdb['panel_id'] == "CLI") {
header('location: /admin/settings');
}
$nuserdb = $conn->query("SELECT * FROM mythicaldash_users WHERE api_key = '" . mysqli_real_escape_string($conn, $_COOKIE['token']) . "'")->fetch_array();
$servers = mysqli_query($conn, "SELECT * FROM mythicaldash_servers WHERE uid = '" . mysqli_real_escape_string($conn, $_COOKIE['token']) . "'");
$servers_in_queue = mysqli_query($conn, "SELECT * FROM mythicaldash_servers_queue WHERE ownerid = '" . mysqli_real_escape_string($conn, $_COOKIE['token']) . "'");
Expand Down
3 changes: 3 additions & 0 deletions view/earn/afk.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
include(__DIR__ . '/../requirements/page.php');
if ($userdb['panel_id'] == "CLI") {
header('location: /admin/settings');
}
if (isset($_GET['getcoins'])) {
$coins = $userdb['coins'];
$idlemins = $userdb['minutes_afk'];
Expand Down
3 changes: 3 additions & 0 deletions view/earn/redeem.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
include(__DIR__ . '/../requirements/page.php');
if ($userdb['panel_id'] == "CLI") {
header('location: /admin/settings');
}
if (isset($_GET['code']) && !$_GET['code'] == "") {
$user_query = "SELECT * FROM mythicaldash_redeem WHERE code = ?";
$stmt = mysqli_prepare($conn, $user_query);
Expand Down
3 changes: 3 additions & 0 deletions view/server/create.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php
include(__DIR__ . '/../requirements/page.php');
if ($userdb['panel_id'] == "CLI") {
header('location: /admin/settings');
}
include(__DIR__ . '/../../include/php-csrf.php');
$csrf = new CSRF();

Expand Down
4 changes: 3 additions & 1 deletion view/server/queueDelete.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
include(__DIR__ . '/../requirements/page.php');

if ($userdb['panel_id'] == "CLI") {
header('location: /admin/settings');
}
if (!is_numeric($_GET["server"])) {
header("location: /dashboard?e=Server id is invalid.");
die();
Expand Down
19 changes: 9 additions & 10 deletions view/store.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
include(__DIR__ . '/requirements/page.php');

if ($userdb['panel_id'] == "CLI") {
header('location: /admin/settings');
}
$cpuprice = $settings["price_cpu"];
$ramprice = $settings["price_memory"];
$diskprice = $settings["price_disk_space"];
Expand Down Expand Up @@ -142,9 +144,9 @@
</head>

<body>
<div id="preloader" class="discord-preloader">
<div class="spinner"></div>
</div>
<div id="preloader" class="discord-preloader">
<div class="spinner"></div>
</div>
<div class="layout-wrapper layout-content-navbar">
<div class="layout-container">
<?php include(__DIR__ . '/components/sidebar.php') ?>
Expand All @@ -170,8 +172,7 @@
<?= $settings['price_cpu'] ?> coins you get 1 CPU core to use on your
server.
</p>
<a href="/store?buycpu"
class="btn btn-outline-primary waves-effect">Buy</a>
<a href="/store?buycpu" class="btn btn-outline-primary waves-effect">Buy</a>
</div>
</center>
</div>
Expand All @@ -191,8 +192,7 @@ class="btn btn-outline-primary waves-effect">Buy</a>
<?= $settings['price_memory'] ?>
coins you get 1GB ram to use on your server.
</p>
<a href="/store?buyram"
class="btn btn-outline-primary waves-effect">Buy</a>
<a href="/store?buyram" class="btn btn-outline-primary waves-effect">Buy</a>
</div>
</center>
</div>
Expand Down Expand Up @@ -233,8 +233,7 @@ class="btn btn-outline-primary waves-effect">Buy</a>
<?= $settings['price_server_limit'] ?> coins you get 1 server slot to
deploy your server.
</p>
<a href="/store?buysv"
class="btn btn-outline-primary waves-effect">Buy</a>
<a href="/store?buysv" class="btn btn-outline-primary waves-effect">Buy</a>
</div>
</center>
</div>
Expand Down
2 changes: 1 addition & 1 deletion view/user/resetpwd.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if (mysqli_num_rows($result) > 0) {
$user_info = $conn->query("SELECT * FROM mythicaldash_users WHERE api_key = '" . $_COOKIE['token'] . "'")->fetch_array();
$upassword = mysqli_real_escape_string($conn,$_GET['pwd']);
$pwd = password_hash($upassword,PASSWORD_DEFAULT);
$pwd = password_hash($upassword,PASSWORD_BCRYPT);
$conn->query("UPDATE `mythicaldash_users` SET `password` = '" . $pwd . "' WHERE `mythicaldash_users`.`api_key` = '" . $_COOKIE['token'] . "';");
$conn->close();
header('location: /user/profile?s=We updated the user settings in the database');
Expand Down

0 comments on commit 34e873c

Please sign in to comment.