Skip to content

Commit

Permalink
Fixed several minor issues
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@11027 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
c-schmitz committed Sep 21, 2011
1 parent a152606 commit f85b7e9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 1,238 deletions.
11 changes: 0 additions & 11 deletions application/config/lsconfig.php
Expand Up @@ -74,17 +74,6 @@

$config['maxemails'] = 50; // The maximum number of emails to send in one go (this is to prevent your mail server or script from timeouting when sending mass mail)


// Session options

// $sessionlifetime sets how long until a survey session expires in seconds
//$sessionlifetime = 3600;
// $sessionhandler can be either 'file' or 'db'. (default: 'file').
// Generally you don't want to change that unless you are using LimeSurvey on load-balanced servers
//$sessionhandler = 'file';



// Support for Fancy URLs
//
// This new feature makes survey URLs more readable
Expand Down
44 changes: 22 additions & 22 deletions application/controllers/admin/globalsettings.php
Expand Up @@ -29,14 +29,14 @@ function __construct()
{
parent::__construct();
}

function index()
{
if($this->session->userdata('USER_RIGHT_CONFIGURATOR') == 1)
{
if($this->input->post("action"))
{
self::_savesettings();
self::_savesettings();
}
self::_display();
}
Expand All @@ -45,37 +45,37 @@ function index()
//include("access_denied.php");
}
}

function showphpinfo()
{
if($this->session->userdata('USER_RIGHT_CONFIGURATOR') == 1)
{
phpinfo();
}
}

function _display()
{

$clang = $this->limesurvey_lang;

self::_js_admin_includes(base_url()."scripts/admin/globalsettings.js");

$data['title']="hi";
$data['message']="message";
$data['checksettings'] = self::_checksettings();
$data['thisupdatecheckperiod']=getGlobalSetting('updatecheckperiod');
$data['updatelastcheck'] = $this->config->item("updatelastcheck");
$data['updateavailable'] = $this->config->item("updateavailable");
$data['updateinfo'] = $this->config->item("updateinfo");

self::_getAdminHeader();
self::_showadminmenu();
$this->load->view('admin/globalsettings', $data);
self::_getAdminFooter("http://docs.limesurvey.org", $this->limesurvey_lang->gT("LimeSurvey online manual"));

}

function _savesettings()
{
$clang = $this->limesurvey_lang;
Expand Down Expand Up @@ -105,7 +105,7 @@ function _savesettings()
setGlobalSetting('bounceaccounttype',strip_tags(returnglobal('bounceaccounttype')));
setGlobalSetting('bounceencryption',strip_tags(returnglobal('bounceencryption')));
setGlobalSetting('bounceaccountuser',strip_tags(returnglobal('bounceaccountuser')));

if (returnglobal('bounceaccountpass')!='enteredpassword')
{
setGlobalSetting('bounceaccountpass',strip_tags(returnglobal('bounceaccountpass')));
Expand All @@ -124,11 +124,11 @@ function _savesettings()
$repeatheadingstemp=(int)($this->input->post('repeatheadings'));
if ($repeatheadingstemp==0) $repeatheadingstemp=25;
setGlobalSetting('repeatheadings',$repeatheadingstemp);

setGlobalSetting('maxemails',sanitize_int($maxemails));
$sessionlifetimetemp=(int)($this->input->post('sessionlifetime'));
if ($sessionlifetimetemp==0) $sessionlifetimetemp=3600;
setGlobalSetting('sessionlifetime',$sessionlifetimetemp);
$iSessionExpirationTime=(int)($this->input->post('sess_expiration'));
if ($iSessionExpirationTime==0) $iSessionExpirationTime=3600;
setGlobalSetting('sess_expiration',$iSessionExpirationTime);
setGlobalSetting('ipInfoDbAPIKey',$this->input->post('ipInfoDbAPIKey'));
setGlobalSetting('googleMapsAPIKey',$this->input->post('googleMapsAPIKey'));
setGlobalSetting('force_ssl',$this->input->post('force_ssl'));
Expand All @@ -138,7 +138,7 @@ function _savesettings()
setGlobalSetting('timeadjust',$savetime);
setGlobalSetting('usepdfexport',strip_tags($this->input->post('usepdfexport')));
setGlobalSetting('usercontrolSameGroupPolicy',strip_tags($this->input->post('usercontrolSameGroupPolicy')));

$this->session->set_userdata('flashmessage',$clang->gT("Global settings were saved."));
}
}
Expand All @@ -151,10 +151,10 @@ function _checksettings()
//GET NUMBER OF SURVEYS
$this->load->model(("surveys_model"));
$this->load->model(("users_model"));

$databasename = $this->db->database;
//var_dump($databasename);
//var_dump($databasename);

//$query = "SELECT count(sid) FROM ".db_table_name('surveys');
$query = $this->surveys_model->getSomeRecords(array("count(sid)"));
//$surveycount=$connect->GetOne($query); //Checked
Expand All @@ -173,10 +173,10 @@ function _checksettings()
$usercount=$query->row_array();
$usercount=$usercount['count(users_name)'];
//var_dump($usercount);

if ($activesurveycount==false) $activesurveycount=0;
if ($surveycount==false) $surveycount=0;

$tablelist = $this->db->list_tables();
foreach ($tablelist as $table)
{
Expand All @@ -193,7 +193,7 @@ function _checksettings()
$oldresultslist[]=$table;
}
}

if(isset($oldresultslist) && is_array($oldresultslist))
{$deactivatedsurveys=count($oldresultslist);} else {$deactivatedsurveys=0;}
if(isset($oldtokenlist) && is_array($oldtokenlist))
Expand All @@ -212,7 +212,7 @@ function _checksettings()
. "<tr>\n"
. "<th align='right'>".$clang->gT("Surveys").":</th><td>$surveycount</td>\n"
. "</tr>\n"
. "<tr>\n"
. "<tr>\n"
. "<th align='right'>".$clang->gT("Active surveys").":</th><td>$activesurveycount</td>\n"
. "</tr>\n"
. "<tr>\n"
Expand All @@ -238,4 +238,4 @@ function _checksettings()
}
return $cssummary;
}
}
}
2 changes: 1 addition & 1 deletion application/controllers/admin/question.php
Expand Up @@ -197,7 +197,7 @@ function editdefaultvalues($surveyid,$gid,$qid)
." <ul>";
foreach ($questlangs as $language)
{
$editdefvalues .= "<li> <a href='#df_{$language}'>".getLanguageNameFromCode($language,false).'</li>';
$editdefvalues .= "<li> <a href='#df_{$language}'>".getLanguageNameFromCode($language,false).'</a></li>';
}
$editdefvalues .='</ul>';

Expand Down
14 changes: 5 additions & 9 deletions application/controllers/survey.php
Expand Up @@ -33,7 +33,6 @@ function action()
global $thissurvey, $thisstep;
global $clienttoken;


//Replace $_GET:
$arg_list = func_get_args();
if($arg_list[0]==__CLASS__) array_shift($arg_list);
Expand All @@ -44,7 +43,7 @@ function action()
}
}

@ini_set('session.gc_maxlifetime', $sessionlifetime);
@ini_set('session.gc_maxlifetime', $this->config->item('sess_expiration'));

//Load helpers, libraries and config vars
$this->load->helper("database");
Expand Down Expand Up @@ -98,19 +97,16 @@ function action()
// Session name is based:
// * on this specific limesurvey installation (Value SessionName in DB)
// * on the surveyid (from Get or Post param). If no surveyid is given we are on the public surveys portal
$usquery = "SELECT stg_value FROM ".$this->db->dbprefix("settings_global")." where stg_name='SessionName'";
$usresult = db_execute_assoc($usquery,'',true); //Checked
if ($usresult)
$sSessionname=getGlobalSetting('SessionName');
if ($sSessionname!='')
{
$usrow = $usresult->row_array();
$stg_SessionName=$usrow['stg_value'];
if ($surveyid)
{
@session_name($stg_SessionName.'-runtime-'.$surveyid);
@session_name($sSessionname.'-runtime-'.$surveyid);
}
else
{
@session_name($stg_SessionName.'-runtime-publicportal');
@session_name($sSessionname.'-runtime-publicportal');
}
}
else
Expand Down
5 changes: 0 additions & 5 deletions application/core/Admin_Controller.php
Expand Up @@ -64,12 +64,7 @@ function _init()
updatecheck();
}


//require_once('htmleditor-functions.php');
//@ini_set('session.gc_maxlifetime', $sessionlifetime); Might cause problems in client??

// Reset FileManagerContext
//$_SESSION['FileManagerContext']='';
$this->session->unset_userdata("FileManagerContext");

if (!$this->config->item("surveyid")) {$this->config->set_item("surveyid", returnglobal('sid'));} //SurveyID
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/globalsettings.php
Expand Up @@ -129,8 +129,8 @@
<?php if ( $thisaddTitleToLinks == false) { echo "selected='selected'";} ?>
><?php echo $clang->gT("Off");?></option>
</select></li>
<li><label for='sessionlifetime'><?php echo $clang->gT("Session lifetime (seconds):");?></label>
<input type='text' size='10' id='sessionlifetime' name='sessionlifetime' value="<?php echo htmlspecialchars(getGlobalSetting('sessionlifetime'));?>" /></li>
<li><label for='sess_expiration'><?php echo $clang->gT("Session lifetime (seconds):");?></label>
<input type='text' size='10' id='sess_expiration' name='sess_expiration' value="<?php echo htmlspecialchars(getGlobalSetting('sess_expiration'));?>" /></li>
<li><label for='ipInfoDbAPIKey'><?php echo $clang->gT("IP Info DB API Key:");?></label>
<input type='text' size='35' id='ipInfoDbAPIKey' name='ipInfoDbAPIKey' value="<?php echo htmlspecialchars(getGlobalSetting('ipInfoDbAPIKey'));?>" /></li>
<li><label for='googleMapsAPIKey'><?php echo $clang->gT("Google Maps API key:");?></label>
Expand Down

0 comments on commit f85b7e9

Please sign in to comment.