diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-11-19 17:02:37 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-11-19 17:02:37 +0000 |
commit | 0bd925f488affe2f2a82a8be5e1e461d2f1ebae3 (patch) | |
tree | e6701669a2f6a80fc6e4530e28382a18819afe32 /server/xml.server.php | |
parent | 0d0f8c23f44af61211c40087cfeda80dbf254e71 (diff) | |
download | ampache-0bd925f488affe2f2a82a8be5e1e461d2f1ebae3.tar.gz ampache-0bd925f488affe2f2a82a8be5e1e461d2f1ebae3.tar.bz2 ampache-0bd925f488affe2f2a82a8be5e1e461d2f1ebae3.zip |
add the ratings to the album and artist xml results, fixed a logic error on the api session extending
Diffstat (limited to 'server/xml.server.php')
-rw-r--r-- | server/xml.server.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/server/xml.server.php b/server/xml.server.php index a98c76ac..b29f7b74 100644 --- a/server/xml.server.php +++ b/server/xml.server.php @@ -49,7 +49,7 @@ if (!Config::get('access_control')) { * Verify the existance of the Session they passed in we do allow them to * login via this interface so we do have an exception for action=login */ -if ((!vauth::session_exists('api', $_REQUEST['auth']) AND $_REQUEST['action'] != 'handshake')) { +if (!vauth::session_exists('api', $_REQUEST['auth']) AND $_REQUEST['action'] != 'handshake' AND $_REQUEST['action'] != 'ping') { debug_event('Access Denied','Invalid Session attempt to API [' . $_REQUEST['action'] . ']','3'); ob_end_clean(); echo xmlData::error('401','Session Expired'); @@ -58,7 +58,7 @@ if ((!vauth::session_exists('api', $_REQUEST['auth']) AND $_REQUEST['action'] != // If the session exists then let's try to pull some data from it to see if we're still allowed to do this $session = vauth::get_session_data($_REQUEST['auth']); -$username = ($_REQUEST['action'] == 'handshake') ? $_REQUEST['user'] : $session['username']; +$username = ($_REQUEST['action'] == 'handshake' || $_REQUEST['action'] == 'ping') ? $_REQUEST['user'] : $session['username']; if (!Access::check_network('init-api',$username,'5')) { @@ -69,7 +69,7 @@ if (!Access::check_network('init-api',$username,'5')) { } -if (!$_REQUEST['action'] != 'handshake') { +if ($_REQUEST['action'] != 'handshake' AND $_REQUEST['action'] != 'ping') { vauth::session_extend($_REQUEST['auth']); $GLOBALS['user'] = User::get_from_username($session['username']); } @@ -90,6 +90,17 @@ switch ($_REQUEST['action']) { } break; + case 'ping': + + // Check and see if we should extend the api sessions (done if valid sess is passed) + if (vauth::session_exists('api', $_REQUEST['auth'])) { + vauth::session_extend($_REQUEST['auth']); + } + + + + + break; case 'artists': Browse::reset_filters(); Browse::set_type('artist'); |