-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathaccess.php
77 lines (68 loc) · 2.44 KB
/
access.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
<?php
/**
*
* =======================================
* ###################################
* PortabilidadeCelular
*
* @package ChipCerto ChanDongle
* @author Adilson Leffa Magnus.
* @copyright Copyright (C) 2005 - 2016 MagnusSolution. All rights reserved.
* ###################################
*
* This software is released under the terms of the GNU Lesser General Public License v2.1
* A copy of which is available from http://www.gnu.org/copyleft/lesser.html
*
* =======================================
* Magnusbilling.com <[email protected]>
* 14/07/2016
*/
$configFile = '/etc/asterisk/chipcerto.conf';
$sipConfig = parse_ini_file($configFile,true);
session_start();
if (isset($_POST['login']) || isset($_POST['password'])) {
if ($_POST['login'] == $sipConfig['access']['username'] && $_POST['password'] == $sipConfig['access']['password']) {
$_SESSION['logged'] = true;
header('Location: status.php');
}else{
echo "<center><font color=red>USUARIO OU SENHA INVALIDOS</font></center>";
}
}
if (!isset($_SESSION['logged'])):
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Login Form</title>
<link rel="stylesheet" href="style/login.css">
<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body>
<section class="container">
<div class="login">
<h1>ChipCerto</h1>
<form method="post" action="access.php">
<p><input type="text" name="login" value="" placeholder="Username"></p>
<p><input type="password" name="password" value="" placeholder="Senha"></p>
<p class="submit"><input type="submit" name="commit" value="Entrar"></p>
</form>
</div>
</section>
<center>
<section class="about">
<p class="login-help">
© 2005–2016 <a href="https://portabilidadecelular.com" target="_blank">Portabilidade</a> -
<a href="https://www.portabilidadecelular.com" target="_blank">ChipCerto License</a><br>
Original PSD by <a href="https://www.portabilidadecelular.com" target="_blank">Portabilidade</a>
</section>
</center>
</body>
</html>
<?php
exit;
endif; ?>