Example #1
0
 /**
  * constructor
  *
  * @return void
  */
 function __construct()
 {
     if (!Context::isInstalled()) {
         return;
     }
     if (!Context::isExistsSSLAction('dispBoardWrite') && Context::getSslStatus() == 'optional') {
         $ssl_actions = array('dispBoardWrite', 'dispBoardWriteComment', 'dispBoardReplyComment', 'dispBoardModifyComment', 'dispBoardDelete', 'dispBoardDeleteComment', 'procBoardInsertDocument', 'procBoardDeleteDocument', 'procBoardInsertComment', 'procBoardDeleteComment', 'procBoardVerificationPassword');
         Context::addSSLActions($ssl_actions);
     }
 }
Example #2
0
 /**
  * constructor
  *
  * @return void
  */
 function member()
 {
     if (!Context::isInstalled()) {
         return;
     }
     $oModuleModel = getModel('module');
     $member_config = $oModuleModel->getModuleConfig('member');
     // Set to use SSL upon actions related member join/information/password and so on. 2013.02.15
     if (!Context::isExistsSSLAction('dispMemberModifyPassword') && Context::getSslStatus() == 'optional') {
         $ssl_actions = array('dispMemberModifyPassword', 'dispMemberSignUpForm', 'dispMemberModifyInfo', 'dispMemberModifyEmailAddress', 'dispMemberGetTempPassword', 'dispMemberResendAuthMail', 'dispMemberLoginForm', 'dispMemberFindAccount', 'dispMemberLeave', 'procMemberLogin', 'procMemberModifyPassword', 'procMemberInsert', 'procMemberModifyInfo', 'procMemberFindAccount', 'procMemberModifyEmailAddress', 'procMemberUpdateAuthMail', 'procMemberResendAuthMail', 'procMemberLeave', 'procMemberFindAccountByQuestion');
         Context::addSSLActions($ssl_actions);
     }
 }
Example #3
0
 /**
  * prepares variables to use in moduleHandler
  * @param string $module name of module
  * @param string $act name of action
  * @param int $mid
  * @param int $document_srl
  * @param int $module_srl
  * @return void
  **/
 function ModuleHandler($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '')
 {
     // If XE has not installed yet, set module as install
     if (!Context::isInstalled()) {
         $this->module = 'install';
         $this->act = Context::get('act');
         return;
     }
     // Set variables from request arguments
     $this->module = $module ? $module : Context::get('module');
     $this->act = $act ? $act : Context::get('act');
     $this->mid = $mid ? $mid : Context::get('mid');
     $this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl');
     $this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl');
     $this->entry = Context::convertEncodingStr(Context::get('entry'));
     // Validate variables to prevent XSS
     $isInvalid = null;
     if ($this->module && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->module)) {
         $isInvalid = true;
     }
     if ($this->mid && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->mid)) {
         $isInvalid = true;
     }
     if ($this->act && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->act)) {
         $isInvalid = true;
     }
     if ($isInvalid) {
         htmlHeader();
         echo Context::getLang("msg_invalid_request");
         htmlFooter();
         Context::close();
         exit;
     }
     if (isset($this->act) && substr($this->act, 0, 4) == 'disp') {
         if (Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') {
             header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
             return;
         }
     }
     // execute addon (before module initialization)
     $called_position = 'before_module_init';
     $oAddonController =& getController('addon');
     $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc');
     @(include $addon_file);
 }
 /**
  * prepares variables to use in moduleHandler
  * @param string $module name of module
  * @param string $act name of action
  * @param int $mid
  * @param int $document_srl
  * @param int $module_srl
  * @return void
  * */
 function ModuleHandler($module = '', $act = '', $mid = '', $document_srl = '', $module_srl = '')
 {
     // If XE has not installed yet, set module as install
     if (!Context::isInstalled()) {
         $this->module = 'install';
         $this->act = Context::get('act');
         return;
     }
     $oContext = Context::getInstance();
     if ($oContext->isSuccessInit == FALSE) {
         $logged_info = Context::get('logged_info');
         if ($logged_info->is_admin != "Y") {
             $this->error = 'msg_invalid_request';
             return;
         }
     }
     // Set variables from request arguments
     $this->module = $module ? $module : Context::get('module');
     $this->act = $act ? $act : Context::get('act');
     $this->mid = $mid ? $mid : Context::get('mid');
     $this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl');
     $this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl');
     if ($entry = Context::get('entry')) {
         $this->entry = Context::convertEncodingStr($entry);
     }
     // Validate variables to prevent XSS
     $isInvalid = NULL;
     if ($this->module && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->module)) {
         $isInvalid = TRUE;
     }
     if ($this->mid && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->mid)) {
         $isInvalid = TRUE;
     }
     if ($this->act && !preg_match("/^([a-z0-9\\_\\-]+)\$/i", $this->act)) {
         $isInvalid = TRUE;
     }
     if ($isInvalid) {
         htmlHeader();
         echo Context::getLang("msg_invalid_request");
         htmlFooter();
         Context::close();
         exit;
     }
     if (isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act, 'disp', 0, 4) === 0)) {
         if (Context::get('_use_ssl') == 'optional' && Context::isExistsSSLAction($this->act) && $_SERVER['HTTPS'] != 'on') {
             if (Context::get('_https_port') != null) {
                 header('location:https://' . $_SERVER['HTTP_HOST'] . ':' . Context::get('_https_port') . $_SERVER['REQUEST_URI']);
             } else {
                 header('location:https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
             }
             return;
         }
     }
     // call a trigger before moduleHandler init
     ModuleHandler::triggerCall('moduleHandler.init', 'before', $this);
     // execute addon (before module initialization)
     $called_position = 'before_module_init';
     $oAddonController = getController('addon');
     $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone() ? 'mobile' : 'pc');
     if (file_exists($addon_file)) {
         include $addon_file;
     }
 }