From d709751a3f5cf3fdf5b4036ef1486b14df6a646d Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Thu, 10 Jan 2008 09:14:18 +0000 Subject: fixed registration, show edit song title issue and added limit to xml api --- docs/CHANGELOG | 5 +++++ lib/class/xmldata.class.php | 13 ++++++++++++- register.php | 11 ++--------- server/xml.server.php | 27 ++++++++++++++++++++++++++- templates/show_edit_song_row.inc.php | 2 +- 5 files changed, 46 insertions(+), 12 deletions(-) diff --git a/docs/CHANGELOG b/docs/CHANGELOG index f971dccf..893e7cc7 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,11 @@ -------------------------------------------------------------------------- v.3.4-Beta2 + - Added limit option to the XML API + - Fixed an issue where inline song editing wouldn't update the song + title (Thx profner) + - Fixed conf error on registration confirmation and made it + aware of greylisting - Fixed Admin Preference Level updates - Fixed incorrect command for skip to on HttpQ (Thx usaf_pride) - Fixed problem with gif and png resize diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index 6d5baa26..491d4074 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -28,7 +28,7 @@ class xmlData { // This is added so that we don't pop any webservers - public static $limit = '5000'; + private static $limit = '5000'; private static $offset = '0'; /** @@ -52,6 +52,17 @@ class xmlData { } // set_offset + /** + * set_limit + * This sets the limit for any ampache transactions + */ + public static function set_limit($limit) { + + $limit = intval($limit); + self::$limit = $limit; + + } // set_limit + /** * error * This generates a standard XML Error message diff --git a/register.php b/register.php index c0a31127..f0b3fc4b 100644 --- a/register.php +++ b/register.php @@ -110,7 +110,7 @@ switch ($_REQUEST['action']) { $attempt++; } - if ($validate_results[0]) { + if ($validate_results[0] OR strstr($validate_results[1],"greylist")) { $mmsg = "MAILOK"; } else { @@ -164,15 +164,8 @@ switch ($_REQUEST['action']) { $validation = md5(uniqid(rand(), true)); $client->update_validation($validation); - $message = 'Your account has been created. However, this application requires account activation.' . - ' An activation key has been sent to the e-mail address you provided. ' . - 'Please check your e-mail for further information'; - Registration::send_confirmation($username, $fullname, $email, $pass1, $validation); - ?> - - get_artists(); + + xmlData::set_offset($_REQUEST['offset']); + xmlData::set_limit($_REQUEST['limit']); + ob_end_clean(); echo xmlData::artists($artists); break; case 'genre_albums': $genre = new Genre($_REQUEST['filter']); $albums = $genre->get_albums(); + + xmlData::set_offset($_REQUEST['offset']); + xmlData::set_limit($_REQUEST['limit']); + ob_end_clean(); echo xmlData::albums($albums); break; case 'genre_songs': $genre = new Genre($_REQUEST['filter']); $songs = $genre->get_songs(); + + xmlData::set_offset($_REQUEST['offset']); + xmlData::set_limit($_REQUEST['limit']); + ob_end_clean(); echo xmlData::songs($songs); break; @@ -179,6 +199,8 @@ switch ($_REQUEST['action']) { // Set the offset xmlData::set_offset($_REQUEST['offset']); + xmlData::set_limit($_REQUEST['limit']); + ob_end_clean(); echo xmlData::songs($songs); break; @@ -194,6 +216,8 @@ switch ($_REQUEST['action']) { $playlist_ids = Browse::get_objects(); xmlData::set_offset($_REQUEST['offset']); + xmlData::set_limit($_REQUEST['limit']); + ob_end_clean(); echo xmlData::playlists($playlist_ids); break; @@ -208,6 +232,7 @@ switch ($_REQUEST['action']) { } // end foreach xmlData::set_offset($_REQUEST['offset']); + xmlData::set_limit($_REQUEST['limit']); ob_end_clean(); echo xmlData::songs($songs); break; diff --git a/templates/show_edit_song_row.inc.php b/templates/show_edit_song_row.inc.php index cbab7739..28f95b7a 100644 --- a/templates/show_edit_song_row.inc.php +++ b/templates/show_edit_song_row.inc.php @@ -23,7 +23,7 @@
- + artist,true,$song->id); ?> -- cgit