diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/update.class.php | 2 | ||||
-rw-r--r-- | lib/general.lib.php | 75 | ||||
-rw-r--r-- | lib/javascript-base.js | 5 |
3 files changed, 19 insertions, 63 deletions
diff --git a/lib/class/update.class.php b/lib/class/update.class.php index c34cd012..130ed2c6 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -247,7 +247,7 @@ class Update { $version[] = array('version' => '340012','description'=>$update_string); - $update_string = '- Removed Unused Preferneces.<br />' . + $update_string = '- Removed Unused Preferences.<br />' . '- Changed Localplay Config to Localplay Access.<br />' . '- Changed all XML-RPC acls to RPC to reflect inclusion of new API.<br />'; diff --git a/lib/general.lib.php b/lib/general.lib.php index 60a461d0..417ca483 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -43,66 +43,6 @@ function int2ip($i) { return "$d[0].$d[1].$d[2].$d[3]"; } // int2ip -/* - * Conf function by Robert Hopson - * call it with a $parm name to retrieve - * a var, pass it a array to set them - * to reset a var pass the array plus - * Clobber! replaces global $conf; -*/ -/*function conf($param,$clobber=0) -{ - static $params = array(); - - if(is_array($param)) - //meaning we are setting values - { - foreach ($param as $key=>$val) - { - if(!$clobber && isset($params[$key])) - { - echo "Error: attempting to clobber $key = $val\n"; - exit(); - } - $params[$key] = $val; - } - return true; - } - else - //meaning we are trying to retrieve a parameter - { - if($params[$param]) return $params[$param]; - else return; - } -} //conf - -function error_results($param,$clobber=0) -{ - static $params = array(); - - if(is_array($param)) - //meaning we are setting values - { - foreach ($param as $key=>$val) - { - if(!$clobber && isset($params[$key])) - { - echo "Error: attempting to clobber $key = $val\n"; - exit(); - } - $params[$key] = $val; - } - return true; - } - else - //meaning we are trying to retrieve a parameter - { - if($params[$param]) return $params[$param]; - else return; - } -} //error_results -*/ - /** * session_exists * checks to make sure they've specified a valid session, can handle xmlrpc @@ -524,8 +464,19 @@ function logout() { // Do a quick check to see if this is an AJAX'd logout request // if so use the iframe to redirect if (AJAX_INCLUDE == '1') { - $_SESSION['iframe']['target'] = Config::get('web_path') . '/login.php'; - $results['rfc3514'] = '<script type="text/javascript">reload_util("'.$_SESSION['iframe']['target'].'")</script>'; + ob_end_clean(); + ob_start(); + + /* Set the correct headers */ + header("Content-type: text/xml; charset=" . Config::get('site_charset')); + header("Content-Disposition: attachment; filename=ajax.xml"); + header("Expires: Tuesday, 27 Mar 1984 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Pragma: no-cache"); + + $target = Config::get('web_path') . '/login.php'; + $results['rfc3514'] = '<script type="text/javascript">reload_logout("'.$target.'")</script>'; echo xml_from_array($results); } diff --git a/lib/javascript-base.js b/lib/javascript-base.js index 8d4bb1e1..9742f54d 100644 --- a/lib/javascript-base.js +++ b/lib/javascript-base.js @@ -92,6 +92,11 @@ function reload_util(target) { document.getElementById('util_iframe').src = document.getElementById('util_iframe').src; } +// Log them out +function reload_logout(target) { + window.location = target; +} + function popup_art(url) { var newwindow; newwindow=window.open(url, "ampache_art", "menubar=no,toolbar=no,location=no,directories=no"); |