Exemple #1
0
include "login.php";
if (isset($_GET['login'])) {
    login::showLogin();
    exit;
}
$type = "";
$loginT = null;
if (isset($userGroups) && isset($con)) {
    $loginT = new login($con, $userGroups);
    if (!$loginT->userStatus && $userGroups != "all") {
        echo "Login Failed<br>";
        login::showLogin();
        exit;
    } else {
        $type = $loginT->getType();
    }
} else {
    if (isset($userGroups)) {
        exit("Error connecting to user system");
    }
}
function showActive($page)
{
    $activePage = substr($_SERVER["SCRIPT_NAME"], strrpos($_SERVER["SCRIPT_NAME"], "/") + 1);
    //echo "\n\n$page:$activePage\n";
    $active = " class='active'";
    if ($page == $activePage) {
        return $active;
    } else {
        return "";
Exemple #2
0
<?php

include "phpGPS.php";
$db = new phpGPS_DB();
$con = $db->connectToDB();
include "login.php";
$userGroups = array("admin");
$loginT = null;
if (isset($con)) {
    $loginT = new login($con, $userGroups);
    if (!$loginT->userStatus && $userGroups != "admin") {
        echo "Login Failed<br>";
        login::showLogin();
        exit;
    } else {
        $type = $loginT->getType();
    }
}
$delete = false;
if (isset($_GET['delete']) && $_GET['delete'] == "true") {
    $delete = true;
}
$viewQuery = false;
if (isset($_GET['viewQuery']) && $_GET['viewQuery'] == "true") {
    $viewQuery = true;
}
if (!isset($_GET['table']) || $_GET['table'] == "") {
    exit("Table not set");
}
if (!isset($_GET['where']) || $_GET['where'] == "") {
    exit("Where not set");
Exemple #3
0
include "login.php";
include "phpGPS.php";
$db = new phpGPS_DB();
$con = $db->connectToDB();
//Check login info
$userGroups = array("admin", "users");
$loginT = null;
if (isset($con)) {
    $loginT = new login($con, $userGroups);
    if (!$loginT->userStatus && $userGroups != "admin") {
        echo "Login Failed<br>";
        login::showLogin();
        exit;
    } else {
        $type = $loginT->getType();
    }
}
//Load Vars from URL
if (!isset($_GET['user']) || $_GET['user'] == "") {
    exit("user not set");
}
$userToChange = phpGPS_DB::cleanInput($_GET['user']);
if (!isset($_GET['oldpass']) || $_GET['oldpass'] == "") {
    if ($loginT->getType() != "admin") {
        exit("oldpass not set");
    }
}
$oldPass = phpGPS_DB::cleanInput($_GET['oldpass']);
if (!isset($_GET['newpass']) || $_GET['newpass'] == "") {
    exit("newpass not set");