本文整理汇总了PHP中WC_HTML::error方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_HTML::error方法的具体用法?PHP WC_HTML::error怎么用?PHP WC_HTML::error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_HTML
的用法示例。
在下文中一共展示了WC_HTML::error方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute()
{
if (false === ($this->user = GWF_Session::getUser())) {
return GWF_HTML::err('ERR_LOGIN_REQUIRED');
}
$this->module->includeClass('WC_Warbox');
$this->module->includeClass('WC_Warflag');
$this->module->includeClass('WC_SiteAdmin');
$this->module->includeClass('WC_SiteCats');
$this->module->includeClass('sites/warbox/WCSite_WARBOX');
if (false === ($this->warbox = WC_Warbox::getByID(Common::getGetString('wbid')))) {
return WC_HTML::error('err_warbox');
}
if (!$this->warbox->hasEditPermission($this->user)) {
return GWF_HTML::err('ERR_NO_PERMISSION');
}
if (isset($_GET['edit'])) {
if (false === ($this->flag = WC_Warflag::getByID(Common::getGetString('edit')))) {
return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
}
if (isset($_POST['edit'])) {
return $this->onEdit();
} else {
return $this->templateEdit();
}
}
if (isset($_POST['add'])) {
return $this->onAdd();
}
if (isset($_GET['add'])) {
return $this->templateAdd();
}
if (isset($_POST['import'])) {
return $this->onCSVImport();
}
if (isset($_GET['export'])) {
return $this->onCSVExport();
}
if (isset($_GET['up'])) {
return $this->onUp() . $this->templateOverview();
} elseif (isset($_GET['down'])) {
return $this->onDown() . $this->templateOverview();
}
return $this->templateOverview();
}
示例2: sidologyRemixCheckAnswer
function sidologyRemixCheckAnswer(WC_Challenge $chall, $answer)
{
if (false !== ($error = $chall->isAnswerBlocked(GWF_User::getStaticOrGuest()))) {
echo $error;
return;
}
$solution = '726f3a30c8ae485b4f34d5ff0fed05552d3da60b';
# :) HappyCracking!
$hash = $answer;
for ($i = 0; $i < 100000; $i++) {
$hash = sha1($hash);
}
// echo "$hash<br/>\n";
if ($hash === $solution) {
$chall->onChallengeSolved();
} else {
echo WC_HTML::error('err_wrong');
}
}
示例3: chdir
<?php
chdir('../../');
define('GWF_PAGE_TITLE', 'Fremes');
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/FREMES/index.php', false);
}
$chall->showHeader();
if (false !== ($answer = Common::getPostString('answer', false))) {
if (false === ($key = GWF_Session::get('FREMEN_KEY', false))) {
echo GWF_HTML::error('Fremes', $chall->lang('err_try'));
} else {
$solution = GWF_Numeric::baseConvert($key, 2, 16);
$slen = strlen($solution);
$wlen = 128 / 4;
$nlen = $wlen - $slen;
$solution = str_repeat('0', $nlen) . $solution;
$answer = strtoupper($answer);
$solution = strtoupper($solution);
if ($answer === $solution || substr($answer, 2) === $solution) {
$chall->onChallengeSolved(GWF_Session::getUserID());
} else {
echo WC_HTML::error('err_wrong');
}
}
}
echo GWF_Box::box($chall->lang('info', array(128, 'fremes.php')), $chall->lang('title'));
echo formSolutionbox($chall);
require_once 'challenge/html_foot.php';