• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getGlobalSetting函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getGlobalSetting函数的典型用法代码示例。如果您正苦于以下问题:PHP getGlobalSetting函数的具体用法?PHP getGlobalSetting怎么用?PHP getGlobalSetting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getGlobalSetting函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: bounceprocessing

 /**
  * tokens::bounceprocessing()
  *
  * @return void
  */
 function bounceprocessing($iSurveyId)
 {
     $iSurveyId = sanitize_int($iSurveyId);
     $clang = $this->getController()->lang;
     $bTokenExists = tableExists('{{tokens_' . $iSurveyId . '}}');
     if (!$bTokenExists) {
         $clang->eT("No token table.");
         return;
     }
     $thissurvey = getSurveyInfo($iSurveyId);
     if (!Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update')) {
         $clang->eT("We are sorry but you don't have permissions to do this.");
         return;
     }
     if ($thissurvey['bounceprocessing'] != 'N' || $thissurvey['bounceprocessing'] == 'G' && getGlobalSetting('bounceaccounttype') != 'off') {
         if (!function_exists('imap_open')) {
             $clang->eT("The imap PHP library is not installed. Please contact your system administrator.");
             return;
         }
         $bouncetotal = 0;
         $checktotal = 0;
         if ($thissurvey['bounceprocessing'] == 'G') {
             $accounttype = strtoupper(getGlobalSetting('bounceaccounttype'));
             $hostname = getGlobalSetting('bounceaccounthost');
             $username = getGlobalSetting('bounceaccountuser');
             $pass = getGlobalSetting('bounceaccountpass');
             $hostencryption = strtoupper(getGlobalSetting('bounceencryption'));
         } else {
             $accounttype = strtoupper($thissurvey['bounceaccounttype']);
             $hostname = $thissurvey['bounceaccounthost'];
             $username = $thissurvey['bounceaccountuser'];
             $pass = $thissurvey['bounceaccountpass'];
             $hostencryption = strtoupper($thissurvey['bounceaccountencryption']);
         }
         @(list($hostname, $port) = split(':', $hostname));
         if (empty($port)) {
             if ($accounttype == "IMAP") {
                 switch ($hostencryption) {
                     case "OFF":
                         $hostname = $hostname . ":143";
                         break;
                     case "SSL":
                         $hostname = $hostname . ":993";
                         break;
                     case "TLS":
                         $hostname = $hostname . ":993";
                         break;
                 }
             } else {
                 switch ($hostencryption) {
                     case "OFF":
                         $hostname = $hostname . ":110";
                         break;
                     case "SSL":
                         $hostname = $hostname . ":995";
                         break;
                     case "TLS":
                         $hostname = $hostname . ":995";
                         break;
                 }
             }
         } else {
             $hostname = $hostname . ":" . $port;
         }
         $flags = "";
         switch ($accounttype) {
             case "IMAP":
                 $flags .= "/imap";
                 break;
             case "POP":
                 $flags .= "/pop3";
                 break;
         }
         switch ($hostencryption) {
             case "OFF":
                 $flags .= "/notls";
                 // Really Off
                 break;
             case "SSL":
                 $flags .= "/ssl/novalidate-cert";
                 break;
             case "TLS":
                 $flags .= "/tls/novalidate-cert";
                 break;
         }
         if ($mbox = @imap_open('{' . $hostname . $flags . '}INBOX', $username, $pass)) {
             imap_errors();
             $count = imap_num_msg($mbox);
             if ($count > 0) {
                 $lasthinfo = imap_headerinfo($mbox, $count);
                 $datelcu = strtotime($lasthinfo->date);
                 $datelastbounce = $datelcu;
                 $lastbounce = $thissurvey['bouncetime'];
                 while ($datelcu > $lastbounce) {
                     @($header = explode("\r\n", imap_body($mbox, $count, FT_PEEK)));
//.........这里部分代码省略.........
开发者ID:josetorerobueno,项目名称:test_repo,代码行数:101,代码来源:tokens.php


示例2: _displaySettings

 private function _displaySettings()
 {
     Yii::app()->loadHelper('surveytranslator');
     //save refurl from where global settings screen is called!
     $refurl = Yii::app()->getRequest()->getUrlReferrer();
     Yii::app()->session['refurl'] = htmlspecialchars($refurl);
     //just to be safe!
     $data['clang'] = $this->getController()->lang;
     $data['title'] = "hi";
     $data['message'] = "message";
     foreach ($this->_checkSettings() as $key => $row) {
         $data[$key] = $row;
     }
     $data['thisupdatecheckperiod'] = getGlobalSetting('updatecheckperiod');
     $data['updatelastcheck'] = Yii::app()->getConfig("updatelastcheck");
     $data['updateavailable'] = Yii::app()->getConfig("updateavailable") && Yii::app()->getConfig("updatable");
     $data['updatable'] = Yii::app()->getConfig("updatable");
     $data['updateinfo'] = Yii::app()->getConfig("updateinfo");
     $data['updatebuild'] = Yii::app()->getConfig("updatebuild");
     $data['updateversion'] = Yii::app()->getConfig("updateversion");
     $data['allLanguages'] = getLanguageData(false, Yii::app()->session['adminlang']);
     if (trim(Yii::app()->getConfig('restrictToLanguages')) == '') {
         $data['restrictToLanguages'] = array_keys($data['allLanguages']);
         $data['excludedLanguages'] = array();
     } else {
         $data['restrictToLanguages'] = explode(' ', trim(Yii::app()->getConfig('restrictToLanguages')));
         $data['excludedLanguages'] = array_diff(array_keys($data['allLanguages']), $data['restrictToLanguages']);
     }
     $this->_renderWrappedTemplate('', 'globalSettings_view', $data);
 }
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:30,代码来源:globalsettings.php


示例3: run

 public function run()
 {
     App()->loadHelper('surveytranslator');
     $aData['issuperadmin'] = false;
     if (Permission::model()->hasGlobalPermission('superadmin', 'read')) {
         $aData['issuperadmin'] = true;
     }
     // We get the last survey visited by user
     $setting_entry = 'last_survey_' . Yii::app()->user->getId();
     $lastsurvey = getGlobalSetting($setting_entry);
     $survey = Survey::model()->findByPk($lastsurvey);
     if ($lastsurvey != null && $survey) {
         $aData['showLastSurvey'] = true;
         $iSurveyID = $lastsurvey;
         $surveyinfo = $survey->surveyinfo;
         $aData['surveyTitle'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
         $aData['surveyUrl'] = $this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}");
     } else {
         $aData['showLastSurvey'] = false;
     }
     // We get the last question visited by user
     $setting_entry = 'last_question_' . Yii::app()->user->getId();
     $lastquestion = getGlobalSetting($setting_entry);
     // the question group of this question
     $setting_entry = 'last_question_gid_' . Yii::app()->user->getId();
     $lastquestiongroup = getGlobalSetting($setting_entry);
     // the sid of this question : last_question_sid_1
     $setting_entry = 'last_question_sid_' . Yii::app()->user->getId();
     $lastquestionsid = getGlobalSetting($setting_entry);
     $survey = Survey::model()->findByPk($lastquestionsid);
     if ($lastquestion && $lastquestiongroup && $survey) {
         $baselang = $survey->language;
         $aData['showLastQuestion'] = true;
         $qid = $lastquestion;
         $gid = $lastquestiongroup;
         $sid = $lastquestionsid;
         $qrrow = Question::model()->findByAttributes(array('qid' => $qid, 'gid' => $gid, 'sid' => $sid, 'language' => $baselang));
         if ($qrrow) {
             $aData['last_question_name'] = $qrrow['title'];
             if ($qrrow['question']) {
                 $aData['last_question_name'] .= ' : ' . $qrrow['question'];
             }
             $aData['last_question_link'] = $this->getController()->createUrl("admin/questions/sa/view/surveyid/{$sid}/gid/{$gid}/qid/{$qid}");
         } else {
             $aData['showLastQuestion'] = false;
         }
     } else {
         $aData['showLastQuestion'] = false;
     }
     $aData['countSurveyList'] = count(getSurveyList(true));
     // We get the home page display setting
     $aData['bShowSurveyList'] = getGlobalSetting('show_survey_list') == "show";
     $aData['bShowSurveyListSearch'] = getGlobalSetting('show_survey_list_search') == "show";
     $aData['bShowLogo'] = getGlobalSetting('show_logo') == "show";
     $aData['oSurveySearch'] = new Survey('search');
     $aData['bShowLastSurveyAndQuestion'] = getGlobalSetting('show_last_survey_and_question') == "show";
     $aData['iBoxesByRow'] = (int) getGlobalSetting('boxes_by_row');
     $aData['sBoxesOffSet'] = (string) getGlobalSetting('boxes_offset');
     $this->_renderWrappedTemplate('super', 'welcome', $aData);
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:60,代码来源:index.php


示例4: setNoAnswerMode

/**
* setNoAnswerMode
*/
function setNoAnswerMode($thissurvey)
{
    if (getGlobalSetting('shownoanswer') > 0 && $thissurvey['shownoanswer'] != 'N') {
        define('SHOW_NO_ANSWER', 1);
    } else {
        define('SHOW_NO_ANSWER', 0);
    }
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:11,代码来源:qanda_helper.php


示例5: setAdminTheme

 /**
  * Set the Admin Theme :
  * - checks if the required template exists
  * - set the admin theme variables
  * - set the admin theme constants
  * - Register all the needed CSS/JS files
  */
 public function setAdminTheme()
 {
     $sAdminThemeName = getGlobalSetting('admintheme');
     // We retrieve the admin theme in config ( {{settings_global}} or config-defaults.php )
     $sStandardTemplateRootDir = Yii::app()->getConfig("styledir");
     // Path for the standard Admin Themes
     $sUserTemplateDir = Yii::app()->getConfig('uploaddir') . DIRECTORY_SEPARATOR . 'admintheme';
     // Path for the user Admin Themes
     // Check if the required theme is a standard one
     if ($this->isStandardAdminTheme($sAdminThemeName)) {
         $sTemplateDir = $sStandardTemplateRootDir;
         // It's standard, so it will be in standard path
         $sTemplateUrl = Yii::app()->getConfig('styleurl') . $sAdminThemeName;
         // Available via a standard URL
     } else {
         // If it's not a standard theme, we bet it's a user one.
         // In fact, it could also be a old 2.06 admin theme just aftet an update (it will then be caught as "non existent" in the next if statement")
         $sTemplateDir = $sUserTemplateDir;
         $sTemplateUrl = Yii::app()->getConfig('uploadurl') . DIRECTORY_SEPARATOR . 'admintheme' . DIRECTORY_SEPARATOR . $sAdminThemeName;
     }
     // If the theme directory doesn't exist, it can be that:
     // - user updated from 2.06 and still have old theme configurated in database
     // - user deleted a custom theme
     // In any case, we just set Sea Green as the template to use
     if (!is_dir($sTemplateDir . DIRECTORY_SEPARATOR . $sAdminThemeName)) {
         $sAdminThemeName = 'Sea_Green';
         $sTemplateDir = $sStandardTemplateRootDir;
         $sTemplateUrl = Yii::app()->getConfig('styleurl') . DIRECTORY_SEPARATOR . $sAdminThemeName;
         setGlobalSetting('admintheme', 'Sea_Green');
     }
     // Now that we are sure we have an existing template, we can set the variables of the AdminTheme
     $this->sTemplateUrl = $sTemplateUrl;
     $this->name = $sAdminThemeName;
     $this->path = $sTemplateDir . DIRECTORY_SEPARATOR . $this->name;
     // This is necessary because a lot of files still use "adminstyleurl".
     // TODO: replace everywhere the call to Yii::app()->getConfig('adminstyleurl) by $oAdminTheme->sTemplateUrl;
     Yii::app()->setConfig('adminstyleurl', $this->sTemplateUrl);
     //////////////////////
     // Config file loading
     $bOldEntityLoaderState = libxml_disable_entity_loader(true);
     // @see: http://phpsecurity.readthedocs.io/en/latest/Injection-Attacks.html#xml-external-entity-injection
     $sXMLConfigFile = file_get_contents(realpath($this->path . '/config.xml'));
     // Now that entity loader is disabled, we can't use simplexml_load_file; so we must read the file with file_get_contents and convert it as a string
     // Simple Xml is buggy on PHP < 5.4. The [ array -> json_encode -> json_decode ] workaround seems to be the most used one.
     // @see: http://php.net/manual/de/book.simplexml.php#105330 (top comment on PHP doc for simplexml)
     $this->config = json_decode(json_encode((array) simplexml_load_string($sXMLConfigFile), 1));
     // If developers want to test asset manager with debug mode on
     self::$use_asset_manager = isset($this->config->engine->use_asset_manager_in_debug_mode) ? $this->config->engine->use_asset_manager_in_debug_mode == 'true' : 'false';
     $this->defineConstants();
     // Define the (still) necessary constants
     $this->registerStylesAndScripts();
     // Register all CSS and JS
     libxml_disable_entity_loader($bOldEntityLoaderState);
     // Put back entity loader to its original state, to avoid contagion to other applications on the server
     return $this;
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:63,代码来源:AdminTheme.php


示例6: getUpdateInfo

 /**
  * First call to the server : This function requests the latest update informations from the update server necessary to build the update buttons.
  * If any error occured (server not answering, no curl, servor returns error, etc.), the view check_updates/update_buttons/_updatesavailable_error will be rendered by the controller.
  *
  * @param boolean $crosscheck if it checks for info for both stable and unstable branches
  * @return array Contains update information or error object
  */
 public function getUpdateInfo($crosscheck = "1")
 {
     if ($this->build != '') {
         $crosscheck = (int) $crosscheck;
         $getters = '/index.php?r=updates/updateinfo&currentbuild=' . $this->build . '&id=' . md5(getGlobalSetting('SessionName')) . '&crosscheck=' . $crosscheck;
         $content = $this->_performRequest($getters);
     } else {
         $content = new stdClass();
         $content->result = FALSE;
         $content->error = "no_build";
     }
     return $content;
 }
开发者ID:kasutori,项目名称:LimeSurvey,代码行数:20,代码来源:UpdateForm.php


示例7: run

 public function run()
 {
     App()->loadHelper('surveytranslator');
     App()->getClientScript()->registerPackage('panel-clickable');
     App()->getClientScript()->registerPackage('panels-animation');
     $aData['issuperadmin'] = false;
     if (Permission::model()->hasGlobalPermission('superadmin', 'read')) {
         $aData['issuperadmin'] = true;
     }
     // We get the last survey visited by user
     $setting_entry = 'last_survey_' . Yii::app()->user->getId();
     $lastsurvey = getGlobalSetting($setting_entry);
     if ($lastsurvey != null) {
         $aData['showLastSurvey'] = true;
         $iSurveyID = $lastsurvey;
         $surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
         $aData['surveyTitle'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $iSurveyID . ")";
         $aData['surveyUrl'] = $this->getController()->createUrl("admin/survey/sa/view/surveyid/{$iSurveyID}");
     } else {
         $aData['showLastSurvey'] = false;
     }
     // We get the last question visited by user
     $setting_entry = 'last_question_' . Yii::app()->user->getId();
     $lastquestion = getGlobalSetting($setting_entry);
     // the question group of this question
     $setting_entry = 'last_question_gid_' . Yii::app()->user->getId();
     $lastquestiongroup = getGlobalSetting($setting_entry);
     // the sid of this question : last_question_sid_1
     $setting_entry = 'last_question_sid_' . Yii::app()->user->getId();
     $lastquestionsid = getGlobalSetting($setting_entry);
     if ($lastquestion != null && $lastquestiongroup != null) {
         $baselang = Survey::model()->findByPk($iSurveyID)->language;
         $aData['showLastQuestion'] = true;
         $qid = $lastquestion;
         $gid = $lastquestiongroup;
         $sid = $lastquestionsid;
         $qrrow = Question::model()->findByAttributes(array('qid' => $qid, 'gid' => $gid, 'sid' => $sid, 'language' => $baselang));
         $aData['last_question_name'] = $qrrow['title'];
         if ($qrrow['question']) {
             $aData['last_question_name'] .= ' : ' . $qrrow['question'];
         }
         $aData['last_question_link'] = $this->getController()->createUrl("admin/questions/sa/view/surveyid/{$iSurveyID}/gid/{$gid}/qid/{$qid}");
     } else {
         $aData['showLastQuestion'] = false;
     }
     $aData['countSurveyList'] = count(getSurveyList(true));
     $this->_renderWrappedTemplate('super', 'welcome', $aData);
 }
开发者ID:jgianpiere,项目名称:lime-survey,代码行数:48,代码来源:index.php


示例8: sidebody

 /**
  * Helper function to let a plugin put content
  * into the side-body easily.
  * 
  * @param int $surveyId
  * @param string $plugin Name of the plugin class
  * @param string $method Name of the plugin method
  * @return void
  */
 public function sidebody($surveyId, $plugin, $method)
 {
     $aData = array();
     $surveyId = sanitize_int($surveyId);
     $surveyinfo = getSurveyInfo($surveyId);
     $aData['surveyid'] = $surveyId;
     $aData['surveybar']['buttons']['view'] = true;
     $aData['title_bar']['title'] = $surveyinfo['surveyls_title'] . "(" . gT("ID") . ":" . $surveyId . ")";
     $content = $this->getContent($surveyId, $plugin, $method);
     $aData['sidemenu'] = array();
     $aData['sidemenu']['state'] = false;
     $aData['sideMenuBehaviour'] = getGlobalSetting('sideMenuBehaviour');
     $aData['content'] = $content;
     $aData['activated'] = $surveyinfo['active'];
     $this->_renderWrappedTemplate(null, array('super/sidebody'), $aData);
 }
开发者ID:sickpig,项目名称:LimeSurvey,代码行数:25,代码来源:PluginHelper.php


示例9: setAdminTheme

 /**
  * Set the Admin Theme :
  * - checks if the required template exists
  * - set the admin theme variables
  * - set the admin theme constants
  * - Register all the needed CSS/JS files
  */
 public function setAdminTheme()
 {
     $sAdminThemeName = getGlobalSetting('admintheme');
     // We retrieve the admin theme in config ( {{settings_global}} or config-defaults.php )
     $sStandardTemplateRootDir = Yii::app()->getConfig("styledir");
     // Path for the standard Admin Themes
     $sUserTemplateDir = Yii::app()->getConfig('uploaddir') . DIRECTORY_SEPARATOR . 'admintheme';
     // Path for the user Admin Themes
     // Check if the required theme is a standard one
     if ($this->isStandardAdminTheme($sAdminThemeName)) {
         $sTemplateDir = $sStandardTemplateRootDir;
         // It's standard, so it will be in standard path
         $sTemplateUrl = Yii::app()->getConfig('styleurl') . $sAdminThemeName;
         // Available via a standard URL
     } else {
         // If it's not a standard theme, we bet it's a user one.
         // In fact, it could also be a old 2.06 admin theme just aftet an update (it will then be caught as "non existent" in the next if statement")
         $sTemplateDir = $sUserTemplateDir;
         $sTemplateUrl = Yii::app()->getConfig('uploadurl') . DIRECTORY_SEPARATOR . 'admintheme' . DIRECTORY_SEPARATOR . $sAdminThemeName;
     }
     // If the theme directory doesn't exist, it can be that:
     // - user updated from 2.06 and still have old theme configurated in database
     // - user deleted a custom theme
     // In any case, we just set Sea Green as the template to use
     if (!is_dir($sTemplateDir . DIRECTORY_SEPARATOR . $sAdminThemeName)) {
         $sAdminThemeName = 'Sea_Green';
         $sTemplateDir = $sStandardTemplateRootDir;
         $sTemplateUrl = Yii::app()->getConfig('styleurl') . DIRECTORY_SEPARATOR . $sAdminThemeName;
         setGlobalSetting('admintheme', 'Sea_Green');
     }
     // Now that we are sure we have an existing template, we can set the variables of the AdminTheme
     $this->sTemplateUrl = $sTemplateUrl;
     $this->name = $sAdminThemeName;
     $this->path = $sTemplateDir . DIRECTORY_SEPARATOR . $this->name;
     // This is necessary because a lot of files still use "adminstyleurl".
     // TODO: replace everywhere the call to Yii::app()->getConfig('adminstyleurl) by $oAdminTheme->sTemplateUrl;
     Yii::app()->setConfig('adminstyleurl', $this->sTemplateUrl);
     // We load the admin theme's configuration file.
     $this->config = simplexml_load_file($this->path . '/config.xml');
     // If developers want to test asset manager with debug mode on
     $this->use_asset_manager = $this->config->engine->use_asset_manager_in_debug_mode == 'true';
     $this->defineConstants();
     // Define the (still) necessary constants
     $this->registerStylesAndScripts();
     // Register all CSS and JS
     return $this;
 }
开发者ID:sickpig,项目名称:LimeSurvey,代码行数:54,代码来源:AdminTheme.php


示例10: _displaySettings

 private function _displaySettings()
 {
     Yii::app()->loadHelper('surveytranslator');
     // Save refurl from where global settings screen is called!
     // Unless it's called from global settings...
     $refurl = Yii::app()->getRequest()->getUrlReferrer();
     // Some URLs are not to be allowed to refered back to.
     // These exceptions can be added to the $aReplacements array
     $aReplacements = array('admin/update/sa/step4b' => 'admin/sa/index', 'admin/user/sa/adduser' => 'admin/user/sa/index', 'admin/user/sa/setusertemplates' => 'admin/user/sa/index');
     $refurl = str_replace(array_keys($aReplacements), array_values($aReplacements), $refurl);
     // Don't update session variable if refurl is empty (happens when user clicks Save)
     if ($refurl !== "") {
         Yii::app()->session['refurl'] = htmlspecialchars($refurl);
         //just to be safe!
     }
     $data['title'] = "hi";
     $data['message'] = "message";
     foreach ($this->_checkSettings() as $key => $row) {
         $data[$key] = $row;
     }
     Yii::app()->loadLibrary('Date_Time_Converter');
     $dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
     $datetimeobj = new date_time_converter(dateShift(getGlobalSetting("updatelastcheck"), 'Y-m-d H:i:s', getGlobalSetting('timeadjust')), 'Y-m-d H:i:s');
     $data['updatelastcheck'] = $datetimeobj->convert($dateformatdetails['phpdate'] . " H:i:s");
     $data['updateavailable'] = getGlobalSetting("updateavailable") && Yii::app()->getConfig("updatable");
     $data['updatable'] = Yii::app()->getConfig("updatable");
     $data['updateinfo'] = getGlobalSetting("updateinfo");
     $data['updatebuild'] = getGlobalSetting("updatebuild");
     $data['updateversion'] = getGlobalSetting("updateversion");
     $data['aUpdateVersions'] = json_decode(getGlobalSetting("updateversions"), true);
     $data['allLanguages'] = getLanguageData(false, Yii::app()->session['adminlang']);
     if (trim(Yii::app()->getConfig('restrictToLanguages')) == '') {
         $data['restrictToLanguages'] = array_keys($data['allLanguages']);
         $data['excludedLanguages'] = array();
     } else {
         $data['restrictToLanguages'] = explode(' ', trim(Yii::app()->getConfig('restrictToLanguages')));
         $data['excludedLanguages'] = array_diff(array_keys($data['allLanguages']), $data['restrictToLanguages']);
     }
     $data['fullpagebar']['savebutton']['form'] = 'frmglobalsettings';
     $data['fullpagebar']['saveandclosebutton']['form'] = 'frmglobalsettings';
     $data['fullpagebar']['closebutton']['url'] = 'admin/';
     $this->_renderWrappedTemplate('', 'globalSettings_view', $data);
 }
开发者ID:CSCI-462-01-2016,项目名称:LimeSurvey,代码行数:43,代码来源:globalsettings.php


示例11: DoLogin

 public function DoLogin()
 {
     $clang = $this->getController()->lang;
     $user = $_POST['email'];
     $pass = $_POST['password'];
     //$spass = hash('sha256', $pass);
     $spwd = urlencode(base64_encode($pass));
     $sql = "SELECT * FROM {{view_panel_list_master}} WHERE email = '{$user}' AND password = '{$spwd}'";
     $result = Yii::app()->db->createCommand($sql)->query();
     $count = $result->rowCount;
     if ($count > 0) {
         $sresult = $result->readAll();
         if ($sresult[0]['status'] == 'E') {
             Yii::app()->session['plid'] = $sresult[0]['panel_list_id'];
             Yii::app()->session['plname'] = $sresult[0]['full_name'];
             Yii::app()->session['plemail'] = $sresult[0]['email'];
             Yii::app()->session['pluser'] = $sresult[0]['first_name'];
             Yii::app()->session['session_hash'] = hash('sha256', getGlobalSetting('SessionName') . $sresult[0]['first_name'] . $sresult[0]['panel_list_id']);
             $this->_doRedirect();
         } elseif ($sresult[0]['status'] == 'C') {
             $message = $clang->gT('Your Account Is canceled');
             $message .= '<br/>';
             $message .= $clang->gT('Please contact support');
             App()->user->setFlash('loginError', $message);
             $this->getController()->redirect(array('/pl/authentication/sa/login'));
         } elseif ($sresult[0]['status'] == 'D') {
             $message = $clang->gT('Your Account Is Disable By Administrator');
             App()->user->setFlash('loginError', $message);
             $this->getController()->redirect(array('/pl/authentication/sa/login'));
         } else {
             $aData['Pending'] = true;
             $aData['success'] = false;
             $aData['panellist_id'] = $sresult[0]['panel_list_id'];
             $this->_renderWrappedTemplate('', 'view_registration', $aData);
         }
     } else {
         $message = $clang->gT('Incorrect username and/or password!');
         App()->user->setFlash('loginError', $message);
         $this->getController()->redirect(array('/pl/authentication/sa/login'));
     }
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:41,代码来源:authentication.php


示例12: _displaySettings

 private function _displaySettings()
 {
     Yii::app()->loadHelper('surveytranslator');
     //save refurl from where global settings screen is called!
     $refurl = Yii::app()->getRequest()->getUrlReferrer();
     // Some URLs are not to be allowed to refered back to.
     // These exceptions can be added to the $aReplacements array
     $aReplacements = array('admin/user/adduser' => 'admin/user/index', 'admin/user/sa/adduser' => 'admin/user/sa/index', 'admin/user/sa/setusertemplates' => 'admin/user/sa/index', 'admin/user/setusertemplates' => 'admin/user/sa/index');
     $refurl = str_replace(array_keys($aReplacements), array_values($aReplacements), $refurl);
     Yii::app()->session['refurl'] = htmlspecialchars($refurl);
     //just to be safe!
     $data['clang'] = $this->getController()->lang;
     $data['title'] = "hi";
     $data['message'] = "message";
     foreach ($this->_checkSettings() as $key => $row) {
         $data[$key] = $row;
     }
     $data['thisupdatecheckperiod'] = getGlobalSetting('updatecheckperiod');
     Yii::app()->loadLibrary('Date_Time_Converter');
     $dateformatdetails = getDateFormatData(Yii::app()->session['dateformat']);
     $datetimeobj = new date_time_converter(getGlobalSetting("updatelastcheck"), 'Y-m-d H:i:s');
     $data['updatelastcheck'] = $datetimeobj->convert($dateformatdetails['phpdate'] . " H:i:s");
     $data['updateavailable'] = getGlobalSetting("updateavailable") && Yii::app()->getConfig("updatable");
     $data['updatable'] = Yii::app()->getConfig("updatable");
     $data['updateinfo'] = getGlobalSetting("updateinfo");
     $data['updatebuild'] = getGlobalSetting("updatebuild");
     $data['updateversion'] = getGlobalSetting("updateversion");
     $data['allLanguages'] = getLanguageData(false, Yii::app()->session['adminlang']);
     if (trim(Yii::app()->getConfig('restrictToLanguages')) == '') {
         $data['restrictToLanguages'] = array_keys($data['allLanguages']);
         $data['excludedLanguages'] = array();
     } else {
         $data['restrictToLanguages'] = explode(' ', trim(Yii::app()->getConfig('restrictToLanguages')));
         $data['excludedLanguages'] = array_diff(array_keys($data['allLanguages']), $data['restrictToLanguages']);
     }
     $this->_renderWrappedTemplate('', 'globalSettings_view', $data);
 }
开发者ID:pmaonline,项目名称:limesurvey-quickstart,代码行数:37,代码来源:globalsettings.php


示例13: templatereplace


//.........这里部分代码省略.........
            }
            $_registerform .= '
            <tr>
            <td align="right">' . $thissurvey['attributecaptions'][$field] . ($attribute['mandatory'] == 'Y' ? '*' : '') . ':</td>
            <td align="left"><input class="text" type="text" name="register_' . $field . '" /></td>
            </tr>';
        }
        if ((count($registerdata) > 1 || isset($thissurvey['usecaptcha'])) && function_exists("ImageCreate") && isCaptchaEnabled('registrationscreen', $thissurvey['usecaptcha'])) {
            $_registerform .= "<tr><td align='right'>" . $clang->gT("Security Question") . ":</td><td><table><tr><td valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . $surveyid) . "' alt='' /></td><td valign='middle'><input type='text' size='5' maxlength='3' name='loadsecurity' value='' /></td></tr></table></td></tr>\n";
        }
        $_registerform .= "<tr><td></td><td><input id='registercontinue' class='submit' type='submit' value='" . $clang->gT("Continue") . "' />" . "</td></tr>\n" . "</table>\n";
        if (count($registerdata) > 1 && $registerdata['sid'] != NULL && $debugSrc == 'register.php') {
            $_registerform .= "<input name='startdate' type ='hidden' value='" . $registerdata['startdate'] . "' />";
            $_registerform .= "<input name='enddate' type ='hidden' value='" . $registerdata['enddate'] . "' />";
        }
        $_registerform .= "</form>\n";
    } else {
        $_registerform = "";
    }
    // Assessments
    $assessmenthtml = "";
    if (isset($surveyid) && !is_null($surveyid) && function_exists('doAssessment')) {
        $assessmentdata = doAssessment($surveyid, true);
        $_assessment_current_total = $assessmentdata['total'];
        if (stripos($line, "{ASSESSMENTS}")) {
            $assessmenthtml = doAssessment($surveyid, false);
        }
    } else {
        $_assessment_current_total = '';
    }
    if (isset($thissurvey['googleanalyticsapikey']) && trim($thissurvey['googleanalyticsapikey']) != '') {
        $_googleAnalyticsAPIKey = trim($thissurvey['googleanalyticsapikey']);
    } else {
        $_googleAnalyticsAPIKey = trim(getGlobalSetting('googleanalyticsapikey'));
    }
    $_googleAnalyticsStyle = isset($thissurvey['googleanalyticsstyle']) ? $thissurvey['googleanalyticsstyle'] : '0';
    $_googleAnalyticsJavaScript = '';
    if ($_googleAnalyticsStyle != '' && $_googleAnalyticsStyle != 0 && $_googleAnalyticsAPIKey != '') {
        switch ($_googleAnalyticsStyle) {
            case '1':
                // Default Google Tracking
                $_googleAnalyticsJavaScript = <<<EOD
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '{$_googleAnalyticsAPIKey}']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
EOD;
                break;
            case '2':
                // SurveyName-[SID]/[GSEQ]-GroupName - create custom GSEQ based upon page step
                $moveInfo = LimeExpressionManager::GetLastMoveResult();
                if (is_null($moveInfo)) {
                    $gseq = 'welcome';
                } else {
                    if ($moveInfo['finished']) {
                        $gseq = 'finished';
                    } else {
                        if (isset($moveInfo['at_start']) && $moveInfo['at_start']) {
                            $gseq = 'welcome';
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:67,代码来源:replacements_helper.php


示例14: templatereplace


//.........这里部分代码省略.........
    $_saveform .= "' /></td></tr>\n";
    if (isset($thissurvey['usecaptcha']) && function_exists("ImageCreate") && isCaptchaEnabled('saveandloadscreen', $thissurvey['usecaptcha'])) {
        $_saveform .= "<tr class='save-survey-row save-survey-captcha'><td class='save-survey-label label-cell' align='right'><label for='loadsecurity'>" . gT("Security question") . "</label>:</td><td class='save-survey-input input-cell'><table class='captcha-table'><tr><td class='captcha-image' valign='middle'><img alt='' src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . (isset($surveyid) ? $surveyid : '')) . "' /></td><td class='captcha-input' valign='middle' style='text-align:left'><input type='text' size='5' maxlength='3' id='loadsecurity' name='loadsecurity' value='' /></td></tr></table></td></tr>\n";
    }
    $_saveform .= "<tr><td align='right'></td><td></td></tr>\n" . "<tr class='save-survey-row save-survey-submit'><td class='save-survey-label label-cell'><label class='hide jshide' for='savebutton'>" . gT("Save Now") . "</label></td><td class='save-survey-input input-cell'><input type='submit' id='savebutton' name='savesubmit' class='button' value='" . gT("Save Now") . "' /></td></tr>\n" . "</table>";
    // Load Form
    $_loadform = "<table class='load-survey-form'><tr class='load-survey-row load-survey-name'><td class='load-survey-label label-cell' align='right'><label for='loadname'>" . gT("Saved name") . "</label>:</td><td class='load-survey-input input-cell'><input type='text' id='loadname' name='loadname' value='";
    if (isset($loadname)) {
        $_loadform .= HTMLEscape(autoUnescape($loadname));
    }
    $_loadform .= "' /></td></tr>\n" . "<tr class='load-survey-row load-survey-password'><td class='load-survey-label label-cell' align='right'><label for='loadpass'>" . gT("Password") . "</label>:</td><td class='load-survey-input input-cell'><input type='password' id='loadpass' name='loadpass' value='";
    if (isset($loadpass)) {
        $_loadform .= HTMLEscape(autoUnescape($loadpass));
    }
    $_loadform .= "' /></td></tr>\n";
    if (isset($thissurvey['usecaptcha']) && function_exists("ImageCreate") && isCaptchaEnabled('saveandloadscreen', $thissurvey['usecaptcha'])) {
        $_loadform .= "<tr class='load-survey-row load-survey-captcha'><td class='load-survey-label label-cell' align='right'><label for='loadsecurity'>" . gT("Security question") . "</label>:</td><td class='load-survey-input input-cell'><table class='captcha-table'><tr><td class='captcha-image' valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . (isset($surveyid) ? $surveyid : '')) . "' alt='' /></td><td class='captcha-input' valign='middle'><input type='text' size='5' maxlength='3' id='loadsecurity' name='loadsecurity' value='' alt=''/></td></tr></table></td></tr>\n";
    }
    $_loadform .= "<tr class='load-survey-row load-survey-submit'><td class='load-survey-label label-cell'><label class='hide jshide' for='loadbutton'>" . gT("Load now") . "</label></td><td class='load-survey-input input-cell'><input type='submit' id='loadbutton' class='button' value='" . gT("Load now") . "' /></td></tr></table>\n";
    // Assessments
    $assessmenthtml = "";
    if (isset($surveyid) && !is_null($surveyid) && function_exists('doAssessment')) {
        $assessmentdata = doAssessment($surveyid, true);
        $_assessment_current_total = $assessmentdata['total'];
        if (stripos($line, "{ASSESSMENTS}")) {
            $assessmenthtml = doAssessment($surveyid, false);
        }
    } else {
        $_assessment_current_total = '';
    }
    if (isset($thissurvey['googleanalyticsapikey']) && trim($thissurvey['googleanalyticsapikey']) != '') {
        $_googleAnalyticsAPIKey = trim($thissurvey['googleanalyticsapikey']);
    } else {
        $_googleAnalyticsAPIKey = trim(getGlobalSetting('googleanalyticsapikey'));
    }
    $_googleAnalyticsStyle = isset($thissurvey['googleanalyticsstyle']) ? $thissurvey['googleanalyticsstyle'] : '0';
    $_googleAnalyticsJavaScript = '';
    if ($_googleAnalyticsStyle != '' && $_googleAnalyticsStyle != 0 && $_googleAnalyticsAPIKey != '') {
        switch ($_googleAnalyticsStyle) {
            case '1':
                // Default Google Tracking
                $_googleAnalyticsJavaScript = <<<EOD
<script>
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments) },i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', '{$_googleAnalyticsAPIKey}', 'auto');  // Replace with your property ID.
ga('send', 'pageview');

</script>

EOD;
                break;
            case '2':
                // SurveyName-[SID]/[GSEQ]-GroupName - create custom GSEQ based upon page step
                $moveInfo = LimeExpressionManager::GetLastMoveResult();
                if (is_null($moveInfo)) {
                    $gseq = 'welcome';
                } else {
                    if ($moveInfo['finished']) {
                        $gseq = 'finished';
                    } else {
                        if (isset($moveInfo['at_start']) && $moveInfo['at_start']) {
                            $gseq = 'welcome';
开发者ID:GuillaumeSmaha,项目名称:LimeSurvey,代码行数:67,代码来源:replacements_helper.php


示例15: dumplabel

 public function dumplabel()
 {
     $lid = sanitize_int(Yii::app()->request->getParam('lid'));
     // DUMP THE RELATED DATA FOR A SINGLE QUESTION INTO A SQL FILE FOR IMPORTING LATER ON OR
     // ON ANOTHER SURVEY SETUP DUMP ALL DATA WITH RELATED QID FROM THE FOLLOWING TABLES
     // 1. questions
     // 2. answers
     $lids = returnGlobal('lids');
     if (!$lid && !$lids) {
         die('No LID has been provided. Cannot dump label set.');
     }
     if ($lid) {
         $lids = array($lid);
     }
     $lids = array_map('sanitize_int', $lids);
     $fn = "limesurvey_labelset_" . implode('_', $lids) . ".lsl";
     $xml = getXMLWriter();
     $this->_addHeaders($fn, "text/html/force-download", "Mon, 26 Jul 1997 05:00:00 GMT", "cache");
     $xml->openURI('php://output');
     $xml->setIndent(TRUE);
     $xml->startDocument('1.0', 'UTF-8');
     $xml->startElement('document');
     $xml->writeElement('LimeSurveyDocType', 'Label set');
     $xml->writeElement('DBVersion', getGlobalSetting("DBVersion"));
     // Label sets table
     $lsquery = "SELECT * FROM {{labelsets}} WHERE lid=" . implode(' or lid=', $lids);
     buildXMLFromQuery($xml, $lsquery, 'labelsets');
     // Labels
     $lquery = "SELECT lid, code, title, sortorder, language, assessment_value FROM {{labels}} WHERE lid=" . implode(' or lid=', $lids);
     buildXMLFromQuery($xml, $lquery, 'labels');
     $xml->endElement();
     // close columns
     $xml->endDocument();
     exit;
 }
开发者ID:ryu1inaba,项目名称:LimeSurvey,代码行数:35,代码来源:export.php


示例16: enforceSSLMode

/**
* enforceSSLMode() $force_ssl is on or off, it checks if the current
* request is to HTTPS (or not). If $force_ssl is on, and the
* request is not to HTTPS, it redirects the request to the HTTPS
* version of the URL, if the request is to HTTPS, it rewrites all
* the URL variables so they also point to HTTPS.
*/
function enforceSSLMode()
{
    $bSSLActive = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off" || isset($_SERVER['HTTP_FORWARDED_PROTO']) && $_SERVER['HTTP_FORWARDED_PROTO'] == "https" || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == "https";
    if (Yii::app()->getConfig('ssl_emergency_override') !== true) {
        $force_ssl = strtolower(getGlobalSetting('force_ssl'));
    } else {
        $force_ssl = 'off';
    }
    if ($force_ssl == 'on' && !$bSSLActive) {
        SSLRedirec 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getGlobalUnread函数代码示例发布时间:2022-05-15
下一篇:
PHP getGlobal函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap