-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathperfil-home.php
More file actions
171 lines (134 loc) · 5.51 KB
/
perfil-home.php
File metadata and controls
171 lines (134 loc) · 5.51 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
<?php
header("Expires: Tue, 03 Jul 2001 06:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
include('autentica-saml.php');
include('config.php');
putenv("NLS_SORT=BINARY_AI");
putenv("NLS_COMP=LINGUISTIC");
putenv("NLS_LANG=BRAZILIAN PORTUGUESE_BRAZIL.UTF8");
if(isset($_SESSION['dadosusp']['nusp'])){
$pcodpes = intval(trim($_SESSION['dadosusp']['nusp']));
$conn = oci_connect(DBUSR, DBPWD, DBURL);
// EXCLUI IDENTIFICADOR
if(filter_input(INPUT_GET,'op') == 'del'){
if(filter_input(INPUT_GET,'type') == 'ORCID'){
$stmt="BEGIN perfil_sibi.exclui_identificador(:pcodpes,'ORCID',:pvalue); END;";
$pvalue = filter_input(INPUT_GET,'val');
$stid = oci_parse($conn, $stmt);
if(!$stid){ exit; }
oci_bind_by_name($stid,':pcodpes',$pcodpes);
oci_bind_by_name($stid,':pvalue',$pvalue);
oci_execute($stid);
$stmt="BEGIN perfil_sibi.exclui_identificador(:pcodpes,'ORCIDTOKACC',:pvalue); END;";
$pvalue = filter_input(INPUT_GET,'val');
$stid = oci_parse($conn, $stmt);
if(!$stid){ exit; }
oci_bind_by_name($stid,':pcodpes',$pcodpes);
oci_bind_by_name($stid,':pvalue',$pvalue);
oci_execute($stid);
}
oci_commit($conn);
oci_free_statement($stid);
oci_close($conn);
header('Location: perfil-home.php');
}
// EXCLUI IDENTIFICADOR
// CV LATTES [INICIO]
$stmt="BEGIN perfil_sibi.atualiza_identificador_lattes(:pcodpes); END;";
$stid = oci_parse($conn, $stmt);
if(!$stid){ exit; }
oci_bind_by_name($stid,':pcodpes',$pcodpes);
oci_execute($stid);
oci_commit($conn);
// CV LATTES [FIM]
$stmt="select kprop, iprop, vprop from perfis where autid = :autid order by kprop, iprop";
$stid = oci_parse($conn, $stmt);
if(!$stid){ exit; }
oci_bind_by_name($stid,':autid',$pcodpes);
oci_execute($stid);
$rperfil = array();
while($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)){
$rperfil[$row['KPROP']][$row['IPROP']] = $row['VPROP'];
}
oci_free_statement($stid);
oci_close($conn);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Perfil SIBiUSP</title>
<link rel="stylesheet" href="inc/uikit-2.27.1/css/uikit.min.css" />
<link rel="stylesheet" href="inc/style.css" />
<link rel="stylesheet" href="inc/orcid.css" />
<script src="inc/jquery-3.1.1.min.js"></script>
<script src="inc/uikit-2.27.1/js/uikit.min.js"></script>
<script src="inc/uikit-2.27.1/js/components/lightbox.js"></script>
<script type=text/javascript>
var oauthWindow;
function openORCID() {
// var oauthWindow = window.open("orcid.php", "_blank", "toolbar=no, scrollbars=yes, width=580, height=" + (outerHeight*0.8) + ", top=" + (screenY + (outerHeight - innerHeight)*0.2) + ", left=" + (screenX + (innerWidth - 580)*0.5));
location.href="orcid.php";
}
</script>
</head>
<body>
<?php include 'inc/header.inc' ?>
<h1>
Perfil SIBiUSP
</h1>
<ul>
<li style="line-height: 2">Nome: <b><?=$_SESSION['dadosusp']['nome']?></b></li>
<li style="line-height: 2">Número USP: <a href="//uspdigital.usp.br" target="_blank"><?=$_SESSION['dadosusp']['nusp']?></a></li>
<?php
if(array_key_exists('LATTES',$rperfil)){
foreach($rperfil['LATTES'] as $kl => $vl){
?>
<li style="line-height: 3"><div style="line-height:1"><a href="http://lattes.cnpq.br"><img id="CNPQ Lattes logo" alt="CNPQ Lattes logo" src="img/logo-curriculo_cut.png" width="16" height="16" /></a> <a href="http://lattes.cnpq.br/<?=$rperfil['LATTES'][$kl]?>" target="_blank">http://lattes.cnpq.br/<?=$rperfil['LATTES'][$kl]?></a> (obtido do sistema corporativo)</div></li>
<?php
}
}
if(array_key_exists('ORCID',$rperfil)){
foreach($rperfil['ORCID'] as $ko => $vo){
?>
<li style="line-height: 3"><div style="line-height:1"><a href="http://<?=ORCID_HOSTBASE?>"><img alt="ORCID logo" src="//orcid.org/sites/default/files/images/orcid_16x16.png" width="16" height="16" /></a> <a href="https://<?=ORCID_HOSTBASE?>/<?=$rperfil['ORCID'][$ko]?>" target="_blank">http://<?=ORCID_HOSTBASE?>/<?=$rperfil['ORCID'][$ko]?></a> (<a href="perfil-home.php?op=del&type=ORCID&val=<?=$rperfil['ORCID'][$ko]?>"> desconectar </a>)</div></li>
<?php
}
// <li><a href='orcid.php' title="ORCID" >adicionar outro ORCID</a></li>
?>
<?php
} else {
?>
<li style="line-height: 3"><button id="connect-orcid-button" onclick="openORCID()"><img id="orcid-id-logo" src="//orcid.org/sites/default/files/images/orcid_24x24.png" width='24' height='24' alt="ORCID logo"/>Criar ou Associar seu ORCID iD</button> <div style="display: inline-block; vertical-align: top; background-color: #E8E8E8; padding: .8em; color: #666; font-size: .9em; width: 50%; line-height: 1">ORCID fornece um identificador digital consistente que o identifica unicamente dentre outros pesquisadores. Veja mais em <a href="http://<?=ORCID_HOSTBASE?>" target="_blank" >http://<?=ORCID_HOSTBASE?></a>.</div>
</li>
<!-- ORCID: Não obtido (<a href='orcid.php' title="ORCID" >criar ou associar seu ORCID</a>)</li> <! -- data-uk-lightbox -->
<?php
}
?>
</ul>
<br/>
<a href="autentica-saml.php?logout=perfil-inicio.php">sair</a>
<br/><br/><br/><br/><br/>
<h6>
Problemas? Envie um e-mail para <a href="mailto:atendimento@sibi.usp.br">atendimento@sibi.usp.br</a>.
</h6>
</div>
<?php
/*
<pre>
< ?
print_r($rperfil);
? >
</pre>
*/
?>
</body>
</html>
<?php
} else {
header('Location: autentica-saml.php?logout=perfil-inicio.php');
exit;
} ?>