Exemplo n.º 1
0
function showIndex()
{
    showPage(NULL, 'index', def_menu(), '', false);
}
#
function offline()
{
    if (file_exists('./maintenance.txt')) {
        $ip = $_SERVER['REMOTE_ADDR'];
        if ($ip != '192.168.1.666') {
            gopage(NULL, NULL, file_get_contents('./maintenance.txt'), 'offline', NULL, '', '', false, false, false);
        }
    }
}
#
offline();
#
session_start();
#
include_once 'db.php';
#
function validUserPass($user, $pass, $twofa)
{
    $rep = checkPass($user, $pass, $twofa);
    if ($rep != null) {
        $ans = repDecode($rep);
    }
    usleep(500000);
    // Max twice per second
    if ($rep != null && $ans['STATUS'] == 'ok') {
        $key = 'ckp' . rand(1000000, 9999999);
Exemplo n.º 2
0
function generic($u, $t, $r = null)
{
    $cc = new cURL();
    if (preg_match('@(.+?\\.[a-z]{2,4}/)(.+?/)embed@', $u, $m)) {
        if ($r != null) {
            $cc->headers[] = "Referer: {$r}";
        }
        $ff = $cc->get($u);
        if (preg_match('@[\'"](.*?m3u8.*?)[\'"]@', $ff, $mm)) {
            if (preg_match('@^http@', $mm[1])) {
                $tmp = $mm[1];
            } elseif ($mm[1][0] == "/") {
                $tmp = $m[1] . ltrim($mm[1], "/");
            } else {
                $tmp = $m[1] . $m[2] . $mm[1];
            }
            livestreamer_cmd($tmp, $t, array("Referer" => $r));
        } elseif (preg_match('@[\'"]{0,1}streamer[\'"]{0,1} *= *[\'"](rtmp:.*?)[\'"]@', $ff, $mm)) {
            $url = $mm[1];
            if (preg_match('@[\'"]{0,1}file[\'"]{0,1} *= *[\'"](.*?)[\'"]@', $ff, $mmm)) {
                $url .= $mmm[1];
            }
            rtmpdump_cmd($url, $t);
        } else {
            offline();
            stf($ff);
        }
    } else {
        echo "{$u}: no match...\r\n";
    }
}
Exemplo n.º 3
0
function server_quit()
{
  for ($i = 0; $i < count($GLOBALS['users']); $i++) {
    offline($GLOBALS['users'][$i]['name']);
  }
}
Exemplo n.º 4
0
/**
 * Push all users offline if server quit
 */
function server_quit()
{
    $users = Zend_Registry::get('users');
    for ($i = 0; $i < count($users); $i++) {
        offline($users[$i]['name']);
    }
}