-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
320 lines (286 loc) · 16.8 KB
/
index.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
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
<?php session_start();?>
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
require_once('util/Maps/HashMap.php');
require_once 'util/Session.php';
require_once 'util/JsonResponse.php';
require_once 'util/StringManager.php';
require_once('Config.class.php');
require_once "core/RSSReader.php";
require_once "core/RssItem.php";
require_once 'core/DataBase/Connection.php';
require_once 'core/User/User.php';
require_once 'core/Link/LinkController.php';
require_once 'core/Exceptions/FileNotFoundException.php';
require_once 'core/Exceptions/LoginException.php';
require_once 'core/Exceptions/UserExistsException.php';
if(isset($_GET['login-fail']) || isset($_GET['restaurar']) || (empty($_POST) && empty($_GET))){
/*
* Acoes para o link RESTAURAR aplicativos
*/
if ( isset($_GET['restaurar']) )
{
setcookie('Bureau_PosicaoApps', '');
setcookie('Bureau_AppsMinimizados', '');
header('Location: ' . Config::get('baseurl'));
}
if(!Session::isLogged()){
/*
* Se o cookie de posicao de APPS nao existe, entao cria de acordo com o arquivo de configuracao.
*/
if (! isset($_COOKIE['Bureau_PosicaoApps']))
{
setcookie('Bureau_PosicaoApps', Config::get('posicao_padrao_apps'), Config::get('tempo_vida_cookie'));
}else{
//setcookie('Bureau_PosicaoApps', Config::get('posicao_padrao_apps'), Config::get('tempo_vida_cookie'));
}
/*
* Se o cookie de APPS minimizados nao existe, entao cria.
*/
if (! isset($_COOKIE['Bureau_AppsMinimizados']))
{
setcookie('Bureau_AppsMinimizados', "0", Config::get('tempo_vida_cookie'));
}else{
//setcookie('Bureau_AppsMinimizados', "0", Config::get('tempo_vida_cookie'));
}
}else{
//echo "cookie = ".isset($_COOKIE['logged']);
if(!isset($_COOKIE['logged'])){
//setcookie('Bureau_PosicaoApps', '', time()-3600);
//setcookie('Bureau_PosicaoApps', "publicacoes|noticias|videoteca", time() + 3600);
//setcookie('Bureau_AppsMinimizados', "0", Config::get('tempo_vida_cookie'));
//setcookie('logged', '1', time() + 3600);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Bureau de Inteligência do Café</title>
<link rel="stylesheet" type="text/css" href="assets/css/reset.css" media="screen" />
<!--<link rel="stylesheet" type="text/css" href="assets/css/ui/jquery-ui-1.8.8.custom.css" media="screen" />-->
<link rel="stylesheet" type="text/css" href="assets/css/ui/jquery-ui-1.8.15.custom.css" media="screen" />
<link rel="stylesheet" type="text/css" href="assets/css/text.css" media="screen" />
<link rel="stylesheet" type="text/css" href="assets/css/grid.css" media="screen" />
<link rel="stylesheet" type="text/css" href="assets/css/main.css" media="screen" />
<link rel="stylesheet" type="text/css" href="assets/css/contentapps.css" media="screen" />
<!--<script type="text/javascript" src="assets/js/jquery.min.js"></script>-->
<script type="text/javascript" src="assets/js/jquery-1.6.2.min.js"></script>
<!--<script type="text/javascript" src="assets/js/jquery-ui.min.js"></script>-->
<script type="text/javascript" src="assets/js/jquery-ui-1.8.15.custom.min.js"></script>
<script type="text/javascript" src="assets/js/jquery.cooquery.js"></script>
<script type="text/javascript" src="assets/js/jquery.cycle.min.js"></script>
<script type="text/javascript" src="assets/js/windows.js"></script>
<script type="text/javascript" src="assets/js/FusionCharts.js"></script>
<script type="text/javascript" src="assets/js/chart_builder.js"></script>
<script type="text/javascript" src="assets/js/AppAjax.js"></script>
<script type="text/javascript" src="assets/js/load_apps.js"></script>
<script type="text/javascript" src="assets/js/image.load.js"></script>
<script type="text/javascript" src="assets/js/events.js"></script>
<script type="text/javascript" src="assets/js/main.js"></script>
<script type="text/javascript">
$(function(){
var qtdAppsLoaded = 0;
var $imgs = $(".loading-apps img");
//console.log($imgs.length);
$imgs.imageLoad(function(){
qtdAppsLoaded++;
//console.log("img logged = "+qtdAppsLoaded);
//console.log($(this).parents(".app").attr("id"));
loadingApps(qtdAppsLoaded);
});
});
</script>
<!--[if IE 6]>
<style>
#logo {
margin-left:5px;
}
.box-app h1 {
padding-top:0px;
}
.app h1 span {
margin-top:-27px;
}
#carregando {
position:absolute;
left:45%;
width:90px;
}
</style>
<![endif]-->
<!--[if IE 7]>
<style>
#logo {
margin-left:10px;
}
.box-app h1 {
padding-top:0px;
}
.app h1 span {
margin-top:-27px;
}
#carregando {
position:absolute;
left:45%;
width:90px;
}
.container_12 .grid_4 {
width: 31.111%;
}
.container_12 .grid_7 {
width: 56.111%;
}
</style>
<![endif]-->
</head>
<body>
<div id="carregando">Carregando...</div>
<div class="container_12">
<!-- #################### -->
<!-- TOPO -->
<!-- #################### -->
<div class="grid_12 topo" id="topo-banner">
<!-- #################### -->
<!-- BLOCO ESQUERDA -->
<!-- #################### -->
<div class="grid_7 box-logo omega" id="box-logo">
<div id="logo">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="110" height="110" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="images/logo.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#990000" /><embed src="images/logo.swf" quality="high" wmode="transparent" bgcolor="#990000" width="110" height="110" name="logo" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
</div>
<a href="<?php echo Config::get('baseurl'); ?>"><img src="images/escrito-bureau.gif" style="float:left;" id="escrito" /></a>
</div>
<!-- #################### -->
<!-- BLOCO DIREITA -->
<!-- #################### -->
<div class="grid_5 omega" id="banner-on-right">
<!-- #################### -->
<!-- MENU SUPERIOR -->
<!-- #################### -->
<div class="grid_12 menu-superior">
<a href="">Quem Somos</a> | <a href="">Ajuda</a> | <a href="">Contato</a> | <a href="?restaurar">Restaurar</a> |
<?if(!Session::isLogged()):?>
<a href="<?echo LinkController::getBaseURL()?>/cadastro" class="l1">Cadastre-se</a>
<?else:?>
<a href="" class="l1">Olá, <?echo Session::getLoggedUser()->getFirstName()?></a> |
<?endif?>
</div>
<div class="clear"></div>
<div id="on-right">
<!-- #################### -->
<!-- FORM LOGIN -->
<!-- #################### -->
<?//if(!Session::isLogged()):?>
<div class="grid_7 form-login" id="form-login-main">
<?if(isset($_GET['login-fail'])):?>
<div class="error">usuário e/ou senha inválidos</div>
<?endif?>
<form action="login" method="POST">
<?if(!Session::isLogged()):?>
Usuário: <input name="username" type="text" value="" class="inpt-txt" /> <br />
Senha: <input name="password" type="password" value="" class="inpt-txt" /> <br />
<span id="updateAll" class="updating-all">
<img style="margin-top: 3px;" src="<?echo LinkController::getBaseURL()?>/images/refresh.png" alt="Atualizar tudo" title="Atualizar todas as caixas abertas"/>
</span>
<span id="ajaxRefreshGif" class="updating-all" style="display: none">
<img style="margin-top: 3px; margin-bottom: 1px;" src="<?echo LinkController::getBaseURL()?>/images/ajax-refresh.gif"/>
</span>
<a id="forget-pass" href="" class="l1">esqueci senha</a>
<input type="submit" value="logar" id="bt-logar" />
<?else:?>
Usuário: <input name="username" type="text" value="<?echo Session::getLoggedUser()->username()?>" class="inpt-txt" /> <br />
Senha: <input name="password" type="password" value="xxxxx" class="inpt-txt" /> <br />
<span id="updateAll" class="updating-all">
<img style="margin-top: 3px;" src="<?echo LinkController::getBaseURL()?>/images/refresh.png" alt="Atualizar tudo" title="Atualizar todas as caixas abertas"/>
</span>
<span id="ajaxRefreshGif" class="updating-all" style="display: none">
<img style="margin-top: 3px; margin-bottom: 1px;" src="<?echo LinkController::getBaseURL()?>/images/ajax-refresh.gif"/>
</span>
<a href="" class="l1" id="save-config">Salvar esta configuração</a>
| <a href="<?echo LinkController::getBaseURL()?>/logout" class="l1" id="logout">sair</a>
<?endif?>
</form>
</div>
<?//endif?>
<!-- #################### -->
<!-- APOIO -->
<!-- #################### -->
<div class="grid_5 apoios" id="apoios">
<div id="imgs-apoios">
<img src="images/apoio-gov.gif" style="margin-left:2px;margin-top:1px;" />
<img src="images/apoio-ufla.jpg" style="margin-top:2px;margin-left:2px;" />
<img src="images/apoio-cim.jpg" style="margin-left: 12px;margin-top:2px;" />
<img src="images/apoio-fapemig.jpg" style="margin-top:6px;margin-left:3px;" />
<img src="images/apoio-polo.gif" style="margin-top:2px;margin-left:9px;" />
</div>
</div>
</div>
</div>
<!-- Fim Topo -->
</div>
<div style="clear"></div>
<!-- #################### -->
<!-- MENU APPS -->
<!-- #################### -->
<div class="grid_12 menu-apps">
<ul>
<li><a href="" id="lnk-publicacoes">Publicações</a></li>
<li><a href="" id="lnk-noticias">Notícias</a></li>
<li><a href="" id="lnk-cotacoes">Cotações</a></li>
<li><a href="" id="lnk-videoteca">Videoteca</a></li>
<li><a href="" id="lnk-metereologia">Meteorologia</a></li>
<li class="ultimo"><a href="" id="lnk-datacenter">Data Center</a></li>
</ul>
<!-- Fim Menu Apps -->
</div>
<div style="clear"></div>
<div id="aplicacoes">
<?php
require_once('carrega_apps.php');
?>
<!-- Fim Aplicacoes -->
</div>
<div class="clear"></div>
<div class="grid_12 rodape">
<p>Bureau de Inteligência Competitiva do Café</p>
</div>
<!-- Fim container_12 -->
</div>
<div id="window-cotation">
</div>
<div id="window-forgetPassword" style="display: none">
<form id="new-password" action="<?echo LinkController::getBaseURL()?>/user/forgetpassword">
<div class="fields">
<label>email cadastrado:</label>
<input id="f-email" type="text"/>
</div>
<div class="fields">
<label>nome de usuário:</label>
<input id="f-username" type="text"/>
</div>
<div class="fields">
<button id="get-new-pass">solicitar nova senha</button>
</div>
</form>
</div>
</body>
</html>
<?
}else{
if(LinkController::link() == 'login') {
require_once 'core/Login/process_login.php';
}else {
try {
require_once LinkController::rest();
}catch(Exception $err) {
echo $err->getMessage();
}
}
}
?>