Exemplo n.º 1
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/_lib/inc/config.inc';
misc_redirect('/informacion/');
Exemplo n.º 2
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/_lib/inc/config.inc';
misc_redirect('/user/sign-in/');
Exemplo n.º 3
0
# If user is connecting to the API via User Name and Key
if (isset($_POST['user']) and isset($_POST['key'])) {
    if (empty(isset($_POST['user'])) or empty(isset($_POST['key'])) or empty(isset($_POST['flag']))) {
        exit('Error Missing argument!');
    } else {
        if (filter_var(shell_exec("/usr/bin/sudo /opt/onyx/onyx-api --userauth {$user} {$key} 1"), FILTER_VALIDATE_BOOLEAN)) {
            exec('/usr/bin/sudo /opt/onyx/onyx-api' . $args . $debug, $output, $code);
            exit(implode("\r\n", $output));
        } else {
            exit(1);
        }
    }
}
# If user has not yet authenticated
if (!isset($_SESSION['user'])) {
    if (empty(isset($_POST['user'])) or empty(isset($_POST['pass']))) {
        exit('Error Missing argument!');
    } else {
        if (filter_var(shell_exec("/usr/bin/sudo /opt/onyx/onyx-api --userauth {$user} {$pass}"), FILTER_VALIDATE_BOOLEAN)) {
            $_SESSION['user'] = $_POST['user'];
            misc_redirect('/test/');
        } else {
            exit(1);
        }
    }
}
# if user is already authenticated
if (isset($_SESSION['user'])) {
    exec('/usr/bin/sudo /opt/onyx/onyx-api' . $args . $debug, $output, $code);
    exit(implode("\r\n", $output));
}