format(); $level = '50'; if ($libitem->get_user_owner() == $GLOBALS['user']->id) { $level = '25'; } // Make sure they got them rights if (!Access::check('interface', $level) || AmpConfig::get('demo_mode')) { echo xoutput_from_array(array('rfc3514' => '0x1')); exit; } switch ($_REQUEST['action']) { case 'show_edit_object': ob_start(); require AmpConfig::get('prefix') . '/templates/show_edit_' . $type . '.inc.php'; $results = ob_get_contents(); break; case 'refresh_updated': require AmpConfig::get('prefix') . '/templates/show_' . $type . '.inc.php'; $results = ob_get_contents(); break; case 'show_edit_playlist': ob_start(); require AmpConfig::get('prefix') . '/templates/show_playlists_dialog.inc.php'; $results = ob_get_contents(); ob_end_clean(); break; case 'edit_object': // Scrub the data foreach ($_POST as $key => $data) { $_POST[$key] = unhtmlentities(scrub_in($data)); } // this break generic layer, we should move it somewhere else if ($type == 'song_row') { $song = new Song($_POST['id']); if ($song->user_upload == $GLOBALS['user']->id && AmpConfig::get('upload_allow_edit') && !Access::check('interface','75')) { if (isset($_POST['artist'])) unset($_POST['artist']); if (isset($_POST['album'])) unset($_POST['album']); $levelok = true; } } $new_id = $libitem->update($_POST); $libitem = new $object_type($new_id); $libitem->format(); xoutput_headers(); $results['id'] = $new_id; echo xoutput_from_array($results); exit; default: exit; } // end switch action ob_end_clean(); echo $results;