Example #1
0
 * @brief Declare constants for generic use and for checking to avoid a direct call from the Web
 **/
define('__XE__', TRUE);
/**
 * @brief Include the necessary configuration files
 **/
require dirname(__FILE__) . '/config/config.inc.php';
/**
 * @brief Initialize by creating Context object
 * Set all Request Argument/Environment variables
 **/
$oContext = Context::getInstance();
$oContext->init();
/**
 * @brief If default_url is set and it is different from the current url, attempt to redirect for SSO authentication and then process the module
 **/
if ($oContext->checkSSO()) {
    $oModuleHandler = new ModuleHandler();
    try {
        if ($oModuleHandler->init()) {
            $oModuleHandler->displayContent($oModuleHandler->procModule());
        }
    } catch (Exception $e) {
        htmlHeader();
        echo Context::getLang($e->getMessage());
        htmlFooter();
    }
}
$oContext->close();
/* End of file index.php */
/* Location: ./index.php */
Example #2
0
 *
 **/
/**
 * @brief Declare constants for generic use and for checking to avoid a direct call from the Web
 **/
define('__XE__', TRUE);
define('__ZBXE__', TRUE);
// deprecated : __ZBXE__ will be removed. Use __XE__ instead.
/**
 * @brief Include the necessary configuration files
 **/
require dirname(__FILE__) . '/config/config.inc.php';
/**
 * @brief Initialize by creating Context object
 * Set all Request Argument/Environment variables
 **/
$oContext =& Context::getInstance();
$oContext->init();
/**
 * @brief If default_url is set and it is different from the current url, attempt to redirect for SSO authentication and then process the module
 **/
if ($oContext->checkSSO()) {
    $oModuleHandler = new ModuleHandler();
    if ($oModuleHandler->init()) {
        $oModule =& $oModuleHandler->procModule();
        $oModuleHandler->displayContent($oModule);
    }
}
$oContext->close();
/* End of file index.php */
/* Location: ./index.php */
/* Copyright (C) NAVER <http://www.navercorp.com> */
/**
 * @file exchange_content.addon.php
 * @brief Addon for change content matched pattern's
 * @author [NAVER](http://www.navercorp.com) (<developers@xpressengine.com)
 */
if (!defined('__XE__')) {
    exit;
}
if ($called_position == "before_display_content") {
}
if ($called_position == "before_module_proc" && Context::get('download_wanna_reply') != "") {
    Context::loadLang(_XE_PATH_ . 'addons/download_wanna_reply/lang');
    $oModuleHandler = new ModuleHandler();
    $oModuleHandler->error = Context::getLang('msg_download_wanna_reply');
    $oModuleHandler->displayContent($this);
    Context::close();
    exit;
}
if ($called_position == "after_module_proc") {
    $oDocument = Context::get('oDocument');
    // 글이 없는 경우 처리하지 않음
    if (!$oDocument) {
        return;
    }
    $logged_info = Context::get('logged_info');
    if ($logged_info) {
        // 본인이 작성한 글은 다운로드 가능
        if ($logged_info->member_srl == $oDocument->variables['member_srl']) {
            return;
        }
Example #4
0
 /**
  * Display a generic error page and exit.
  * 
  * @param string $title
  * @param string $message
  * @return void
  */
 public static function displayErrorPage($title = 'Error', $message = '', $status = 500)
 {
     // Change current directory to the Rhymix installation path.
     chdir(\RX_BASEDIR);
     // Set the title.
     self::setBrowserTitle(self::getSiteTitle());
     self::addBrowserTitle($title);
     // Set the message.
     $oMessageObject = getView('message');
     $oMessageObject->setError(-1);
     if ($status != 200) {
         $oMessageObject->setHttpStatusCode($status);
     }
     if (in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON', 'JS_CALLBACK'))) {
         $oMessageObject->setMessage(trim($title . "\n\n" . $message));
     } else {
         $oMessageObject->setMessage($title);
         $oMessageObject->dispMessage($message);
     }
     // Display the message.
     $oModuleHandler = new ModuleHandler();
     $oModuleHandler->displayContent($oMessageObject);
 }
Example #5
0
 /**
  * Enforce site lock.
  */
 private static function enforceSiteLock()
 {
     // Allow if the current user is logged in as administrator, or trying to log in.
     $logged_info = self::get('logged_info');
     if ($logged_info && $logged_info->is_admin === 'Y') {
         return;
     } elseif (in_array(self::get('act'), array('procMemberLogin', 'dispMemberLogout'))) {
         return;
     }
     // Allow if the current user is in the list of allowed IPs.
     $allowed_list = config('lock.allow');
     foreach ($allowed_list as $allowed_ip) {
         if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $allowed_ip)) {
             return;
         }
     }
     // Set headers and constants for backward compatibility.
     header('HTTP/1.1 503 Service Unavailable');
     define('_XE_SITELOCK_', TRUE);
     define('_XE_SITELOCK_TITLE_', config('lock.title') ?: self::getLang('admin.sitelock_in_use'));
     define('_XE_SITELOCK_MESSAGE_', config('lock.message'));
     unset($_SESSION['XE_VALIDATOR_RETURN_URL']);
     // Load the sitelock template.
     if (FileHandler::exists(RX_BASEDIR . 'common/tpl/sitelock.user.html')) {
         include RX_BASEDIR . 'common/tpl/sitelock.user.html';
     } else {
         self::setBrowserTitle(self::getSiteTitle());
         $oMessageObject = getView('message');
         $oMessageObject->setHttpStatusCode(503);
         $oMessageObject->setError(-1);
         $oMessageObject->setMessage(_XE_SITELOCK_TITLE_);
         $oMessageObject->dispMessage();
         $oModuleHandler = new ModuleHandler();
         $oModuleHandler->displayContent($oMessageObject);
     }
     exit;
 }