-
Notifications
You must be signed in to change notification settings - Fork 10
/
login.php
96 lines (93 loc) · 3.34 KB
/
login.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
85
86
87
88
89
90
91
92
93
94
95
96
<?php
/**
* ------- U-232 Codename Trinity ----------*
* ---------------------------------------------*
* -------- @authors U-232 Team --------------*
* ---------------------------------------------*
* ----- @site https://u-232.duckdns.org/ ----*
* ---------------------------------------------*
* ----- @copyright 2020 U-232 Team ----------*
* ---------------------------------------------*
* ------------ @version V6 ------------------*
*/
require_once(__DIR__.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
require_once(CLASS_DIR.'page_verify.php');
dbconn();
global $CURUSER;
if (isset($CURUSER)) {
redirect( 'index.php' );
}
get_template();
ini_set('session.use_trans_sid', '0');
$stdfoot = '';
if ($TRINITY20['captcha_on'] === true) {
$stdfoot = [
/** include js **/
'js' => [
'captcha',
'jquery.simpleCaptcha-0.2',
],
];
}
$lang = array_merge(load_language('global'), load_language('login'));
$newpage = new page_verify();
$newpage->create('takelogin');
$left = $total = '';
//== 09 failed logins
function left()
{
global $TRINITY20;
$total = 0;
$ip = getip();
($fail = sql_query("SELECT SUM(attempts) FROM failedlogins WHERE ip=".sqlesc($ip))) || sqlerr(__FILE__, __LINE__);
[$total] = $fail->fetch_row();
$left = $TRINITY20['failedlogins'] - $total;
if ($left <= 2) {
$left = "<span class='button rounded alert'>{$left}</span>";
} else {
$left = "<span class='button rouned success'>{$left}</span>";
}
return $left;
}
//== End Failed logins
$HTMLOUT = "";
$HTMLOUT .= "<div class='grid-container'>
<div class='grid-x grid-padding-x align-center-middle text-center margin-top-3'>
<div class='callout margin-top-3'>
<div class='corner-badge'>".left()."</div>
<img src='" . url( 'pic/logo.png' ) . "'>";
unset($returnto);
if (!empty($_GET["returnto"])) {
$returnto = htmlsafechars($_GET["returnto"]);
$HTMLOUT .= "<div class='callout alert-callout-border warning'><p class='text-center'>{$lang['login_error']}</p></div>";
}
$HTMLOUT .= "".($TRINITY20['captcha_on'] ? "<script>
/*<![CDATA[*/
$(document).ready(function () {
$('#captchalogin').simpleCaptcha();
});
/*]]>*/
</script>" : "")."
<form role='form' method='post' title='login' action='takelogin.php'>
<div class='input-group'>
<span class='input-group-label'><i class='fa fa-user'></i></span>
<input class='input-group-field' name='username' placeholder='Username' type='text'>
</div>
<div class='input-group'>
<span class='input-group-label'><i class='fa fa-lock'></i></span>
<input class='input-group-field' name='password' placeholder='Type your password' type='password'>
</div>
".($TRINITY20['captcha_on'] ? "<div id='captchalogin'></div>" : "")."";
$HTMLOUT .= "<input name='submitme' type='submit' value='Login' class='button'>";
if (isset($returnto)) {
$HTMLOUT .= "<input type='hidden' name='returnto' value='".htmlsafechars($returnto)."'></form>";
}
$HTMLOUT .= "
<div class='clearfix'>
<a href='signup.php'><span class='float-left'>{$lang['login_signup']}</span></a>
<a href='resetpw.php'><span class='float-right'>{$lang['login_forgot']}</span></a>
</div>
</div></div></div>";
echo stdhead("{$lang['login_login_btn']}", true).$HTMLOUT.stdfoot($stdfoot);
?>