-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapichange.php
84 lines (71 loc) · 2.72 KB
/
apichange.php
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
78
79
80
81
82
83
84
<!DOCTYPE html>
<html class=" js csstransforms3d csstransitions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<title>EloCloud Finder</title>
<script async="" src="./resources/img/cloud.png"></script>
<link rel="icon" type="image/png" sizes="32x32" href="resources/img/icloud.png">
<link rel="shortcut icon" href="favicon.png">
<link rel="stylesheet" type="text/css" href="./resources/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="./resources/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./resources/css/style.css">
</head>
<div class="container">
<!--MENU-->
<nav class="menu">
<ul class="list-inline">
<center><li><a href="index.php">Home</a></li></center>
</ul>
</nav>
</div>
<?php
//--------------------------------//
$senhaverify = "batunahan123"; // <- Senha para login
//--------------------------------//
if(isset($_POST['newkey']))
{
if($_POST['newkey'] != ""){
fwrite(fopen("resources/api_key_007.txt", "w"), $_POST['newkey']);
echo "<center><h2>Yeni Key:".$_POST['newkey']."<br>Api Anahtarı Başarıyla Değiştirildi";
}
}
session_start(); //Para qualquer função session é preciso ter ela inciada
if(!empty($_POST)){
$senha = $_POST['senha'];
if($senha == $senhaverify){
$_SESSION["login"] = "sim"; //Apenas um exemplo, se existir a sessao e exibir $_SESSION['login'] por um echo, irá retornar "sim"
}
}
if(isset($_GET['acao'])){
if($_GET['acao'] == "sair"){
session_destroy();
header("Location: ApiChange.php"); //Redireciona a pagina para o estado inicial sem a url com get, caso contrario ele vai logar e sair na mesma hora
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>ChangeApi</title>
<meta charset="utf-8">
</head>
<center><body><li id="view">
</li><img src="resources/img/riot.png"><br><br>
<?php if(isset($_SESSION["login"])){ ?> <!-- Verifica se existe uma session login, no caso nao esta verificando se a sessao login é "sim" -->
<h1>Api Anahtarını Güncelle</h1>
<fieldset><legend>Key:</legend>
<form method='post'><input type='text' name='newkey' placeholder='RGAPI-22961d8e-95ec-492f-934c-e106281bcc44'><input type='submit' value='Aktif Et'></form>
<form method="post">
</form>
<a href="?acao=sair">Çıkış</a>
<?php }else{ ?>
<h2>Password<br><br></h2>
<form method="post">
<input type="password" name="senha" placeholder="Digite a senha">
<input type="submit" value="Logar-se">
</form>
<?php } ?>
</body>
</html>