/** * logout * * This is called when you want to log out and nuke your session. * This is the function used for the Ajax logouts, if no id is passed * it tries to find one from the session, */ public static function logout($key = '', $relogin = true) { // If no key is passed try to find the session id $key = $key ? $key : session_id(); // Nuke the cookie before all else Session::destroy($key); if (!$relogin && AmpConfig::get('logout_redirect')) { $target = AmpConfig::get('logout_redirect'); } else { $target = AmpConfig::get('web_path') . '/login.php'; } // Do a quick check to see if this is an AJAXed logout request // if so use the iframe to redirect if (defined('AJAX_INCLUDE')) { ob_end_clean(); ob_start(); xoutput_headers(); $results = array(); $results['rfc3514'] = '<script type="text/javascript">reloadRedirect("' . $target . '")</script>'; echo xoutput_from_array($results); } else { /* Redirect them to the login page */ header('Location: ' . $target); } exit; }
if (isset($_POST['album_artist_name'])) { unset($_POST['album_artist_name']); } if (isset($_POST['edit_tags'])) { $_POST['edit_tags'] = Tag::clean_to_existing($_POST['edit_tags']); } if (isset($_POST['edit_labels'])) { $_POST['edit_labels'] = Label::clean_to_existing($_POST['edit_labels']); } // Check mbid and *_mbid match as it is used as identifier if (isset($_POST['mbid'])) { $_POST['mbid'] = $libitem->mbid; } if (isset($_POST['mbid_group'])) { $_POST['mbid_group'] = $libitem->mbid_group; } } $libitem->format(); $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;