Permalink
Browse files

New feature 05492: Changing global settings takes you away from surve…

…y design

Now it "remembers" the referee url and redirect to that url after saving global settings!
  • Loading branch information...
1 parent ec7529c commit 4d94e5186b41717f030f674451c3dd65478a12ae @magiclko magiclko committed Mar 11, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −0 admin/admin.php
  2. +7 −1 admin/globalsettings.php
View
@@ -45,6 +45,7 @@
if (!isset($subaction)) {$subaction=returnglobal('subaction');} //Desired subaction
if (!isset($editedaction)) {$editedaction=returnglobal('editedaction');} // for html editor integration
+$refurl = $_SERVER['HTTP_REFERER']; //store referer. Can be used for other screens and not just GlobalSettings
LimeExpressionManager::SetSurveyId($surveyid); // must be called early - it clears internal cache if a new survey is being used
if ($action != 'showprintablesurvey' && substr($action,0,4)!= 'ajax')
View
@@ -105,6 +105,8 @@ function globalsettingssave()
setGlobalSetting('usercontrolSameGroupPolicy',strip_tags($_POST['usercontrolSameGroupPolicy']));
$_SESSION['flashmessage'] = $clang->gT("Global settings were saved.");
+ $url = htmlspecialchars_decode($_SESSION['refurl']);
+ header("Location: $url");
}
}
@@ -114,7 +116,8 @@ function globalsettingsdisplay()
{
global $action, $connect, $js_admin_includes, $editsurvey, $subaction, $scriptname, $clang;
global $updateversion, $updatebuild, $updateavailable, $updatelastcheck, $demoModeOnly;
-
+ global $refurl;
+
if (isset($subaction) && $subaction == "updatecheck")
{
$updateinfo=updatecheck();
@@ -124,6 +127,9 @@ function globalsettingsdisplay()
{
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1)
{
+ //save refurl from where global settings screen is called!
+ $_SESSION['refurl'] = htmlspecialchars($refurl); //just to be safe!
+
$js_admin_includes[]='scripts/globalsettings.js';
// header
$editsurvey = "<div class='header ui-widget-header'>".$clang->gT("Global settings")."</div>\n";

0 comments on commit 4d94e51

Please sign in to comment.