Navigation Menu

Skip to content

Commit

Permalink
New feature 05492: Changing global settings takes you away from surve…
Browse files Browse the repository at this point in the history
…y design

Now it "remembers" the referee url and redirect to that url after saving global settings!
  • Loading branch information
sachdeva-shubham committed Mar 11, 2012
1 parent ec7529c commit 4d94e51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions admin/admin.php
Expand Up @@ -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')
Expand Down
8 changes: 7 additions & 1 deletion admin/globalsettings.php
Expand Up @@ -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");

}
}
Expand All @@ -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();
Expand All @@ -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";
Expand Down

0 comments on commit 4d94e51

Please sign in to comment.