index.php
10.4 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<?php
header("Content-Type: text/html; charset=UTF-8", true);
/* * ********************************************************************************
Sistema e-SIC Livre: sistema de acesso a informa��o baseado na lei de acesso.
Copyright (C) 2014 Prefeitura Municipal do Natal
Este programa � software livre; voc� pode redistribu�-lo e/ou
modific�-lo sob os termos da Licen�a GPL2.
* ********************************************************************************* */
require_once("../inc/security.php");
include(DIR_CLASSES_LEIACESSO . "solicitacao.class.php");
include(DIR_CLASSES_LEIACESSO . "solicitante.class.php");
$login = $_POST["login"];
$password = $_POST["password"];
$tipo = $_REQUEST['t'];
$token2 = $_REQUEST["to2"];
$notRedir = $_REQUEST["red"];
$msg = "";
//usado pra troca de sic, chamado no arquivo topo atrav�s do select de sics
$sic = $_GET['sic'];
if(!empty($sic))
if(!atualizaUnidadeUsuario($sic))
echo "<script>alert('Usuário não pertence ao SIC que está tentando acessar!');</script>";
else
Redirect("../index/");
//----------------------
if(usaRecaptcha($login))
$usarecap = true;
else
$usarecap = false;
if ($_POST['btsub']) {
if ($usarecap) {
$error = null;
$recaptcha_ok = (strtoupper($_POST["palavra"]) == strtoupper($_SESSION["palavra"]));
} else
$recaptcha_ok = true;
if ($recaptcha_ok) {
if (autentica($login, $password, $tipo)) {
Redirect("../index/");
} else {
$msg = "Erro: falha no login.";
$usarecap = true;
}
} else {
$msg = "Erro: falha no login.";
}
}
if (!empty($token)) {
if (autentica("", "", "", $token)) {
Redirect("../index/");
} else {
$msg = "<font color='red'>Erro: falha no login.</font>";
}
}
if (!empty($token2)) {
if (autentica("", "", "", "", $token2)) {
if (empty($notRedir)) {
Redirect("../index/");
echo 'loggin...';
}
} else {
$msg = "<font color='red'>Erro: falha no login.</font>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> Lei de Acesso </title>
<!-- CSS -->
<meta name="verify-v1" content="miqBcW00PywY1Jm7/yQP8ztDacIWFV9gQRTCmHuai9w=" />
<!-- TAG PARA O GOOGLEBOT -->
<!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<!-- Place favicon.ico in the root directory -->
<!-- build:css styles/vendor.css -->
<!-- bower:css -->
<link rel="stylesheet" href="../bower_components/ng-img-crop/compile/minified/ng-img-crop.css" />
<link rel="stylesheet" href="../bower_components/Waves/dist/waves.min.css" />
<link rel="stylesheet" href="../bower_components/animate.css/animate.css" />
<link rel="stylesheet" href="../bower_components/jquery.scrollbar/jquery.scrollbar.css" />
<link rel="stylesheet" href="../bower_components/bootstrap-select/dist/css/bootstrap-select.css" />
<link rel="stylesheet" href="../bower_components/awesomplete/awesomplete.css" />
<!-- endbower -->
<link rel="stylesheet" href="../assets/styles/menu.css" />
<link rel="stylesheet" href="../assets/styles/chrome-tabs.css" />
<link rel="stylesheet" href="../assets/styles/checkbox.css" />
<!-- endbuild -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<!-- build:css styles/main.css -->
<link rel="stylesheet" href="../assets/dist/styles/main.css">
<!-- endbuild -->
<link rel="stylesheet" media="print" href="../assets/dist/styles/print.css"/>
<!-- build:js scripts/vendor/modernizr.js -->
<script src="../bower_components/modernizr/modernizr.js"></script>
<!-- endbuild -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="E-Sic Livre" content="Portal da Prefeitura Municipal do Natal - SEMPLA - Secretaria de Planejamento, Or�amento e Finan�as" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="revisit-after" content="1" />
<meta name="classification" content="Internet" />
<meta name="description" content="Portal da Prefeitura Municipal do Natal - SEMPLA - Secretaria de Planejamento, Or�amento e Finan�as" />
<meta name="keywords" content="Prefeitura do Natal, natal, rn, sempla, natal, rn, noticias, servi�os" />
<meta name="robots" content="ALL" />
<meta name="distribution" content="Global" />
<meta name="rating" content="General" />
<meta name="author" content="SEMPLA, Prefeitura do Natal" />
<meta name="language" content="pt-br" />
<meta name="doc-class" content="Completed" />
<meta name="doc-rights" content="Public" />
<meta http-equiv="X-UA-Compatible" content="IE=8">
<style>
@media only print {
body {
font-size: 10px;
}
#areaToPrint tr{
border-top: 1px solid #ccc !important;
}
}
</style>
</head>
<body>
<div class="overlay-mobile"></div>
<?php if (empty($_SESSION[SISTEMA_CODIGO])) { ?>
<div id="login-content">
<div class="align">
<div class="center">
<div class="box">
<header class="text-center">
<img src="../assets/images/icon-logo.png" class="logo" alt="">
</header>
<div class="content">
<?php if (!empty($msg)): ?>
<div class="alert alert-danger"><?= $msg ?></div>
<?php endif; ?>
<form action="index.php" method="post">
<div class="form-group">
<label for="cpf" class="input-label"><i class="material-icons">account_circle</i></label>
<input placeholder="Usu�rio" class="form-control icon" type="text" name="login" id="cpf" value="" maxlength="13"/>
</div>
<div class="form-group">
<label for="password" class="input-label"><i class="material-icons">lock</i></label>
<input placeholder="Senha" class="form-control icon" type="password" name="password" id="password" value="" maxlength="100"/>
</div>
<?php if ($usarecap) { ?>
<div class="form-group captcha-group">
<div class="row">
<div class="col-sm-4 col-xs-12">
<img class="img-responsive" src="../inc/captcha.php?l=150&a=50&tf=20&ql=5" id="imgcaptcha">
<img style=" position: absolute;bottom: 10px;right: 0;" src="../img/refresh.gif" title="Clique aqui para recarregar a imagem" alt="Clique aqui para recarregar a imagem"onclick="getElementById('imgcaptcha').src = '../inc/captcha.php?l=150&a=50&tf=20&ql=5';">
</div>
<div class="col-sm-8 col-xs-12">
<input class="form-control" placeholder="Informe o código acima:" type="text" name="palavra">
</div>
</div>
</div>
<?php } ?>
<button type="submit" class="btn btn-success waves-effect waves-button" value="Entrar" name="btsub">Entrar</button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php } else { ?>
<div id="body-main">
<?php include ("sidebar.php") ?>
<div class="wrapper">
<?php include("navbar.php") ?>
<?php
foreach($_GET as $x => $x_value) {
$link = $x;
break;
}
if (isset($_GET['p']))
$page = $_GET['p'] . '.php';
else
$page = 'index.php';
if (!empty($link) && $link <> 'dashboard')
include("../".$link."/".$page);
else
include("dashboard/".$page);
//echo getSession('sic')[getSession("idsecretaria")][2];
//echo $link;
//echo '<br>' . $page;
?>
</div>
</div>
<?php } ?>
<!-- bower:js -->
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/Waves/dist/waves.min.js"></script>
<script src="../bower_components/jquery.scrollbar/jquery.scrollbar.js"></script>
<script src="../bower_components/bootstrap-sass/assets/javascripts/bootstrap.js"></script>
<script src="../bower_components/bootstrap-select/dist/js/bootstrap-select.js"></script>
<script src="../bower_components/awesomplete/awesomplete.js"></script>
<script src="../js/functions.js"></script>
<script src="../assets/dist/scripts/main.js"></script>
<script>
//<![CDATA[
$(window).load(function(){
function printDiv() {
window.print();
}
$('.btn-print').click(function(){
printDiv()
});
});//]]>
</script>
<!-- endbower -->
</body>
</html>