Changeset 1357
- Timestamp:
- 12/17/07 17:35:40 (13 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
docs/CHANGELOG (modified) (1 diff)
-
lib/class/access.class.php (modified) (2 diffs)
-
lib/init.php (modified) (1 diff)
-
server/xml.server.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/CHANGELOG
r1355 r1357 5 5 -------------------------------------------------------------------------- 6 6 v.3.4-Alpha4 7 - Fixed it so that all errors should return an XML document when 8 using the XML API. 7 9 - Added Basic ShoutBox functionality, needs formating fixes 8 10 and needs to be moved to a better spot in classic theme it -
trunk/lib/class/access.class.php
r1337 r1357 180 180 * however we don't have the key that was passed yet so we've got to do just ip 181 181 */ 182 case 'init-rpc': 182 183 case 'init-xml-rpc': 183 184 $sql = "SELECT `id` FROM `access_list`" . … … 190 191 " AND `key` = '$key' AND `level` >= '$level' AND `type`='rpc'"; 191 192 break; 193 case 'init-api': 192 194 case 'network': 193 195 case 'interface': -
trunk/lib/init.php
r1351 r1357 82 82 83 83 /** This is the version.... fluf nothing more... **/ 84 $results['version'] = '3.4-Alpha4 Build (00 4)';84 $results['version'] = '3.4-Alpha4 Build (005)'; 85 85 $results['int_config_version'] = '6'; 86 86 -
trunk/server/xml.server.php
r1320 r1357 28 28 require_once '../lib/init.php'; 29 29 30 // If we don't even have access control on then we can't use this!31 if (!Config::get('access_control')) { access_denied(); exit; }32 30 33 /**34 * Verify the existance of the Session they passed in we do allow them to35 * login via this interface so we do have an exception for action=login36 */37 if (!Access::session_exists(array(),$_REQUEST['auth'],'api') AND $_REQUEST['action'] != 'handshake') {38 debug_event('Access Denied','Invalid Session or unthorized access attempt to API','5');39 exit();40 }41 31 42 32 // If it's not a handshake then we can allow it to take up lots of time … … 49 39 header("Content-Disposition: attachment; filename=information.xml"); 50 40 41 // If we don't even have access control on then we can't use this! 42 if (!Config::get('access_control')) { 43 ob_end_clean(); 44 echo xmlData::error('Access Control not Enabled'); 45 exit; 46 } 47 48 /** 49 * Verify the existance of the Session they passed in we do allow them to 50 * login via this interface so we do have an exception for action=login 51 */ 52 if ((!Access::session_exists(array(),$_REQUEST['auth'],'api') AND $_REQUEST['action'] != 'handshake') || !Access::check_network('init-api',$_SERVER['REMOTE_ADDR'],$_REQUEST['user'])) { 53 debug_event('Access Denied','Invalid Session or unathorized access attempt to API','5'); 54 ob_end_clean(); 55 echo xmlData::error('Access Denied due to ACL or unauthorized access attempt to API, attempt logged'); 56 exit(); 57 } 58 59 51 60 switch ($_REQUEST['action']) { 52 61 case 'handshake': … … 55 64 56 65 if (!$token) { 66 ob_end_clean(); 57 67 echo xmlData::error('Error Invalid Handshake, attempt logged'); 58 68 } 59 69 else { 70 ob_end_clean(); 60 71 echo xmlData::keyed_array($token); 61 72 } … … 76 87 $artists = Browse::get_objects(); 77 88 // echo out the resulting xml document 89 ob_end_clean(); 78 90 echo xmlData::artists($artists); 79 91 break; … … 85 97 // Set the offset 86 98 xmlData::set_offset($_REQUEST['offset']); 87 99 ob_end_clean(); 88 100 echo xmlData::albums($albums); 89 101 break; … … 94 106 // Set the offset 95 107 xmlData::set_offset($_REQUEST['offset']); 96 xmlData::songs($songs); 108 ob_end_clean(); 109 echo xmlData::songs($songs); 97 110 break; 98 111 case 'albums': … … 108 121 // Set the offset 109 122 xmlData::set_offset($_REQUEST['offset']); 110 123 ob_end_clean(); 111 124 echo xmlData::albums($albums); 112 125 break; … … 117 130 // Set the offset 118 131 xmlData::set_offset($_REQUEST['offset']); 119 132 ob_end_clean(); 120 133 echo xmlData::songs($songs); 121 134 break; … … 132 145 // Set the offset 133 146 xmlData::set_offset($_REQUEST['offset']); 134 147 ob_end_clean(); 135 148 echo xmlData::genres($genres); 136 149 break; … … 138 151 $genre = new Genre($_REQUEST['filter']); 139 152 $artists = $genre->get_artists(); 140 153 ob_end_clean(); 141 154 echo xmlData::artists($artists); 142 155 break; … … 144 157 $genre = new Genre($_REQUEST['filter']); 145 158 $albums = $genre->get_albums(); 146 159 ob_end_clean(); 147 160 echo xmlData::albums($albums); 148 161 break; … … 150 163 $genre = new Genre($_REQUEST['filter']); 151 164 $songs = $genre->get_songs(); 152 165 ob_end_clean(); 153 166 echo xmlData::songs($songs); 154 167 break; … … 165 178 // Set the offset 166 179 xmlData::set_offset($_REQUEST['offset']); 167 180 ob_end_clean(); 168 181 echo xmlData::songs($songs); 169 182 break; 170 183 default: 171 // Rien a faire 184 ob_end_clean(); 185 echo xmlData::error('Invalid Request'); 172 186 break; 173 187 } // end switch action
