-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.php
More file actions
77 lines (59 loc) · 2.34 KB
/
database.php
File metadata and controls
77 lines (59 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
include_once('ez_source/classes/database.php');
include_once('ez_source/classes/settings.php');
new SecureSettings(true);
if(Database::TryToConnect()){
header("location: dashboard ");
}
$host = isset($_POST['db-host']) ? $_POST['db-host'] : '';
$name = isset($_POST['db-name']) ? $_POST['db-name'] : '';
$user = isset($_POST['db-user']) ? $_POST['db-user'] : '';
if(isset($_POST['db-host']) && isset($_POST['db-name']) && isset($_POST['db-user'])) {
define('_DEFVAR', 1);
include_once('ez_source/classes/helper.php');
SecureSettings::setDbHost($_POST['db-host']);
//SecureSettings::setDbName($_POST['db-name']);
SecureSettings::setDbName("ez_blog");
SecureSettings::setDbUser($_POST['db-user']);
SecureSettings::setDbPassword($_POST['db-pass']);
SecureSettings::SaveFileStatic();
if(Database::TryToConnect(false)){
Database::CreateFullDatabase();
header("location: dashboard ");
}
Helper::ShowCustomError("Credenciais do banco de dados inválidas");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="ez_source/pages/styles/database.css">
<link rel="stylesheet" href="ez_source/pages/styles/dash-global.css">
<title>Fast Blog</title>
</head>
<body>
<div class="database-total">
<div class="database">
<div class="logo">
<div class="title">
<b>Fast Blog</b>
Dashboard
</div>
</div>
<div class="body">
<p>Insira abaixo as credenciais do seu banco de dados <a href="https://documentacao" target="_blank">?</a></p>
<form action="" method="POST">
<input type="text" name="db-host" placeholder="Host(URL)" value="<?php echo $host?>">
<input type="text" name="db-name" placeholder="Nome do banco de dados" value="<?php echo $name?>">
<input type="text" name="db-user" placeholder="Usuário do banco de dados" value="<?php echo $user?>">
<input type="password" name="db-pass" placeholder="Senha do banco de dados">
<input type="submit" value="Conectar">
</form>
</div>
</div>
</div>
</body>
</html>