Example #1
0
<?php

include "/func/func.php";
include "/func/class.login.php";
// LOGIN START
$log = new logmein();
$log->encrypt = true;
//set encryption
//parameters are(SESSION, name of the table, name of the password field, name of the username field)
if ($log->logincheck($_SESSION['loggedin'], "logon", "password", "useremail") == false) {
    echo '<meta http-equiv="refresh" content="0; URL=index.php">';
} else {
    //LOGIN END
    // PASSWORD GENERATION
    header_show("Utilisateurs", "style2");
    //////////////////////
    //CREATE USER
    /////////////////////
    // Vérifie que les informations ont été correctement entrer
    $pass = trim($_POST['pass']);
    $login = $_POST['login'];
    $login = str_replace('"', '', $login);
    $login = str_replace("'", '', $login);
    $login = trim($login);
    $pass_confirm = trim($_POST['pass_confirm']);
    if ($pass == "" || $login == "" || $pass_confirm == "") {
        // DO NOTHING (car on ne peut pas deviner si y a eu un post
    } else {
        if ($pass == $pass_confirm) {
            //VERIFICATION existance du login
            $log = new logmein();
Example #2
0
<?php

$pagearray = array("home", "help", "about", "newpatient", "viewpatient", "account", "select", "messages");
$which = $_SERVER["QUERY_STRING"];
include "../../class.login.php";
$log = new logmein();
//Instentiate the class
$log->dbconnect();
//Connect to the database
$log->encrypt = true;
//set to true if password is md5 encrypted. Default is false.
if ($log->logincheck($_SESSION['loggedin']) == false || $_SESSION['userlevel'] != 1) {
    //do something if NOT logged in. For example, redirect to login page or display message.
    echo "Restricted Access: You are not logged in!";
} else {
    //do something if timeout occurs.
    if (isset($_SESSION['start'])) {
        $session_life = time() - $_SESSION['start'];
        if ($session_life > $inactive) {
            $log->timeout();
        }
    }
    $_SESSION['start'] = time();
    ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Physician | Home</title>
    <meta name="Author" content="Ryan Kane" />
Example #3
0
<?php

include "class.login.php";
$log = new logmein();
//Instentiate the class
$log->dbconnect();
//Connect to the database
$log->encrypt = true;
//set to true if password is md5 encrypted. Default is false.
if ($log->logincheck($_SESSION['loggedin']) == false) {
    header("Location:interface/login/login.php");
} else {
    if ($_SESSION['userlevel'] == 0) {
        header("Location:interface/admin/main.php");
    } else {
        if ($_SESSION['userlevel'] == 1) {
            header("Location:interface/physician/main.php");
        } else {
            if ($_SESSION['userlevel'] == 2) {
                header("Location:interface/receptionist/main.php");
            } else {
                if ($_SESSION['userlevel'] == 3) {
                    header("Location:interface/pharmacisit/main.php");
                }
            }
        }
    }
}