-
Notifications
You must be signed in to change notification settings - Fork 0
/
exec.loginjabot.php
60 lines (50 loc) · 1.59 KB
/
exec.loginjabot.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
<?php session_start();
//error_reporting(E_ALL);
//ini_set('display_errors','1');
require_once('classes/usuario.class.php');
require_once('classes/conexao.class.php');
require_once('classes/experimento.class.php');
$conexao = new Conexao;
$conn = $conexao->Conectar();
$Usuario = new Usuario();
$Usuario->conn = $conn;
$Experimento = new Experimento();
$Experimento->conn = $conn;
if(!empty($_REQUEST['login'])){
$login = $_REQUEST['login'].'.jabot';
$name = $_REQUEST['name'];
$password = $_REQUEST['password'];
// $login = $json->login;
$especies = '';//$json->scientific_name;
//print_r($_REQUEST);
//exit;
if ($Usuario->getUsuarioByLogin($login)==0)
{
if (!empty($login))
{
// não é vazio;
$Usuario->login = $login;
$Usuario->name = $login;
$Usuario->password = $login;
$Usuario->email = '';
$Usuario->idstatususer = 1; //Taxonomista Geral
$Usuario->idusertype = 6;
$Usuario->idinstitution = 5;
$idusuario = $Usuario->incluir();
$Usuario->getById($idusuario);
}
}
$_SESSION['s_idusuario']=$Usuario->iduser;
$_SESSION['s_nome']=$Usuario->name;
$_SESSION['s_email']=$Usuario->email;
$_SESSION['ID_SESSION']=session_id();
$_SESSION['s_idsituacaousuario']=$Usuario->idstatususer;
$_SESSION['s_idtipousuario']=$Usuario->idusertype;
$_SESSION['s_sistema']='MODEL-R';
$_SESSION['s_taxon']='';//$especies;
$_SESSION['donoDaSessao']=md5('seg'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);
header("Location: consexperimento.php");
} else {
header('Location: index.php');
}
?>