예제 #1
0
function verificaUsuario()
{
    if (!usuarioLogado()) {
        $alertUser = new AlertaBancoUsuario();
        $alertUser->Falha("acesso-negado");
    }
}
예제 #2
0
<?php

include 'cabecalho.php';
include 'logica-usuario.php';
?>
				<h1>BEM VINDOS!</h1>
				<h2>login</h2>

				<?php 
if (usuarioEstaLogado()) {
    ?>
					<p class="alert-success">Voce está logado como <?php 
    echo usuarioLogado();
    ?>
.</p>
					<a href="logout.php" class="btn btn-primary">Logout</a>
				<?php 
} else {
    ?>
				<form action="login.php" method="post">
					<table class="table">
						<tr>
							<td>Email <input class="form-control" type="email" name="email"/></td>
						</tr>

						<tr>
							<td>Senha <input class="form-control" type="password" name="senha"/></td>
						</tr>

						<tr>
							<td><button class="btn btn-primary">Login</button></td>
예제 #3
0
<?php

require '../../Download.php';
require_once '../../logica-usuario.php';
require_once "../../autoload.php";
if (!usuarioLogado()) {
    $_SESSION['danger'] = "Acesso Negado!";
    header("Location: /Loja");
    die;
}
tipoUser();
if (!isset($_GET['registro'])) {
    $_SESSION['danger'] = "Acesso negado";
    header("Location:../../menu.php ");
    die;
}
$arquivo = $_GET['registro'];
$tipo = $_GET['tipo'];
download($tipo . "-" . $arquivo . ".txt");
예제 #4
0
파일: index.php 프로젝트: hugovallada/Loja
<?php

require_once "logica-usuario.php";
require_once "cabecalho-login.php";
require_once "logica-cadastro.php";
if (usuarioLogado()) {
    logout();
}
if (isset($_SESSION['duraLog'])) {
    echo $_SESSION['duraLog'];
}
verificaCadastroExiste();
?>


       <h1>Bem Vindo</h1>
		
		<div class="login index">	
			<h2>Login</h2>
			<form method="POST" action="login.php">
				<table class="table">
					<tr>
						<td><label for="email-usuario">E-mail</label></td>
						<td>
							<input id="email-usuario" class="form-control" type="email" name="email" minlength="5" 
							 required="required" autofocus pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{1,63}$" 
							 title="O login deve ser no formato example@example.com" value="<?php 
echo $_SESSION['email'];
?>
"/>
						 </td>