From f8a1a3ccf414bf1c07ecc59f23063bdf7ce8c3d6 Mon Sep 17 00:00:00 2001 From: Gautam Gupta Date: Mon, 26 Dec 2011 12:34:47 +0000 Subject: [PATCH] Dev: Make langcode optional in optin and optout. git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11769 b72ed6b6-b9f8-46b5-92b4-906544132732 --- application/controllers/OptinController.php | 6 +++--- application/controllers/OptoutController.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/controllers/OptinController.php b/application/controllers/OptinController.php index be8c8e6ccca..c3804565757 100644 --- a/application/controllers/OptinController.php +++ b/application/controllers/OptinController.php @@ -24,7 +24,7 @@ */ class OptinController extends LSYii_Controller { - function actionLocal($langcode, $surveyid, $token) + function actionLocal($surveyid, $token, $langcode = '') { Yii::app()->loadHelper('database'); Yii::app()->loadHelper('sanitize'); @@ -34,7 +34,7 @@ function actionLocal($langcode, $surveyid, $token) $sToken = sanitize_token($sToken); if (!$iSurveyID) - { + { $this->redirect($this->getController()->createUrl('/')); } $iSurveyID = (int)$iSurveyID; @@ -58,7 +58,7 @@ function actionLocal($langcode, $surveyid, $token) Yii::app()->lang = $clang; $thissurvey=getSurveyInfo($iSurveyID,$baselang); - + if ($thissurvey == false || Yii::app()->db->schema->getTable("{{tokens_{$iSurveyID}}}") == null) { $html = $clang->gT('This survey does not seem to exist.'); diff --git a/application/controllers/OptoutController.php b/application/controllers/OptoutController.php index 68f0054b019..dc13a10090a 100644 --- a/application/controllers/OptoutController.php +++ b/application/controllers/OptoutController.php @@ -23,7 +23,7 @@ */ class OptoutController extends LSYii_Controller { - function actionLocal($langcode, $surveyid, $token) + function actionLocal($surveyid, $token, $langcode = '') { Yii::app()->loadHelper('database'); Yii::app()->loadHelper('sanitize'); @@ -33,7 +33,7 @@ function actionLocal($langcode, $surveyid, $token) $sToken = sanitize_token($sToken); if (!$iSurveyID) - { + { $this->redirect($this->getController()->createUrl('/')); } $iSurveyID = (int)$iSurveyID; @@ -80,7 +80,7 @@ function actionLocal($langcode, $surveyid, $token) { $html = $clang->gT('You have been already removed from this survey.'); } - } + } } //PRINT COMPLETED PAGE