Exemplo n.º 1
0
function login($arg) {
  global $db,$smarty;
  $jsondata = array();

  //obtenemos el usr y la pass
  $username = $arg['usr'];
  $password = $arg['password'];

  $usuario = new Usuarios($db);
  $logon = $usuario->login($username, $password);

  if($logon){
      $usrLogeado = $usuario->getUsuarioLogin($username);

      $_SESSION['logged_in'] = true;
      $_SESSION['usr'] = $usrLogeado["nombreusr"];
      $_SESSION['perfil'] = $usrLogeado["perfil"];

      //$log = new Log($db);
      //$log->crear_registro($usrLogeado["nombreusr"], "LOGIN", "", "");
      //echo $usrLogeado["nombreusr"]."-".$usrLogeado["perfil"]."-".$usrLogeado["newpass"]."-"."success";
      $jsondata["success"] = true;
  } else {
      $_SESSION['error'] = "Wrong username or password.";
      $jsondata["success"] = false;
  }

  header('Content-type: application/json; charset=utf-8');
  echo json_encode($jsondata);
  exit();
}
Exemplo n.º 2
0
 /**
  * Método sobrescrito utilizado na autenticação do usuário
  * @see library/Zend/Auth/Adapter/Zend_Auth_Adapter_Interface#authenticate()
  */
 public function authenticate()
 {
     $usuario = new Usuarios();
     $listaUsuarios = $usuario->login($this->login, $this->senha);
     //verifica se foi retornado algum registro pela busca
     if (sizeof($listaUsuarios) > 0) {
         return $this->resultado(Zend_Auth_Result::SUCCESS, "logado com sucesso!.");
         //resultado ok
     } else {
         return $this->resultado(Zend_Auth_Result::FAILURE, "Senha ou login inválidos.");
         //resultado falhou
     }
 }
Exemplo n.º 3
0
session_start();
header("Content-Type: text/javascript");
include_once '../../../config.php';
include_once '../../../clases/Usuarios.php';
include_once '../../../clases/Log.php';
$mensaje = "";
try {
    if (isset($_GET['AJAX'])) {
        if ($_GET['ACCION'] == "loginUsuario") {
            $LOG = new Log();
            try {
                $USUARIO = new Usuarios();
                $USUARIO->email = $_GET['email'];
                $USUARIO->password = $_GET['password'];
                $USUARIO->CONFIG = $CONFIG;
                if (!$USUARIO->login()) {
                    $mensaje = "El usuario o el password no existen. Por favor, revisa los datos.";
                }
            } catch (Exception $e) {
                $LOG->registra("Login", $e->getMessage(), "Ocurrio un error al intentar firmarse con el usuario " . $email);
                $mensaje = "Ocurrio un error al intentar firmarse. Intentelo nuevamente mas tarde.";
            }
        }
    } else {
        $mensaje = "Llamada no valida";
    }
} catch (Exception $e) {
    $LOG->registra("Login", $e->getMessage(), "Ocurrio un error al intentar firmarse con el usuario " . $email);
}
echo $_GET['callback'] . "(" . json_encode($mensaje) . ")";
Exemplo n.º 4
0
function iniciarSesion($login, $password)
{
    $usuario = new Usuarios();
    return $usuario->login($login, $password);
}
Exemplo n.º 5
0
<?php

require 'php/Usuarios.php';
$usuarios = new Usuarios();
$usuarios->login();
?>
<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <link rel="stylesheet" type="text/css" href="../css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="../css/login.css">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <div class="container">
            <form action="login.php" method="post" class="form-signin">
                <h2 class="form-signin-heading">Login</h2>
                <input type="text" class="form-control" name="usuario" placeholder="Usuario/Email" required autofocus>
                <input type="password" class="form-control" name="senha" placeholder="Senha" required>
                <label class="checkbox">
                    <input type="checkbox" name="lembrar" value="remember-me"> Lembrar de mim
                </label>
                <button class="btn btn-lg btn-primary btn-block" type="submit">
                	<span class="glyphicon glyphicon-circle-arrow-right"></span> Acessar!
                </button>
            </form>
        </div>
        <script src="../js/jquery.js"></script>
		<script src="../js/bootstrap.js"></script>
    </body>
Exemplo n.º 6
0
<?php

// echo "Login PHP";
require_once 'config.php';
require_once 'conex.php';
require_once 'class/usuarios.php';
Conexion::conectar();
Usuarios::login();
Conexion::desconectar();
Exemplo n.º 7
0
    $datos = $CIUDAD->lista($filtro);
    if ($VALIDACION) {
        $DATOS = array();
        $DATOS['nombre'] = $_POST['txtNombre'];
        $DATOS['apellidos'] = $_POST['txtApellidos'];
        $DATOS['email'] = $_POST['txtEmail'];
        $DATOS['password'] = $_POST['txtPassword'];
        $DATOS['fechaNacimiento'] = $_POST['txtFechaNacimiento'];
        $DATOS['pais'] = $_POST['txtPais'];
        $DATOS['ciudad'] = array('nombre' => $_POST['txtCiudad'], 'id' => '');
        $DATOS['genero'] = $_POST['txtGenero'];
        $USUARIO->agregar($DATOS);
        $USUARIO->email = $_POST['txtEmail'];
        $USUARIO->password = $_POST['txtPassword'];
        $USUARIO->CONFIG = $CONFIG;
        $USUARIO->login();
        header("Location: authorize?client_id={$_GET['client_id']}&scope={$_GET['scope']}&status={$_GET['status']}&response_type={$_GET['response_type']}");
    }
}
//}catch(Exception $e){
//	$LOG->registra("Login", $e->getMessage(), "Ocurrio un error al intentar firmarse con el usuario " );
//}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es"><head>


	<title>Identificarse en Inova 360</title>


		<?php 
Exemplo n.º 8
0
<?php

include "loader.php";
loadclasses("model", "Usuarios.php");
loadclasses("model", "BD.php");
$login = $_POST['login'];
$pass = $_POST['password'];
if (isset($_POST['iniciarsesion'])) {
    $user = new Usuarios();
    $res = $user->login($login, md5($pass));
    if ($res) {
        session_start();
        $datos = mysqli_fetch_assoc($res);
        switch ($datos['tipo']) {
            case 'org':
                $_SESSION['login'] = $datos['login'];
                $_SESSION['tipo'] = $datos['tipo'];
                header("Location: http://localhost/G44_ZOTZ/view/organizador/index.php");
                break;
            case 'jpop':
                $_SESSION['login'] = $datos['login'];
                $_SESSION['tipo'] = $datos['tipo'];
                header("Location: http://localhost/G44_ZOTZ/view/juradopopular/index.php");
                break;
            case 'jpro':
                $_SESSION['login'] = $datos['login'];
                $_SESSION['tipo'] = $datos['tipo'];
                header("Location: http://localhost/G44_ZOTZ/view/juradoprofesional/index.php");
                break;
            case 'est':
                $_SESSION['login'] = $datos['login'];