예제 #1
0
 /**
  * Routine to check for installation or upgrade
  */
 public static function checkVersion()
 {
     global $db, $user;
     $swversion->major = EXPONENT_VERSION_MAJOR;
     $swversion->minor = EXPONENT_VERSION_MINOR;
     $swversion->revision = EXPONENT_VERSION_REVISION;
     $swversion->type = EXPONENT_VERSION_TYPE;
     $swversion->iteration = EXPONENT_VERSION_ITERATION;
     $swversion->builddate = EXPONENT_VERSION_BUILDDATE;
     // check database version against installed software version
     if ($db->havedb) {
         if ($user->isAdmin()) {
             $dbversion = $db->selectObject('version', 1);
             if (empty($dbversion)) {
                 $dbversion->major = 0;
                 $dbversion->minor = 0;
                 $dbversion->revision = 0;
                 $dbversion->type = '';
                 $dbversion->iteration = '';
             }
             // check if software version is newer than database version
             if (self::compareVersion($dbversion, $swversion)) {
                 $oldvers = $dbversion->major . '.' . $dbversion->minor . '.' . $dbversion->revision . ($dbversion->type ? $dbversion->type : '') . ($dbversion->iteration ? $dbversion->iteration : '');
                 $newvers = $swversion->major . '.' . $swversion->minor . '.' . $swversion->revision . ($swversion->type ? $swversion->type : '') . ($swversion->iteration ? $swversion->iteration : '');
                 flash('message', gt('The database requires upgrading from') . ' v' . $oldvers . ' ' . gt('to') . ' v' . $newvers . '<br><a href="' . makelink(array("controller" => "administration", "action" => "install_exponent")) . '">' . gt('Click here to Upgrade your website') . '</a>');
             }
         }
     } else {
         // database is unavailable, so show us as being offline
         $template = new standalonetemplate('_maintenance');
         $template->assign("db_down", true);
         $template->output();
         exit;
     }
     // check if online version is newer than installed software version, but only once per session
     if ($user->isAdmin()) {
         if (!expSession::is_set('update-check')) {
             $onlineVer = self::getOnlineVersion();
             expSession::set('update-check', '1');
             if (self::compareVersion($swversion, $onlineVer)) {
                 $newvers = $onlineVer->major . '.' . $onlineVer->minor . '.' . $onlineVer->revision . ($onlineVer->type ? $onlineVer->type : '') . ($onlineVer->iteration ? $onlineVer->iteration : '');
                 flash('message', gt('A newer version of Exponent is available') . ': v' . $newvers . ' ' . gt('was released') . ' ' . expDateTime::format_date($onlineVer->builddate) . '<br><a href="https://github.com/exponentcms/exponent-cms/downloads" target="_blank">' . gt('Click here to see available Downloads') . '</a>');
             }
         }
     }
 }
예제 #2
0
# Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
define('SCRIPT_EXP_RELATIVE', '');
define('SCRIPT_FILENAME', 'popup.php');
ob_start();
// Initialize the Exponent Framework
require_once 'exponent.php';
// Initialize the Theme Subsystem
if (!defined('SYS_THEME')) {
    require_once BASE . 'subsystems/theme.php';
}
$loc = exponent_core_makeLocation(isset($_GET['module']) ? $_GET['module'] : '', isset($_GET['src']) ? $_GET['src'] : '', isset($_GET['int']) ? $_GET['int'] : '');
$SYS_FLOW_REDIRECTIONPATH = 'popup';
if (exponent_theme_inAction()) {
    exponent_theme_runAction();
} else {
    if (isset($_GET['module']) && isset($_GET['view'])) {
        exponent_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_SECTIONAL);
        $mod = new $_GET['module']();
        $mod->show($_GET['view'], $loc, isset($_GET['title']) ? $_GET['title'] : '');
    }
}
$str = ob_get_contents();
ob_end_clean();
$template = new standalonetemplate('popup_' . (isset($_GET['template']) ? $_GET['template'] : 'general'));
$template->assign('output', $str);
$template->output();
예제 #3
0
define('SCRIPT_FILENAME', 'login.php');
ob_start();
// Initialize the Exponent Framework
require_once 'exponent.php';
// Initialize the Sessions Subsystem
if (!defined('SYS_SESSIONS')) {
    require_once BASE . 'subsystems/sessions.php';
}
// Initialize the Theme Subsystem
if (!defined('SYS_THEME')) {
    require_once BASE . 'subsystems/theme.php';
}
if (exponent_sessions_loggedIn()) {
    $SYS_FLOW_REDIRECTIONPATH = 'exponent_default';
    exponent_flow_redirect();
    exit('Redirecting...');
} else {
    if (isset($_REQUEST['module']) && isset($_REQUEST['action'])) {
        $SYS_FLOW_REDIRECTIONPATH = 'loginredirect';
        exponent_theme_runAction();
        LoginModule::show(DEFAULT_VIEW, null);
    } else {
        $SYS_FLOW_REDIRECTIONPATH = 'loginredirect';
        exponent_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_SECTIONAL);
        LoginModule::show(DEFAULT_VIEW, null);
    }
}
$template = new standalonetemplate('loginredirect');
$template->assign('output', ob_get_contents());
ob_end_clean();
$template->output();
if (isset($_REQUEST['dest'])) {
    $source_select['dest'] = $_REQUEST['dest'];
} else {
    if (!isset($source_select['dest'])) {
        $source_select['dest'] = null;
    }
}
if (isset($_REQUEST['hideOthers'])) {
    $source_select['hideOthers'] = $_REQUEST['hideOthers'];
} else {
    if (!isset($source_select['hideOthers'])) {
        $source_select['hideOthers'] = 0;
    }
}
exponent_sessions_set('source_select', $source_select);
$template = new standalonetemplate('orphaned_content');
ob_start();
// Include the orphans_modules action of the container, to get a list of modules types with orhpans.
include_once BASE . 'modules/ContainerModule/actions/orphans_modules.php';
$template->assign('modules_output', ob_get_contents());
ob_end_clean();
if (isset($_GET['module'])) {
    ob_start();
    // Include the orphans_content action of the container module, to show all modules of the specified type.
    include_once BASE . 'modules/ContainerModule/actions/orphans_content.php';
    $template->assign('main_output', ob_get_contents());
    $template->assign('error', '');
    ob_end_clean();
} else {
    if ($db->countObjects('locationref', 'refcount = 0')) {
        $template->assign('error', 'needmodule');
예제 #5
0
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
define('SCRIPT_EXP_RELATIVE', '');
define('SCRIPT_FILENAME', 'index.php');
ob_start("ob_gzhandler");
$microtime_str = explode(' ', microtime());
$i_start = $microtime_str[0] + $microtime_str[1];
// Initialize the Exponent Framework
require_once 'exponent.php';
// set the output header
Header("Content-Type: text/html; charset=LANG_CHARSET");
// Check to see if we are in maintenance mode.
if (MAINTENANCE_MODE == 1) {
    if (!$user || $user->is_admin == 0 || $user->is_acting_admin == 0) {
        $template = new standalonetemplate('_maintenance');
        $template->output();
        exit;
    } else {
        echo '<div class="error">The site is currently in maintenance mode.</div>';
    }
}
// Initialize the theme subsystem
if (!defined('SYS_THEME')) {
    require_once BASE . 'subsystems/theme.php';
}
if (!DEVELOPMENT && @file_exists(BASE . 'install/not_configured')) {
    header('Location: install/index.php');
    exit('Redirecting to the Exponent Install Wizard');
}
// Setting $page  to an empty value, we do not want to get out