Ejemplo n.º 1
0
        die(file_get_contents('LIVIN_Smile.php'));
    }
}
# -------------------------- #
chdir('../../../');
define('GWF_PAGE_TITLE', 'Smile');
require_once 'challenge/html_head.php';
require_once GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 4, 'challenge/livinskull/smile/index.php', false);
}
$chall->showHeader();
# -------------------------- #
if (false !== ($answer = Common::getPostString('answer', false))) {
    require_once 'challenge/livinskull/smile/LIVIN_Smile.php';
    $solution = LIVIN_Smile::getSolution();
    if ($answer === $solution) {
        $chall->onChallengeSolved(GWF_Session::getUserID());
    } else {
        echo WC_HTML::error('err_wrong');
    }
}
# -------------------------- #
$url1 = 'index.php?show=smile';
$url2 = 'index.php?highlight=smile';
$url3 = 'index.php?show=livin_smile';
$url4 = 'index.php?highlight=livin_smile';
$url5 = 'smile.php';
echo GWF_Box::box($chall->lang('info', array($url1, $url2, $url3, $url4, $url5)), $chall->lang('title'));
# -------------------------- #
if (false !== ($file = Common::getGetString('highlight', false))) {
Ejemplo n.º 2
0
<?php

chdir('../../../');
define('GWF_PAGE_TITLE', 'Smile');
require_once 'challenge/html_head.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
    $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 4, 'challenge/livinskull/smile/index.php', false);
}
$chall->showHeader();
# Table and Helper :)
require_once 'challenge/livinskull/smile/LIVIN_Smile.php';
# Your solution is here :)
define('LIVINSKULL_SMILEY_SOLUTION', LIVIN_Smile::getSolution());
/**
 * The smiley form :)
 * @author gizmore
 */
class LivinForm
{
    private $chall;
    public function __construct(WC_Challenge $chall)
    {
        $this->chall = $chall;
    }
    # Sanitize pattern a bit
    public function validate_pattern($m, $arg)
    {
        if ($arg === '') {
            return $this->chall->lang('err_pattern');
        }
        if ($arg[0] !== '/') {