summaryrefslogtreecommitdiff
path: root/modules/pref-prefs.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-10-01 11:19:39 +0100
committerAndrew Dolgov <[email protected]>2006-10-01 11:19:39 +0100
commitf27d955a58bffbb9f24c82fcca427e0ac7d37312 (patch)
tree6bc1b1db35c9377d8f7ef1453c91dec4585e9281 /modules/pref-prefs.php
parentc4d6b6b7ff73c0d3a1cc7636f646edcd65912336 (diff)
module fixes
Diffstat (limited to 'modules/pref-prefs.php')
-rw-r--r--modules/pref-prefs.php40
1 files changed, 14 insertions, 26 deletions
diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php
index 8573b4c1c..78bee5fa2 100644
--- a/modules/pref-prefs.php
+++ b/modules/pref-prefs.php
@@ -1,14 +1,17 @@
<?php
+ function prefs_js_redirect() {
+ print "<html><body>
+ <script type=\"text/javascript\">
+ window.location = 'prefs.php';
+ </script>
+ </body></html>";
+ }
+
function module_pref_prefs($link) {
$subop = $_REQUEST["subop"];
if ($subop == "Save configuration") {
- if (WEB_DEMO_MODE) {
- header("Location: prefs.php");
- return;
- }
-
$_SESSION["prefs_op_result"] = "save-config";
$_SESSION["prefs_cache"] = false;
@@ -45,10 +48,10 @@
}
- header("Location: prefs.php");
-
}
+ return prefs_js_redirect();
+
} else if ($subop == "getHelp") {
$pref_name = db_escape_string($_GET["pn"]);
@@ -65,11 +68,6 @@
} else if ($subop == "Change e-mail") {
- if (WEB_DEMO_MODE) {
- header("Location: prefs.php");
- return;
- }
-
$email = db_escape_string($_GET["email"]);
$active_uid = $_SESSION["uid"];
@@ -78,15 +76,10 @@
WHERE id = '$active_uid'");
}
- header("Location: prefs.php");
+ return prefs_js_redirect();
} else if ($subop == "Change password") {
- if (WEB_DEMO_MODE) {
- header("Location: prefs.php");
- return;
- }
-
$old_pw = $_POST["OLD_PASSWORD"];
$new_pw = $_POST["OLD_PASSWORD"];
@@ -113,15 +106,10 @@
}
}
- header("Location: prefs.php");
+ return prefs_js_redirect();
} else if ($subop == "Reset to defaults") {
- if (WEB_DEMO_MODE) {
- header("Location: prefs.php");
- return;
- }
-
$_SESSION["prefs_op_result"] = "reset-to-defaults";
if (DB_TYPE == "pgsql") {
@@ -135,7 +123,7 @@
initialize_user_prefs($link, $_SESSION["uid"]);
}
- header("Location: prefs.php");
+ return prefs_js_redirect();
} else if ($subop == "Change theme") {
@@ -163,7 +151,7 @@
$_SESSION["theme"] = $theme_path;
- header("Location: prefs.php");
+ return prefs_js_redirect();
} else {