Skip to content

Commit

Permalink
Fixed broken redirect after login
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11089 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Oct 3, 2011
1 parent ff23a44 commit f5a6854
Show file tree
Hide file tree
Showing 15 changed files with 505 additions and 540 deletions.
7 changes: 3 additions & 4 deletions application/config/database.php
Expand Up @@ -17,7 +17,7 @@
| ['password'] The password used to connect to the database
| ['database'] The name of the database you want to connect to
| ['dbdriver'] The database type. ie: mysql. Currently supported:
| mysql, mysqli, postgre, odbc, mssql, sqlite, oci8
| mysql, mysqli, postgre, odbc, mssql
| ['dbprefix'] You can add an optional prefix, which will be added
| to the table name when using the Active Record class
| ['pconnect'] TRUE/FALSE - Whether to use a persistent connection
Expand Down Expand Up @@ -47,16 +47,15 @@
$db['default']['database'] = '';
$db['default']['dbdriver'] = '';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_unicode_ci';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
$db['default']['port'] = 'default';
$db['default']['databasetabletype'] = 'myISAM';
$config['dbdriver'] = $db['default']['dbdriver'];

Expand Down
38 changes: 17 additions & 21 deletions application/config/lsconfig.php
Expand Up @@ -60,7 +60,7 @@
$config['printanswershonorsconditions'] = 1; // Set to 1 if you want the participant printanswers feature to show only the questions that were displayed survey branching-logic
$config['shownoanswer'] = 1; // Show 'no answer' for non mandatory questions ( 0 = no , 1 = yes , 2 = survey admin can choose )
$config['admintheme'] = 'default'; // This setting specifys the directory where the admin finds it theme/css style files, e.g. setting 'default' points to /admin/styles/default
$config['userideditable'] = 'N';
$config['userideditable'] = 'N';
$config['defaulttemplate'] = 'default'; // This setting specifys the default theme used for the 'public list' of surveys

$config['allowedtemplateuploads'] = 'gif,ico,jpg,png'; // File types allowed to be uploaded in the templates section.
Expand Down Expand Up @@ -479,13 +479,10 @@
$config['iFileUploadTotalSpaceMB']= 0;


//DO NOT EVER CHANGE THE FOLLOWING 5 LINES ---------------
//require_once(dirname(__FILE__).'/config.php');
//if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='' && $_SERVER['HTTPS']!='off')
//{
// $rooturl=str_replace('http://', 'https://', $rooturl);
//}
//-----------------------------------------------------
// defines if the CKeditor toolbar should be opened by default
$config['ckeditexpandtoolbar'] = true;



// === Advanced Setup
// The following parameters need information from config.php
Expand All @@ -502,29 +499,28 @@
//Initialize URL Helper to get base_url();
get_instance()->load->helper('url');

$config['homeurl'] = base_url()."admin"; // The website location (url) of the admin scripts
$config['publicurl'] = base_url(); // The public website location (url) of the public survey script
$config['tempurl'] = base_url()."tmp";
$config['imageurl'] = base_url()."images"; // Location of button bar files for admin script
$config['uploadurl'] = base_url()."upload";
$config['standardtemplaterooturl'] = base_url()."templates"; // Location of the standard templates
$config['usertemplaterooturl'] = $config['uploadurl']."/templates"; // Location of the user templates
$config['publicurl'] = base_url(); // The public website location (url) of the public survey script
$config['homeurl'] = $config['publicurl']."admin"; // The website location (url) of the admin scripts
$config['tempurl'] = $config['publicurl']."tmp";
$config['imageurl'] = $config['publicurl']."images"; // Location of button bar files for admin script
$config['uploadurl'] = $config['publicurl']."upload";
$config['standardtemplaterooturl'] = $config['publicurl']."templates"; // Location of the standard templates
$config['adminscripts'] = $config['publicurl']."scripts/admin/";
$config['generalscripts'] = $config['publicurl']."scripts/";
$config['styleurl'] = $config['publicurl']."styles/";
$config['sCKEditorURL'] = $config['adminscripts']."/ckeditor.36";
$config['usertemplaterooturl'] = $config['uploadurl']."/templates"; // Location of the user templates


$config['homedir'] = $config['rootdir'].DIRECTORY_SEPARATOR."admin"; // The directory path of the admin scripts
$config['publicdir'] = $config['rootdir']; // The directory path of the public scripts
$config['homedir'] = $config['rootdir'].DIRECTORY_SEPARATOR."admin"; // The directory path of the admin scripts
$config['tempdir'] = $config['rootdir'].DIRECTORY_SEPARATOR."tmp"; // The directory path where LimeSurvey can store temporary files
$config['imagedir'] = $config['rootdir'].DIRECTORY_SEPARATOR."images"; // The directory path of the image directory
$config['uploaddir'] = $config['rootdir'].DIRECTORY_SEPARATOR."upload";
$config['standardtemplaterootdir'] = $config['rootdir'].DIRECTORY_SEPARATOR."templates"; // The directory path of the standard templates
$config['usertemplaterootdir'] = $config['uploaddir'].DIRECTORY_SEPARATOR."templates"; // The directory path of the user templates

$config['sCKEditorURL'] = base_url()."/scripts/admin/ckeditor.36";
$config['ckeditexpandtoolbar'] = true; // defines if the CKeditor toolbar should be opened by default

$config['adminscripts'] = base_url()."scripts/admin/";
$config['generalscripts'] = base_url()."scripts/";
$config['styleurl'] = base_url()."styles/";
// Computing relative url
// $relativeurl is the url relative to you DocumentRoot where is installed LimeSurvey.
// Usually same as $rooturl without http://{$_SERVER['HTTP_HOST']}.
Expand Down
19 changes: 3 additions & 16 deletions application/controllers/admin/authentication.php
Expand Up @@ -195,15 +195,6 @@ function forgotpassword()
*/
function _showLoginForm($logoutsummary="")
{

$refererargs=''; // If this is a direct access to admin.php, no args are given
// If we are called from a link with action and other args set, get them
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'])
{
$refererargs = html_escape($_SERVER['QUERY_STRING']);
}

$data['refererargs'] = $refererargs;
$data['clang'] = $this->limesurvey_lang;

if ($logoutsummary=="")
Expand Down Expand Up @@ -325,16 +316,12 @@ function _doLogin($sIp,$bLoginAttempted)

$loginsummary = "<br />".sprintf($clang->gT("Welcome %s!"),$this->session->userdata('full_name'))."<br />&nbsp;";

if ($this->input->post('refererargs') && strpos($this->input->post('refererargs'), "action=logout") === FALSE)
if ($this->session->userdata('redirect_after_login') && strpos($this->session->userdata('redirect_after_login'), "logout") === FALSE)
{
//require_once("../classes/inputfilter/class.inputfilter_clean.php");
$myFilter = new InputFilter('','',1,1,1);
// Prevent XSS attacks
//$sRefererArg=$myFilter->process($_POST['refererargs']);
$sRefererArg = $this->input->post('refererargs',true);
$this->session->set_userdata('metaHeader',"<meta http-equiv=\"refresh\""
. " content=\"1;URL={$scriptname}?".$sRefererArg."\" />");
. " content=\"1;URL=".site_url($this->session->userdata('redirect_after_login'))."\" />");
$loginsummary = "<p><font size='1'><i>".$clang->gT("Reloading screen. Please wait.")."</i></font>\n";
$this->session->unset_userdata('redirect_after_login');
}
self::_GetSessionUserRights($this->session->userdata('loginID'));
// self::_showMessageBox($clang->gT("Logged in"), $loginsummary);
Expand Down
32 changes: 13 additions & 19 deletions application/controllers/admin/export.php
Expand Up @@ -34,23 +34,12 @@ function __construct()
$this->load->helper("database");
}

function survey($sSurveyID)
function survey($action,$sSurveyID)
{
$iSurveyID= (int)$sSurveyID;
if(bHasSurveyPermission($iSurveyID,'surveycontent','export')) {
if($this->input->post("action"))
{
self::_surveyexport($this->input->post("action"), $iSurveyID);
return;
}
$css_admin_includes[] = $this->config->item('styleurl')."admin/default/superfish.css";
$this->config->set_item("css_admin_includes", $css_admin_includes);
self::_getAdminHeader();
self::_showadminmenu($iSurveyID);
self::_surveybar($iSurveyID);
$this->load->view("admin/export/survey_view");
self::_loadEndScripts();
self::_getAdminFooter("http://docs.limesurvey.org", $this->limesurvey_lang->gT("LimeSurvey online manual"));
self::_surveyexport($action, $iSurveyID);
return;
}
}

Expand Down Expand Up @@ -87,11 +76,16 @@ function _surveyexport($action, $surveyid)
echo quexml_export($surveyid, $quexmllang);
exit;
}
elseif($action == "exportstructureLsrcCsv")
{
lsrccsv_export($surveyid);
}
}
}
elseif($action == "exportstructureLsrcCsv")
{
lsrccsv_export($surveyid);
}
elseif($action == "exportarchive")
{
// lsrccsv_export($surveyid);

}
}

function group($surveyid, $gid)
Expand Down
12 changes: 6 additions & 6 deletions application/controllers/admin/index.php
Expand Up @@ -9,25 +9,25 @@ function __construct()

function index()
{

global $loginsummary;
$clang = $this->limesurvey_lang;
self::_getAdminHeader();
self::_getAdminHeader($this->session->userdata('metaHeader'));
self::_showadminmenu();

if ($this->session->userdata('just_logged_in'))
{
self::_showMessageBox($clang->gT("Logged in"), $this->session->userdata('loginsummary'));
$this->session->unset_userdata('just_logged_in');
$this->session->unset_userdata('loginsummary');
}
if (count(getsurveylist(true))==0)
if (count(getsurveylist(true))==0)
{
$data['clang']=$this->limesurvey_lang;
$this->load->view("admin/super/firststeps",$data);
}

self::_getAdminFooter("http://docs.limesurvey.org", $this->limesurvey_lang->gT("LimeSurvey online manual"));
}

}

0 comments on commit f5a6854

Please sign in to comment.