Ejemplo n.º 1
0
 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
include_once "includes/config.php";
include_once "includes/utils.php";
include_once "includes/headfoot.php";
initSession();
if (!($_SESSION['loggedinUserPerms'] & VIEW_ZONES)) {
    die('You do not have permission to view this page!');
}
$dbTrackHandler = connectDb();
// Query All Zones
$zonesQuery = $dbTrackHandler->query('SELECT * FROM zones WHERE `parent_id`=0;');
foreach ($zonesQuery as $entry) {
    $thisZone['id'] = $entry['id'];
    $thisZone['name'] = $entry['region_name'];
    $zones[] = $thisZone;
}
$totalComputers = $dbTrackHandler->query('SELECT count(*) FROM computers;')->fetch(PDO::FETCH_NUM);
$offlineComputers = $dbTrackHandler->query('SELECT count(*) FROM computers WHERE laststatus=' . AVAIBILITY_TYPE_OFFLINE . ';')->fetch(PDO::FETCH_NUM);
echo _header("System Overview");
?>
Ejemplo n.º 2
0
 function updateDoLogin($param)
 {
     global $gbl, $sgbl, $login, $ghtml;
     $session = initSession($this, null, $login->nname);
     $session->ssession_vars['return_url'] = "/display.php?frm_action=show&{$ghtml->get_get_from_current_post(array('frm_action', 'frm_subaction'))}";
     $session->write();
     $ghtml->print_redirect("/display.php?frm_consumedlogin=true&frm_action=show");
 }
Ejemplo n.º 3
0
function do_login($classname, $cgi_clientname, $ssl_param = null)
{
    global $gbl, $sgbl, $login, $ghtml;
    $url = "/display.php?frm_action=show";
    $progname = $sgbl->__var_program_name;
    if (!$classname) {
        $classname = 'client';
    }
    $sessobj = initSession($login, $ssl_param, null);
    $gbl->c_session = $sessobj;
    $login->addToList("ssession", $sessobj);
    $login->createSessionProperties();
    addToUtmp($sessobj, 'add');
    if ($ghtml->frm_extra_var) {
        $extra = unserialize(base64_decode($ghtml->frm_extra_var));
        $gbl->setSessionV('extra_var', $extra);
    }
    //This is not the way. You have to periodically scan the utmp and delete eveyrthing that had expired.
    delete_expired_ssessions();
}
Ejemplo n.º 4
0
function updatePhotoId($id)
{
    global $conn;
    $update_user = $conn->prepare("UPDATE users SET photo_id = :photo_id WHERE username = :username");
    $update_user->bindParam(':photo_id', $id, \PDO::PARAM_INT);
    $update_user->bindParam(':username', $_SESSION['username'], \PDO::PARAM_STR);
    $update_user->execute();
    initSession($_SESSION['id'], $_SESSION['username'], $id);
}
Ejemplo n.º 5
0
}
function initSession($config)
{
    if ($config->aws->dynamoSessions == true) {
        initSessionDynamoDB($config);
    }
    session_name('contest2');
    if (isset($_POST["SID"]) && $_POST["SID"] != "null") {
        session_id($_POST["SID"]);
    }
    session_start();
    if (!isset($_SESSION['CREATED'])) {
        $_SESSION['CREATED'] = time();
    } else {
        if (time() - $_SESSION['CREATED'] > 3600) {
            restartSession();
        }
    }
}
function restartSession()
{
    if (isset($_SESSION)) {
        session_destroy();
        session_unset();
    }
    session_start();
    $_SESSION['CREATED'] = time();
    // update creation time
}
initSession($config);
$db = connect($config);
Ejemplo n.º 6
0
<?php

function proCHECK()
{
    return TRUE;
}
include "path.php";
include pathrel . "client-ps/config/config.php";
include pathprivate . "includes/clientLIB.php";
$_SESSION = initSession($_SESSION);
$_SESSION = agentSession($_SESSION, $_SERVER['HTTP_USER_AGENT']);
if (!isset($_SESSION['securethis'])) {
    $itx['securethis'] = md5(uniqid(rand(), true));
    $_SESSION['securethis'] = $itx['securethis'];
}
define("securethis", $_SESSION['securethis']);
$itx['get'] = safeGet($_GET);
define("unixtime", time());
define("ip", $_SERVER["REMOTE_ADDR"]);
define("prettytime", getPrettyTime(unixtime, "GMT"));
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php 
echo siteNAME . " - " . siteMOTTO;
?>
</title>
<meta name="keywords" content="<?php 
echo siteKEYWORDS;
?>