Пример #1
0
<?php

session_start();
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
    header("Location: /dashboard/login");
} else {
    require "../userLog.php";
    $username = $_SESSION['username'];
    $data = my_query('s', array(&$username), "SELECT * FROM user WHERE username = ?");
    $userID = $data['ID'];
    recordEvent('log out', $userID);
    if (session_destroy()) {
        header("Location: /index");
    }
}
Пример #2
0
<?php

include 'functions.php';
$session_id = array_key_exists('sid', $_COOKIE) ? $_COOKIE['sid'] : '';
$page_name = array_key_exists('page_name', $_GET) ? $_GET['page_name'] : '';
$subject_name = array_key_exists('subject_name', $_GET) ? $_GET['subject_name'] : '';
$event_name = array_key_exists('event_name', $_GET) ? $_GET['event_name'] : '';
$current_time = array_key_exists('current_time', $_GET) ? $_GET['current_time'] : '';
$current_time_ms = array_key_exists('current_time_ms', $_GET) ? $_GET['current_time_ms'] : '';
if (in_array($page_name, $PAGES)) {
    recordEvent($session_id, $page_name, $subject_name, $event_name, $current_time, $current_time_ms);
}
Пример #3
0
            recordEvent(1, 'show_popup', $dataPayload, $timer);
            break;
            // Only ever in Bucket 1
        // Only ever in Bucket 1
        case 'surpressed_popup':
            recordEvent(1, 'surpressed_popup', $dataPayload, $timer);
            break;
            // Only ever in Bucket 1
        // Only ever in Bucket 1
        case 'click_popup_link':
            recordEvent(1, 'click_popup_link', $dataPayload, $timer);
            break;
            // Only ever in Bucket 2
        // Only ever in Bucket 2
        case 'click_nav_link':
            recordEvent(2, 'click_nav_link', $dataPayload, $timer);
            break;
        default:
            // No idea what's being attempted.
            $response_code = 400;
            $response = array('success' => false, 'message' => '"' . htmlspecialchars($_POST['method']) . '" is not a valid method.');
            // Get us out of here, we know this has gone wrong.
            return;
    }
    // Method is valid, we've done a thing, send a reply.
    $response = array('success' => true);
}
if (isset($response_code)) {
    http_response_code($response_code);
}
header("Cache-Control: no-cache, must-revalidate");
Пример #4
0
            $id = $data['ID'];
            if (strcmp($username, $data['Username']) !== 0) {
                //no account
                $_SESSION['no_account'] = true;
                header("Location: /dashboard/login");
            }
            if (password_verify($password, $data['Password'])) {
                $_SESSION['login'] = "******";
                $_SESSION['username'] = $username;
                $_SESSION['email'] = $data['Email'];
                $_SESSION['orgID'] = $data['OrgID'];
                $_SESSION['admin'] = $data['admin'];
                date_default_timezone_set('America/Los_Angeles');
                $date = new DateTime();
                $_SESSION['time'] = $date->format('Y-m-d H:i:s');
                recordEvent('log in', $id);
                header("Location: /dashboard/index");
            } else {
                //incorrect password
                $_SESSION['incorrect_pass'] = true;
                header("Location: /dashboard/login");
            }
            my_disconnect();
        } else {
            ?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">