This repository was archived by the owner on Sep 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
52 lines (50 loc) · 1.34 KB
/
index.php
File metadata and controls
52 lines (50 loc) · 1.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
<?php
//Includes
include 'config.php';
include 'functions.php';
//Get info
$user = $_POST['user'];
$password = $_POST['password'];
$lversion = $_POST['version'];
//Get variables override post variables if set
if (isset($_GET['user'])) {
$user = $_GET['user'];
}
if (isset($_GET['password'])) {
$password = $_GET['password'];
}
if (isset($_GET['version'])) {
$lversion = $_GET['version'];
}
if (isset($user) && isset($password)) {//Make sure there is a username and password before authenticating
//Check name
$haspaid = cURL("http://minecraft.net/haspaid.jsp?user=" . $user);
if ($haspaid == "true") {
//They're premium, login with official MC and return a real result
$return = cURL("https://login.minecraft.net/?user=" . $user . "&password=" . $password . "&version=" . $lversion);
}
elseif ($haspaid == "false") {
//Not premium, check their info https://www.minecraft.net/login username=user&password=pass
if (login($user, $password) == "User not premium") {
$newSess = randSess();
$return = $version . ":deprecated:" . $user . ":" . $newSess;
if ($useDB == 1) {
//Store $newSess
storeSess($user, $newSess);
}
}
else {
//Login failed or paradox occurred
$return = "Bad login";
}
}
else {//Something went horribly wrong, reject.
$return = "Bad login";
}
//Send info
echo $return;
}
else {
include 'news.php';
}
?>