summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/update.class.php2
-rw-r--r--lib/general.lib.php75
-rw-r--r--lib/javascript-base.js5
-rw-r--r--util.php1
5 files changed, 21 insertions, 64 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index b8b0ec77..6f00a658 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.4-Alpha4
+ - Fixed a bug where ajax actions wouldn't trigger a redirect to login
+ when session expired, instead they would just break
- Fixed a bug with Random Play if you had no artists/albums/playlists
- Fixed Admin's ability to modify other users preferences
- Added User and Manager levels to Localplay, determines what the
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");
diff --git a/util.php b/util.php
index e3760c42..1fc36aeb 100644
--- a/util.php
+++ b/util.php
@@ -18,7 +18,6 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
require_once 'lib/init.php';
// This is a little bit of a special file, it takes the