feat: Support password setting into installation step

This commit is contained in:
Martin Ambrus
2017-10-22 10:42:05 +02:00
parent 90db6539c1
commit 4d6b18de4c
5 changed files with 77 additions and 12 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
// don't let SQL time out when 30-500 seconds (depending on php.ini) is not enough
@set_time_limit(0);
$gameinstall = 1;
include ("../../GameEngine/config.php");
include ("../../GameEngine/Database.php");
include ("../../GameEngine/Admin/database.php");
include ("../../GameEngine/Lang/" . LANG . ".php");
$conn = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysqli_select_db($conn, SQL_DB);
if(isset($_POST['spw'])) {
$password = $_POST['spw'];
mysqli_query($conn, "UPDATE " . TB_PREFIX . "users SET password = '" . password_hash($password, PASSWORD_BCRYPT,['cost' => 12]) . "' WHERE username = 'Support'");
}
$gameinstall = 0;
header("Location: ../index.php?s=6");
?>