1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-06 03:49:56 +02:00

Remove myPlex server emulation

This commit is contained in:
Afterster 2014-02-20 20:14:36 +01:00
parent 44b03f69e9
commit 887a170bdd
2 changed files with 1 additions and 42 deletions

View file

@ -49,7 +49,7 @@ if ($cargv > 1) {
} }
} }
$app = new Ratchet\App('localhost', $port); $app = new Ratchet\App('0.0.0.0', $port);
$brserver = new Broadcast_Server(); $brserver = new Broadcast_Server();
$brserver->verbose = $verbose; $brserver->verbose = $verbose;
$app->route('/broadcast', $brserver); $app->route('/broadcast', $brserver);

View file

@ -887,45 +887,4 @@ class Plex_Api
} }
} }
} }
/**
Functions to emulate myPlex server and grant access to plexpass dynamically.
Use it for testing purpose only, be fair!
*/
public static function users($params)
{
if ($params[0] == 'sign_in.xml') {
$curlopts = array();
$headers = array();
$res = self::myPlexRequest('users/sign_in.xml', $curlopts, $headers, true);
foreach ($res['headers'] as $header) {
header($header);
}
if ($res['status'] == '201') {
Plex_XML_Data::injectMyPlexSubscription($res['xml']);
self::apiOutput($res['xml']->asXML());
} else { self::createError($res['status']); }
}
}
protected static function get_users_account($authtoken='')
{
if (empty($authtoken)) {
$authtoken = Plex_XML_Data::getMyPlexAuthToken();
}
$action = 'users/account?auth_token=' . $authtoken;
$res = self::myPlexRequest($action);
return $res['xml'];
}
public static function users_account($params)
{
$xml = self::get_users_account();
Plex_XML_Data::injectMyPlexSubscription($xml);
self::apiOutput($xml->asXML());
}
} }