Ejemplo n.º 1
0
function processCommands()
{
    $commandsJson = $_POST['commands'];
    if (isset($commandsJson)) {
        $commandArray = json_decode($commandsJson);
        foreach ($commandArray as $command) {
            processCommand($command);
        }
    }
}
Ejemplo n.º 2
0
function processRequest()
{
    global $modulesMgr;
    //ModRewrite handling
    $redirectUrl = getenv('REDIRECT_URL');
    if (!$redirectUrl) {
        $redirectUrl = '/';
    }
    //Kernel-level commands
    $cmd = _var('cmd');
    if ($cmd) {
        processCommand($cmd);
    }
    //Module-level commands
    $module = _post('module');
    $function = _post('function');
    // Выполнение функции $function из модуля $module
    if ($module && $function) {
        if ($modulesMgr->moduleExists($module)) {
            $modulesMgr->execute($module, $function, array(), true);
        } else {
            trigger_error("Invalid call to {$module} -> {$function}", PM_WARNING);
        }
    }
    //Admin request handling
    if (preg_match('/^(\\/admin)$/', $redirectUrl, $match) || preg_match('/^(\\/admin\\/).*/', $redirectUrl, $match)) {
        // Удалить из URL строку "/admin/"
        $redirectUrl = str_replace($match[1], '', $redirectUrl);
        // Перейти в раздел администрирования
        processAdminRequest('/' . $redirectUrl);
        return;
    }
    //Carumba orders request handling
    if (preg_match('/^(\\/carorders)$/', $redirectUrl, $match) || preg_match('/^(\\/carorders\\/).*/', $redirectUrl, $match)) {
        $redirectUrl = str_replace($match[1], '', $redirectUrl);
        processOrdersRequest('/' . $redirectUrl);
        return;
    }
    if (preg_match('/^\\/login\\/?$/', $redirectUrl)) {
        processLoginRequest();
    } else {
        processStdRequest($redirectUrl);
    }
}
Ejemplo n.º 3
0
    }
    include_once DIR_MODULES . 'patterns/patterns.class.php';
    $pt = new patterns();
    $qrys = explode(' ' . DEVIDER . ' ', $qry);
    $total = count($qrys);
    for ($i = 0; $i < $total; $i++) {
        $room_id = 0;
        $rec = array();
        $rec['ROOM_ID'] = (int) $room_id;
        $rec['MEMBER_ID'] = $user_id;
        $rec['MESSAGE'] = htmlspecialchars($qrys[$i]);
        $rec['ADDED'] = date('Y-m-d H:i:s');
        SQLInsert('shouts', $rec);
        $res = $pt->checkAllPatterns($rec['MEMBER_ID']);
        if (!$res) {
            processCommand($qrys[$i]);
        }
    }
    // Header("Location:command.php");
    // exit;
}
?>

<html>
<head>
   <title></title>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
Ejemplo n.º 4
0
function displayNowPlaying($baseurl = "")
{
    global $xbmcimgpath;
    if (!empty($_GET['style']) && $_GET['style'] == 'm' && !empty($_GET['cmd'])) {
        processCommand($_GET['cmd']);
    }
    echo "<div id=\"nowplaying\">\n";
    //json rpc call procedure
    $results = jsonmethodcall("Player.GetActivePlayers");
    //video Player
    if ($results['result']['video'] == 1) {
        $jsonVersion = jsonmethodcall("JSONRPC.Version");
        //pull the JSON version # from XBMC
        //get playlist items
        if ($jsonVersion['result']['version'] == '2') {
            // For the old version
            $results = jsonmethodcall("VideoPlaylist.GetItems");
            //Pull the current "playlist"
            if (!empty($results['result']['items'])) {
                $items = $results['result']['items'][0];
            }
            //If there's anything there, get the current item
            //The older interface doesn't explicitly return a "type"
            if (isset($items['episode'])) {
                if (!empty($items['showtitle'])) {
                    $line1 = $items['showtitle'];
                }
                if (!empty($items['season'])) {
                    $line1 = $line1 . " - S" . sprintf("%02d", $items['season']);
                }
                if (empty($items['season'])) {
                    $line1 = $line1 . " - S00";
                }
                if (!empty($items['episode'])) {
                    $line1 = $line1 . "E" . sprintf("%02d", $items['episode']);
                }
                if (!empty($items['title'])) {
                    $line2 = '"' . $items['title'] . '"';
                }
                if (empty($items['plot'])) {
                    $line3 = "Plot Summary Unavailable";
                    $plot = "Plot Summary Unavailable";
                }
                if (!empty($items['plot'])) {
                    $line3 = $items['plot'];
                    $plot = $items['plot'];
                }
            }
            if (!isset($items['episode'])) {
                if (!empty($items['title'])) {
                    $line1 = $items['title'];
                }
                if (!empty($items['year'])) {
                    $line1 = $line1 . ' (' . $items['year'] . ')';
                }
                if (!empty($items['director'])) {
                    $line1 = $line1 . " | Directed by " . $items['director'];
                }
                if (empty($line1)) {
                    // In this lame case, we can fall back to the file name
                    $line1 = substr($items['file'], strrpos($items['file'], '/'));
                }
                $line2 = '';
                // set this variable so that PHP won't error if it remains unset
                if (!empty($items['tagline'])) {
                    $line2 = $items['tagline'];
                }
                if (empty($items['plot'])) {
                    $line3 = "Plot Summary Unavailable";
                    $plot = "Plot Summary Unavailable";
                }
                if (!empty($items['plot'])) {
                    $line3 = $items['plot'];
                    $plot = $items['plot'];
                }
            }
        }
        if ($jsonVersion['result']['version'] == '3') {
            $results = jsonmethodcall("VideoPlaylistV3.GetItems");
            //Pull the current "playlist"
            if (!empty($results['result']['items'])) {
                $items = $results['result']['items'][0];
            }
            //If there's anything there, get the current item
            if ($items['type'] == 'episode') {
                //its a TV show!
                if (!empty($items['showtitle'])) {
                    $line1 = $items['showtitle'];
                }
                if (!empty($items['season'])) {
                    $line1 = $line1 . " - S" . sprintf("%02d", $items['season']);
                }
                if (!empty($items['episode'])) {
                    $line1 = $line1 . "E" . sprintf("%02d", $items['episode']);
                }
                if (!empty($items['title'])) {
                    $line2 = '"' . $items['title'] . '"';
                }
                if (empty($items['plot'])) {
                    $line3 = "Plot Summary Unavailable";
                    $plot = "Plot Summary Unavailable";
                }
                if (!empty($items['plot'])) {
                    $line3 = $items['plot'];
                    $plot = $items['plot'];
                }
            } else {
                if ($items['type'] == 'movie') {
                    //it's a movie
                    if (!empty($items['title'])) {
                        $line1 = $items['title'];
                    }
                    if (!empty($items['year'])) {
                        $line1 = $line1 . ' (' . $items['year'] . ')';
                    }
                    if (!empty($items['director'])) {
                        $line1 = $line1 . " | Directed by " . $items['director'];
                    }
                    if (!empty($items['tagline'])) {
                        $line2 = $items['tagline'];
                    }
                    if (empty($items['plot'])) {
                        $line3 = "Plot Summary Unavailable";
                        $plot = "Plot Summary Unavailable";
                    }
                    if (!empty($items['plot'])) {
                        $line3 = $items['plot'];
                        $plot = $items['plot'];
                    }
                }
            }
        }
        if (!empty($items['thumbnail'])) {
            $thumb = $items['thumbnail'];
        } else {
            if (!empty($items['fanart'])) {
                $thumb = $items['fanart'];
            }
        }
        if (strlen($thumb) > 0) {
            echo "\t<div id=\"thumbblock\" class=\"thumbblockvideo\">\n";
            if (!empty($baseurl)) {
                echo "\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" alt=\"" . htmlentities($plot, ENT_QUOTES) . "\" />";
            } else {
                echo "\t\t <b>" . $line1 . "</b><a href=\"" . $xbmcimgpath . $thumb . "\" class=\"highslide\" onclick=\"return hs.expand(this)\">\n";
                echo "\t\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" title=\"Click to enlarge\" alt=\"" . htmlentities($plot, ENT_QUOTES) . "\" />";
                echo "\t\t</a>\n";
            }
            echo "\t</div>\n";
        }
        echo "\t\t<p><i>" . $line2 . "</i></p>\n";
        echo "\t\t<p>" . $line3 . "</p>\n";
        //progress time
        $results = jsonmethodcall("VideoPlayer.GetTime");
        $time = $results['result']['time'];
        // Current time (in seconds)
        $total = $results['result']['total'];
        // Total time (in seconds)
        $timeFormatted = '';
        //Instantiate the "timeFormatted" variable so we don't get errors
        //The way time is formatted and returned is different in the old and new JSON interfaces, so we fork here to handle each case.
        if ($jsonVersion['result']['version'] == '2') {
            $timeFormatted = formattimes($time, $total);
            echo "{$timeFormatted}</p>\n";
        }
        if ($jsonVersion['result']['version'] == '3') {
            if ($time['hours'] != 0) {
                $timeFormatted = $time['hours'] . ":";
            }
            //If there's actually any "hours" value, we format and add them to the string
            $timeFormatted = "\t\t<p>" . $timeFormatted . sprintf("%02d", $time['minutes']) . ':' . sprintf("%02d", $time['seconds']) . ' / ';
            if ($total['hours'] != 0) {
                $timeFormatted = $timeFormatted . $total['hours'] . ":";
            }
            $timeFormatted = $timeFormatted . sprintf("%02d", $total['minutes']) . ":" . sprintf("%02d", $total['seconds']);
            echo "{$timeFormatted}</p>\n";
        }
        if (!empty($results['result']['paused']) && $results['result']['paused']) {
            echo "\t\t<p>Paused</p>\n";
        }
        //progress bar
        $results = jsonmethodcall("VideoPlayer.GetPercentage");
        $percentage = $results['result'];
        echo "\t\t<div class='progressbar'><div class='progress' style='width:" . $percentage . "%'></div></div>";
        if (!empty($_GET['style']) && $_GET['style'] == 'm') {
            widgetNowPlayingControls($baseurl);
        }
    } elseif ($results['result']['audio'] == 1) {
        //get playlist items
        $results = jsonmethodcall("AudioPlaylist.GetItems");
        $items = $results['result']['items'];
        $current = $results['result']['current'];
        $thumb = $items[$current]['thumbnail'];
        $artist = $items[$current]['artist'];
        $title = $items[$current]['title'];
        $album = $items[$current]['album'];
        if (strlen($thumb) > 0) {
            echo "\t<div id=\"thumbblock\" class=\"thumbblockaudio\">\n";
            if (!empty($baseurl)) {
                echo "\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" alt=\"" . htmlentities($artist . " - " . $album . " - " . $title, ENT_QUOTES) . "\" />";
            } else {
                echo "\t\t<a href=\"" . $xbmcimgpath . $thumb . "\" class=\"highslide\" onclick=\"return hs.expand(this)\">\n";
                echo "\t\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" title=\"Click to enlarge\" alt=\"" . htmlentities($artist . " - " . $album . " - " . $title, ENT_QUOTES) . "\" />";
                echo "\t\t</a>\n";
            }
            echo "\t</div>\n";
        }
        echo "\t<p>" . $artist . "</p>\n";
        echo "\t<p>" . $title . "</p>\n";
        echo "\t<p>" . $album . "</p>\n";
        //progress time
        $results = jsonmethodcall("AudioPlayer.GetTime");
        $time = $results['result']['time'];
        $total = $results['result']['total'];
        echo "\t<p>" . formattimes($time, $total) . "</p>\n";
        if ($results['result']['paused']) {
            echo "\t<p>Paused</p>\n";
        }
        echo "</div>\n";
        //progress bar
        $results = jsonmethodcall("AudioPlayer.GetPercentage");
        $percentage = $results['result'];
        echo "<div class=\"progressbar\"><div class=\"progress\" style=\"width:" . $percentage . "%\"></div></div>\n";
        if (!empty($_GET['style']) && $_GET['style'] == 'm') {
            widgetNowPlayingControls($baseurl);
        }
    } else {
        echo "\t<p>Nothing Playing</p>\n";
    }
    echo "</div>\n";
}
Ejemplo n.º 5
0
} else {
    $user = SQLSelectOne("SELECT * FROM users WHERE USERNAME='******'SITE_USERNAME']) . "'");
    $session->data['logged_user'] = $user['ID'];
}
if ($this->action == '' && $session->data['logged_user'] && $msg != '') {
    $rec = array();
    $rec['ROOM_ID'] = (int) $room_id;
    $rec['MEMBER_ID'] = $session->data['logged_user'];
    $rec['MESSAGE'] = htmlspecialchars($msg);
    $rec['ADDED'] = date('Y-m-d H:i:s');
    SQLInsert('shouts', $rec);
    include_once DIR_MODULES . 'patterns/patterns.class.php';
    $pt = new patterns();
    $res = $pt->checkAllPatterns($rec['MEMBER_ID']);
    if (!$res) {
        processCommand($msg);
    }
    $getdata = 1;
}
if ($this->owner->name == 'panel') {
    $out['CONTROLPANEL'] = 1;
}
$qry = "1";
if ($room_id) {
    $qry .= " AND ROOM_ID=" . (int) $room_id;
    $session->data['SHOUT_ROOM_ID'] = (int) $room_id;
}
// search filters
// QUERY READY
global $save_qry;
if ($save_qry) {
Ejemplo n.º 6
0
switch($reqType) {
	case 'init':
		initVars();
		checkCookies();
		checkBanned();

		echo newShouts(true);
		break;

	case 'shout':
		$shoutText = $_POST['shout'];
		$shoutName = $_POST['name'];

		// Parse the message
		if(!processCommand($shoutText)) 
			shout($shoutName, $shoutText);

		// Allow execution to flow into refresh
	case 'refresh':
		$newShouts = newShouts();
		if ($newShouts) echo $newShouts;
		break;	
}

// Initialize the session variables to be used for the rest of this chat session
function initVars() {
	$_SESSION['AdminLoggedIn'] = false;
	$_SESSION['MostRecentTimestamp'] = 0;
	$_SESSION['YPath'] = $_POST['yPath'];
}
Ejemplo n.º 7
0
 *
 */
include 'include.php';
?>
<!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" xml:lang="<?php 
echo getLang();
?>
" lang="<?php 
echo getLang();
?>
">

<?php 
//$email = recoveryEmail();
$r = processCommand($_GET['cmd']);
$email = $r['email'];
$cmdresult = $r['result'];
$mails = getUserEmails($email);
?>

<head>
<meta content="text/html; charset=<?php 
echo getCharSet();
?>
" http-equiv="content-type" />
<meta name="ROBOTS" CONTENT="NOINDEX, NOFOLLOW" />
<title>PookMail.com</title>
  
<link rel="shortcut icon" href="favicon.ico" />
<link rel="alternate" type="application/rss+xml" title="<?php 
Ejemplo n.º 8
0
function displayNowPlaying($baseurl = "")
{
    global $xbmcimgpath;
    if (!empty($_GET['style']) && $_GET['style'] == 'm' && !empty($_GET['cmd'])) {
        processCommand($_GET['cmd']);
    }
    echo "<div id=\"nowplaying\">\n";
    //json rpc call procedure
    $results = jsonmethodcall("Player.GetActivePlayers");
    //video Player
    if ($results['result']['video'] == 1) {
        //get playlist items
        $results = jsonmethodcall("VideoPlaylist.GetItems");
        if (!empty($results['result']['items'])) {
            $items = $results['result']['items'];
            $current = !empty($results['result']['current']) ? $results['result']['current'] : 0;
            if (!empty($items[$current]['thumbnail'])) {
                $thumb = $items[$current]['thumbnail'];
            } else {
                $thumb = !empty($items[$current]['fanart']) ? $items[$current]['fanart'] : "";
            }
            if (!empty($items[$current]['title'])) {
                $title = $items[$current]['title'];
            } else {
                $title = !empty($items[$current]['label']) ? $items[$current]['label'] : "";
            }
            if (!empty($items[$current]['showtitle'])) {
                $show = $items[$current]['showtitle'];
            } else {
                $show = $title;
                $title = "";
            }
            $season = !empty($items[$current]['season']) ? $items[$current]['season'] : "";
            $episode = !empty($items[$current]['episode']) ? $items[$current]['episode'] : "";
            if (strlen($season) > 0 && strlen($episode) > 0) {
                $title = $season . "x" . str_pad($episode, 2, '0', STR_PAD_LEFT) . " " . $title;
            }
            if (strlen($show) == 0) {
                $info = pathinfo($items[$current]['file']);
                $show = $info['filename'];
            }
            if (!empty($items[$current]['plot'])) {
                $plot = $items[$current]['plot'];
            } else {
                $plot = "";
            }
            if (strlen($thumb) > 0) {
                echo "\t<div id=\"thumbblock\" class=\"thumbblockvideo\">\n";
                if (!empty($baseurl)) {
                    echo "\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" alt=\"" . htmlentities($plot, ENT_QUOTES) . "\" />";
                } else {
                    echo "\t\t<a href=\"" . $xbmcimgpath . $thumb . "\" class=\"highslide\" onclick=\"return hs.expand(this)\">\n";
                    echo "\t\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" title=\"Click to enlarge\" alt=\"" . htmlentities($plot, ENT_QUOTES) . "\" />";
                    echo "\t\t</a>\n";
                }
                echo "\t</div>\n";
            }
            echo "\t\t<p>" . $show . "</p>\n";
            echo "\t\t<p>" . $title . "</p>\n";
        }
        //progress time
        $results = jsonmethodcall("VideoPlayer.GetTime");
        $time = $results['result']['time'];
        $total = $results['result']['total'];
        echo "\t\t<p>" . formattimes($time, $total) . "</p>\n";
        if (!empty($results['result']['paused']) && $results['result']['paused']) {
            echo "\t\t<p>Paused</p>\n";
        }
        //progress bar
        $results = jsonmethodcall("VideoPlayer.GetPercentage");
        $percentage = $results['result'];
        echo "\t\t<div class='progressbar'><div class='progress' style='width:" . $percentage . "%'></div></div>";
        if (!empty($_GET['style']) && $_GET['style'] == 'm') {
            widgetNowPlayingControls($baseurl);
        }
    } elseif ($results['result']['audio'] == 1) {
        //get playlist items
        $results = jsonmethodcall("AudioPlaylist.GetItems");
        $items = $results['result']['items'];
        $current = $results['result']['current'];
        $thumb = $items[$current]['thumbnail'];
        $artist = $items[$current]['artist'];
        $title = $items[$current]['title'];
        $album = $items[$current]['album'];
        if (strlen($thumb) > 0) {
            echo "\t<div id=\"thumbblock\" class=\"thumbblockaudio\">\n";
            if (!empty($baseurl)) {
                echo "\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" alt=\"" . htmlentities($artist . " - " . $album . " - " . $title, ENT_QUOTES) . "\" />";
            } else {
                echo "\t\t<a href=\"" . $xbmcimgpath . $thumb . "\" class=\"highslide\" onclick=\"return hs.expand(this)\">\n";
                echo "\t\t\t<img src=\"" . $xbmcimgpath . $thumb . "\" title=\"Click to enlarge\" alt=\"" . htmlentities($artist . " - " . $album . " - " . $title, ENT_QUOTES) . "\" />";
                echo "\t\t</a>\n";
            }
            echo "\t</div>\n";
        }
        echo "\t<p>" . $artist . "</p>\n";
        echo "\t<p>" . $title . "</p>\n";
        echo "\t<p>" . $album . "</p>\n";
        //progress time
        $results = jsonmethodcall("AudioPlayer.GetTime");
        $time = $results['result']['time'];
        $total = $results['result']['total'];
        echo "\t<p>" . formattimes($time, $total) . "</p>\n";
        if ($results['result']['paused']) {
            echo "\t<p>Paused</p>\n";
        }
        echo "</div>\n";
        //progress bar
        $results = jsonmethodcall("AudioPlayer.GetPercentage");
        $percentage = $results['result'];
        echo "<div class=\"progressbar\"><div class=\"progress\" style=\"width:" . $percentage . "%\"></div></div>\n";
        if (!empty($_GET['style']) && $_GET['style'] == 'm') {
            widgetNowPlayingControls($baseurl);
        }
    } else {
        echo "\t<p>Nothing Playing</p>\n";
    }
    echo "</div>\n";
}
Ejemplo n.º 9
0
function processGET($GET)
{
    global $debug;
    $debug = True;
    debugEcho("Processing GET");
    header("Content-Type: text/plain");
    if (isset($_GET['msg']) && !empty($_GET['msg'])) {
        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        } else {
            $ip = $_SERVER['REMOTE_ADDR'];
        }
        if ($_GET['msg'] == "sess") {
            header("Content-Type: text/plain");
            debugEcho("Session Save Path: " . ini_get('session.save_path'));
            debugEcho("Session gc_maxlifetime: " . ini_get('session.gc_maxlifetime'));
            debugEcho("Session gc_probability: " . ini_get('session.gc_probability'));
            debugEcho("Session gc_divisor: " . ini_get('session.gc_divisor'));
            print_r(scandir(session_save_path()));
        } else {
            $message = "/" . $_GET['msg'];
            $chat = isset($_GET['chat']) ? $_GET['chat'] : "";
            $user = isset($_GET['user']) ? $_GET['user'] : "";
            processCommand($chat, $user, $message);
        }
        $data = array("GET", date(DATE_FORMAT), $ip, $_GET['msg'], $chat, $user, $_SESSION['count']);
        logData($data);
    } else {
        exit;
    }
}