Example #1
0
function OnRequest()
{
    $requestMethod = $_SERVER['REQUEST_METHOD'];
    if (ModelFacade::checkLoggedIn()) {
        //redirect if user is logged in
        header("Location: /Index.php");
    }
    if ($requestMethod == "GET") {
        loginGet();
    } else {
        loginPost();
    }
}
Example #2
0
<?php

include '../includes/allpage.php';
$iduser = control_post($_POST['iduser']);
$_SESSION['iduser'] = $iduser;
$user = loginGet($iduser);
if ($user['password'] == $_POST['password']) {
    $_SESSION['username'] = $user['name'];
    //$_SESSION['expire'] = time() + (15 * 60);
    $_SESSION['expire'] = 15 * 60 * 60;
    //15minute, 3h = 3*60*60
    $_SESSION['last_activity'] = time();
    echo 'ok';
} else {
    echo 'Verificar password';
}
closeDataBase();
?>

Example #3
0
            ?>
	            <tr>  
	                <td>
	                	<?php 
            if ($data['gr_number'] == "") {
                $idguia = $data['gr_id'];
            } else {
                $idguia = $data['gr_number'];
            }
            echo $idguia;
            ?>
                		
	                </td>
	                <td>
	                    <?php 
            $data2 = loginGet($data['us_id']);
            echo $data2['us_name'];
            ?>
	                </td>
	                <td><?php 
            echo $data['modif_date'];
            ?>
</td>
	                <td><?php 
            echo $data['modif_text'];
            ?>
</td>                
	            </tr>
	            <?php 
        }
    } else {