View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
07329Bug reportsAuthenticationpublic2013-03-11 15:03
ReporterpfpDave Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary07329: Login error notice: langcode param not defined
Description

I got an error about language params 'langcode param is undefined' when I logged in, corrected by editing my profile and clicking save.

Here's the langcode error pasted inline:

User warning
langcode param is undefined

C:\limesurvey_train\application\libraries\Limesurvey_lang.php(32)

20 $locale = new limesurvey_lang('en'); // Char code
21 print $locale->getTranslation("Hello World!");
22 */
23
24
25 class Limesurvey_lang {
26
27 var $gettextclass;
28 var $langcode;
29
30 function limesurvey_lang($sLanguageCode){
31 if(empty($sLanguageCode))
32 trigger_error('langcode param is undefined ', E_USER_WARNING);
33
34 Yii::app()->loadHelper('sanitize');
35 $sLanguageCode=sanitize_languagecode($sLanguageCode);
36 $streamer = new FileReader(getcwd().DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$sLanguageCode.DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR.$sLanguageCode.'.mo');
37 $this->gettextclass = new gettext_reader($streamer);
38 $this->langcode = $sLanguageCode;
39 }
40
41 function getlangcode()
42 {
43 return $this->langcode;
44 }
Stack Trace
#0 +
– C:\limesurvey_train\application\libraries\Limesurvey_lang.php(32): trigger_error("langcode param is undefined ", 512)
27 var $gettextclass;
28 var $langcode;
29
30 function limesurvey_lang($sLanguageCode){
31 if(empty($sLanguageCode))
32 trigger_error('langcode param is undefined ', E_USER_WARNING);
33
34 Yii::app()->loadHelper('sanitize');
35 $sLanguageCode=sanitize_languagecode($sLanguageCode);
36 $streamer = new FileReader(getcwd().DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$sLanguageCode.DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR.$sLanguageCode.'.mo');
37 $this->gettextclass = new gettext_reader($streamer);

#1 +
– C:\limesurvey_train\application\controllers\admin\authentication.php(318): Limesurvey_lang->limesurvey_lang("")
313 {
314 $sLanguage=$user->lang;
315 }
316
317 Yii::app()->session['adminlang'] = $sLanguage;
318 $this->getController()->lang= new limesurvey_lang($sLanguage);
319 }
320
321 /*
322
Checks if the user is using default password
323 */

#2 +
– C:\limesurvey_train\application\controllers\admin\authentication.php(275): Authentication->_setLanguageSettings(User)
270 $user = $identity->getUser();
271
272 Yii::app()->user->login($identity);
273 $this->_checkForUsageOfDefaultPassword();
274 $this->_setSessionData($user);
275 $this->_setLanguageSettings($user);
276
277 return true;
278 }
279
280 /**

#3 +

C:\limesurvey_train\application\controllers\admin\authentication.php(260): Authentication->_setLoginSessions(UserIdentity)
255 if (!$identity->authenticate($sOneTimePassword))
256 {
257 return $this->_getAuthenticationFailedErrorMessage();
258 }
259 @session_regenerate_id(); // Prevent session fixation
260 return $this->_setLoginSessions($identity);
261 }
262
263 /*
264
Sets the login sessions
265 * @param UserIdentity $identity

#4 +

C:\limesurvey_train\application\controllers\admin\authentication.php(43): Authentication->_doLogin(null, null, "")
38 if ($bCanLogin && !is_array($bCanLogin))
39 {
40 if (Yii::app()->request->getPost('action') || !is_null(Yii::app()->request->getQuery('onepass')) || Yii::app()->getConfig('auth_webserver') === true)
41 {
42
43 $aData = $this->_doLogin(Yii::app()->request->getParam('user'), Yii::app()->request->getPost('password'),Yii::app()->request->getQuery('onepass',''));
44
45 if (!isset($aData['errormsg']))
46 {
47 Failed_login_attempts::model()->deleteAttempts();
48

#5 unknown(0): Authentication->index()
#6 +

C:\limesurvey_train\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Authentication, array())
102 else if($param->isDefaultValueAvailable())
103 $ps[]=$param->getDefaultValue();
104 else
105 return false;
106 }
107 $method->invokeArgs($object,$ps);
108 return true;
109 }
110 }

#7 +

C:\limesurvey_train\application\core\Survey_Common_Action.php(100): CAction->runWithParamsInternal(Authentication, ReflectionMethod, array("r" => "admin/authentication/sa/login", "sa" => "login"))
095 $oMethod = new ReflectionMethod($this, $sDefault);
096 }
097
098 // We're all good to go, let's execute it
099 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
100 return parent::runWithParamsInternal($this, $oMethod, $params);
101 }
102
103 /*
104
Some functions have different parameters, which are just an alias of the
105 * usual parameters we're getting in the url. This function just populates

#8 +

C:\limesurvey_train\framework\web\CController.php(309): Survey_Common_Action->runWithParams(array("r" => "admin/authentication/sa/login", "sa" => "login"))
304 {
305 $priorAction=$this->_action;
306 $this->_action=$action;
307 if($this->beforeAction($action))
308 {
309 if($action->runWithParams($this->getActionParams())===false)
310 $this->invalidActionParams($action);
311 else
312 $this->afterAction($action);
313 }
314 $this->_action=$priorAction;

#9 +

C:\limesurvey_train\framework\web\CController.php(287): CController->runAction(Authentication)
282 @see runAction
283
/
284 public function runActionWithFilters($action,$filters)
285 {
286 if(empty($filters))
287 $this->runAction($action);
288 else
289 {
290 $priorAction=$this->_action;
291 $this->_action=$action;
292 CFilterChain::create($this,$action,$filters)->run();

#10 +

C:\limesurvey_train\framework\web\CController.php(266): CController->runActionWithFilters(Authentication, array())
261 {
262 if(($parent=$this->getModule())===null)
263 $parent=Yii::app();
264 if($parent->beforeControllerAction($this,$action))
265 {
266 $this->runActionWithFilters($action,$this->filters());
267 $parent->afterControllerAction($this,$action);
268 }
269 }
270 else
271 $this->missingAction($actionID);

#11 +

C:\limesurvey_train\application\controllers\AdminController.php(169): CController->run("authentication")
164 $this->redirect($this->createUrl('/admin/authentication/sa/login'));
165 }
166
167 }
168
169 return parent::run($action);
170 }
171
172 /*
173
Routes all the actions to their respective places
174 *

#12 +

C:\limesurvey_train\framework\web\CWebApplication.php(276): AdminController->run("authentication")
271 {
272 list($controller,$actionID)=$ca;
273 $oldController=$this->_controller;
274 $this->_controller=$controller;
275 $controller->init();
276 $controller->run($actionID);
277 $this->_controller=$oldController;
278 }
279 else
280 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".',
281 array('{route}'=>$route===''?$this->defaultController:$route)));

#13 +

C:\limesurvey_train\framework\web\CWebApplication.php(135): CWebApplication->runController("admin/authentication/sa/login")
130 foreach(array_splice($this->catchAllRequest,1) as $name=>$value)
131 $_GET[$name]=$value;
132 }
133 else
134 $route=$this->getUrlManager()->parseUrl($this->getRequest());
135 $this->runController($route);
136 }
137
138 /*
139
Registers the core application components.
140 * This method overrides the parent implementation by registering additional core components.

#14 +

C:\limesurvey_train\framework\base\CApplication.php(162): CWebApplication->processRequest()
157 */
158 public function run()
159 {
160 if($this->hasEventHandler('onBeginRequest'))
161 $this->onBeginRequest(new CEvent($this));
162 $this->processRequest();
163 if($this->hasEventHandler('onEndRequest'))
164 $this->onEndRequest(new CEvent($this));
165 }
166
167 /**

#15 +

C:\limesurvey_train\index.php(178): CApplication->run()

Additional Information
Just to add ... the langcode fix is for that session only it seems ... a fresh session and login re-triggers the landcode error
TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)121127
I will donate to the project if issue is resolvedNo
BrowserIE8
Database type & versionSQL Express 2012
Server OS (if known)Server 2008
Webserver software & version (if known)IIS 7
PHP Version5.4.8

Relationships

related to 07097 closedmdekker View response details only appears once survey fully completed even when token persistence set 

Users monitoring this issue

There are no users monitoring this issue.

Activities

pfpDave

pfpDave

2013-02-25 11:38

reporter   ~24279

Just to add ... the langcode fix is for that session only it seems ... a fresh session and login re-triggers the landcode error

c_schmitz

c_schmitz

2013-03-01 16:03

administrator   ~24455

Last edited: 2013-03-04 08:30

pfpDave, I cannot reproduce it here.
Can you quote the authentication settings have you set in config.php?

Adrax

Adrax

2013-03-04 08:28

reporter   ~24506

Error happens to me too when authmode is set to "webserver".

c_schmitz

c_schmitz

2013-03-08 12:55

administrator   ~24585

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11805

c_schmitz

c_schmitz

2013-03-08 15:37

administrator   ~24599

Fix committed to 2.05 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11809

c_schmitz

c_schmitz

2013-03-11 15:03

administrator   ~24622

2.00+ build 130311 released

Related Changesets

LimeSurvey: master dbad6291

2013-03-08 11:55:09

c_schmitz

Details Diff
Fixed issue 07329: Login error notice: langcode param not defined if authentication by webserver is activated Affected Issues
07329
mod - application/controllers/admin/authentication.php Diff File
mod - application/models/Tokens_dynamic.php Diff File
mod - application/models/User.php Diff File

LimeSurvey: 2.05 17a7fef3

2013-03-08 11:55:09

c_schmitz

Details Diff
Fixed issue 07329: Login error notice: langcode param not defined if authentication by webserver is activated Affected Issues
07329
mod - application/controllers/admin/authentication.php Diff File
mod - application/models/Tokens_dynamic.php Diff File
mod - application/models/User.php Diff File

Issue History

Date Modified Username Field Change
2013-02-25 11:38 c_schmitz New Issue
2013-02-25 11:38 c_schmitz Status new => assigned
2013-02-25 11:38 c_schmitz Assigned To => c_schmitz
2013-02-25 11:38 c_schmitz Issue generated from: 07097
2013-02-25 11:38 c_schmitz Relationship added related to 07097
2013-02-25 11:40 c_schmitz Description Updated
2013-02-25 11:40 c_schmitz Additional Information Updated
2013-02-25 11:41 c_schmitz File Deleted: Response changes.jpg
2013-02-25 11:41 c_schmitz File Deleted: spacing1.jpg
2013-02-25 11:41 c_schmitz File Deleted: spacing2.jpg
2013-02-25 11:41 c_schmitz Reporter c_schmitz => pfpDave
2013-03-01 16:03 c_schmitz Note Added: 24455
2013-03-01 16:03 c_schmitz Status assigned => feedback
2013-03-04 08:28 Adrax Note Added: 24506
2013-03-04 08:30 c_schmitz Note Edited: 24455
2013-03-08 12:54 c_schmitz Status feedback => resolved
2013-03-08 12:54 c_schmitz Fixed in Version => 2.00+
2013-03-08 12:54 c_schmitz Resolution open => fixed
2013-03-08 12:55 c_schmitz Changeset attached => LimeSurvey master dbad6291
2013-03-08 12:55 c_schmitz Note Added: 24585
2013-03-08 15:37 c_schmitz Changeset attached => LimeSurvey 2.05 17a7fef3
2013-03-08 15:37 c_schmitz Note Added: 24599
2013-03-11 15:03 c_schmitz Note Added: 24622
2013-03-11 15:03 c_schmitz Status resolved => closed