Example #1
0
<?php

require_once 'WC_HTML.php';
# We always need it
# DEBUG
$debug = GWF_DEBUG_EMAIL && GWF_IP6::isLocal();
define('WECHALL_DEBUG_SCORING', $debug);
# set true to debug scoring events.
define('WECHALL_DEBUG_LINKING', $debug);
# set true to debug site linking
define('WECHALL_CAESUM_PATCH', 'defined');
/**
 * WeChall + GWF! :D
 * @author gizmore
 * @version 1.02
 */
final class Module_WeChall extends GWF_Module
{
    const BOARD_CHALLS = 'Challenges';
    const BOARD_CHALLS_DESCR = 'Ask questions about our challenges here';
    const BOARD_SOLUTIONS = 'Solutions';
    const BOARD_SOLUTIONS_DESCR = 'Discuss solution to our challenges here';
    const BOARD_SITES = 'Sites';
    const BOARD_SITES_DESCR = 'Discuss the Challenge Sites here';
    ################
    ### Instance ###
    ################
    private static $instance = false;
    /**
     * @return Module_WeChall
     */
Example #2
0
if ($gwf_path === '') {
    die('Cannot autodetect GWF location!');
}
# Save detection to write it to index.php and cronjob.php
define('GWF_DETECT_PATH', $gwf_path);
########################
### Include GWF core ###
########################
require_once $gwf_path . 'gwf3.class.php';
###################################
### Try to load the config file ###
###################################
$config_path = 'protected/config.php';
if (is_file($config_path) && is_readable($config_path)) {
    require_once $config_path;
} else {
    require_once GWF_CORE_PATH . 'inc/install/GWF_AutoConfig.php';
    GWF_AutoConfig::configure();
}
######################
### Security check ###
######################
if (!GWF_IP6::isLocal()) {
    if ($_SERVER['REMOTE_ADDR'] !== $worker_ip) {
        die(sprintf('You have no valid $worker_ip in %s line %s. Your current IP is %s', __FILE__, __LINE__, $_SERVER['REMOTE_ADDR']));
    }
}
######################
### Call Installer ###
######################
require_once GWF_CORE_PATH . 'inc/install/install.php';