function set_provision_server($ip_endpoint, $ip_server)
{
    $options = array(CURLOPT_POSTFIELDS => "setting_server=tftp://{$ip_server}&Settings=Save");
    if ($ch = curl_init("http://{$ip_endpoint}/advanced_update.htm")) {
        curl_setopt_array($ch, $options);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $output = curl_exec($ch);
        curl_close($ch);
        return reboot($ip_endpoint);
    } else {
        return FALSE;
    }
}
Beispiel #2
0
<?php

//philum_plugin GPLv3+
session_start();
ini_set('display_errors', 1);
error_reporting(6135);
if ($_SESSION['dev'] == 'dev' or $_SESSION['dev'] == 'lab') {
    $b = 'b';
}
if (!function_exists('p')) {
    require 'prog' . $b . '/lib.php';
}
connect();
if (!$_SESSION['dayx']) {
    req('boot');
    reboot();
}
if (!$_SESSION['picto']) {
    $_SESSION['picto'] = msql_read('system', 'edition_pictos', '', 1);
}
//require('plug/msql.php');
//require('plug/mysql.php');
function load_plug($d, $p, $o)
{
    //$_GET['plug']=1;
    if (function_exists('plug_' . $d)) {
        return call_user_func('plug_' . $d, $p, $o);
    }
}
function plug_hlp($d)
{
Beispiel #3
0
function log_mods()
{
    $use = ses('USE');
    switch ($_GET['log']) {
        case "on":
            $usr = $_POST['user'] ? $_POST['user'] : "******";
            $ret = login($usr, $_POST['pass'], $_POST['mail']);
            break;
        case "in":
            $ret = loged('', '', '');
            break;
        case "out":
            $_SESSION['USE'] = '';
            $_SESSION['auth'] = '';
            $dayz = $_SESSION['dayx'] - 86400;
            setcookie('use', $use, $dayz);
            $_COOKIE['use'] = '';
            $_COOKIE['iq'] = '';
            setcookie('iq', $_SESSION['iq'], $dayz);
            $_SESSION['nuse'] = 1;
            break;
        case "reboot":
            reboot();
            relod('/');
            break;
        case "create_hub":
            $_POST['create_hub'] = ses('qb');
            $ret = login(ses('qb'), "pass", '');
            break;
        case "off":
            $qd = $_SESSION['qd'];
            $dev = $_SESSION['dev'];
            session_destroy();
            $_SESSION['qd'] = $qd;
            $_SESSION['dev'] = $dev;
            relod('/?qd=' . $qd);
            break;
        case "down":
            session_destroy();
            relod("/");
            break;
    }
    if ($ret) {
        alert($ret);
    } elseif (!$use && rstr(59) && !$_SESSION['nuse']) {
        if ($_COOKIE['use']) {
            $iq = verif_user($_COOKIE['use'], '');
            if ($_COOKIE['iq'] == $iq && $iq) {
                $_SESSION['USE'] = $_COOKIE['use'];
                $_SESSION['iq'] = $_COOKIE['iq'];
            }
        }
    }
}
Beispiel #4
0
function apps_menubub($dr)
{
    //root,action,type,button,icon,auth
    $r = msql_read('users', ses('qb') . '_menubub_1', '', 1);
    if (!$_SESSION['line']) {
        req('boot');
        reboot();
    }
    if ($r) {
        foreach ($r as $k => $v) {
            $bt = $v[3] ? $v[3] : $v[1];
            if ($v[2] == 'plug') {
                $ret[] = array($v[3], $v[2], $v[1], '', '', '', $v[0], $v[4], '', $v[5]);
            } elseif ($v[2] == 'module') {
                $ret[] = array($v[3], $v[2], $v[1], '', '', '', $v[0], '', '', $v[5]);
            } elseif ($v[2] == 'ajax') {
                $ret[] = array($v[3], $v[2], $v[1], '', '', '', $v[0], $v[4], '', $v[5]);
            } elseif ($v[2]) {
                $ret[] = array($v[3], $v[2], '', $v[1], '', '', $v[0], $v[4], '', $v[5]);
            } else {
                if ($_SESSION['line'][$v[1]]) {
                    $type = 'desktop';
                    $process = 'arts';
                } elseif (is_numeric($v[1])) {
                    $type = 'art';
                } else {
                    $type = 'url';
                }
                $ret[] = array($v[3], $type, $process, $v[1], '', '', $v[0], $v[4], '', $v[5]);
            }
        }
    }
    return $ret;
}
Beispiel #5
0
function rebootController()
{
    global $app;
    $params = loadParameters();
    switch (strtoupper($app->request()->getMethod())) {
        case 'GET':
            $result = reboot($params["info"]);
            break;
    }
    PrepareResponse();
    $app->response()->setBody(json_encode($result));
}
    case 'prevaudio':
        $result = send('j');
        break;
    case 'togglesubtitles':
        $result = send('s');
        break;
    case 'nextsubtitles':
        $result = send('m');
        break;
    case 'prevsubtitles':
        $result = send('n');
        break;
    case 'next_vid':
        $result = send('next_vid');
        break;
    case 'shutdown':
        $result = shutdown();
        break;
    case 'reboot':
        $result = reboot();
        break;
    case 'continous':
        $result = togglefile(CONTINOUS);
        break;
    case 'loopall':
        $result = togglefile(LOOPALL);
        break;
    default:
        $err = 'wrong command';
}
$GLOBALS['_RESULT'] = $result;
Beispiel #7
0
 events("{$mem}MB after declarations", "MAIN", __LINE__);
 if (strlen($argv[1]) > 2) {
     events("parsing command line {$argv[1]}", "MAIN", __LINE__);
 }
 if ($argv[1] == "--nice") {
     echo "{$GLOBALS["NICE"]}\n";
     exit;
 }
 if ($argv[1] == "--klms") {
     echo klms_status();
     echo klmsdb_status();
     echo klms_milter();
     die;
 }
 if ($argv[1] == "--reboot") {
     echo reboot();
     exit;
 }
 if ($argv[1] == "--all") {
     events("-> launch_all_status_cmdline()", "MAIN", __LINE__);
     $GLOBALS["NOSTATUSTIME"] = true;
     launch_all_status_cmdline();
     if ($GLOBALS["VERBOSE"]) {
         echo "DONE\n\n\n";
     }
     die;
 }
 if ($argv[1] == "--gold") {
     echo gold();
     exit;
 }