本文整理汇总了PHP中WC_Challenge::hashSolution方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Challenge::hashSolution方法的具体用法?PHP WC_Challenge::hashSolution怎么用?PHP WC_Challenge::hashSolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Challenge
的用法示例。
在下文中一共展示了WC_Challenge::hashSolution方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkSolution
public static function checkSolution(WC_Challenge $chall, $random, $letters_only = false, $lowercase = false, $length = 12)
{
if (false === ($answer = Common::getPostString('answer', false))) {
return;
}
$solution = self::generateSolution($random, $letters_only, $lowercase, $length);
if ($lowercase) {
$answer = strtolower($answer);
}
$chall->setVar('chall_solution', WC_Challenge::hashSolution($solution, $lowercase));
$chall->onSolve(GWF_Session::getUser(), $answer);
}
示例2: die
require_once 'challenge/html_head.php';
require GWF_CORE_PATH . 'module/WeChall/solutionbox.php';
if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) {
$chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 3, 'challenge/quangntenemy/2013NYS/index.php', false);
}
$chall->showHeader();
require_once GWF_CORE_PATH . 'module/WeChall/WC_CryptoChall.php';
$SOLUTION = WC_CryptoChall::generateSolution($secret, true);
if (!($bot = GWF_User::getByName('Silvester2013'))) {
die('oops');
}
if (!($user = GWF_User::getStaticOrGuest())) {
die('oops');
}
if (isset($_POST['answer'])) {
$chall->setVar('chall_solution', WC_Challenge::hashSolution($SOLUTION, true));
$chall->onCheckSolution();
}
if (Common::getGetString('santa') === 'clause.json') {
if ('' === ($rec = $user->getValidMail())) {
echo GWF_HTML::error('Happy Holidays', $chall->lang('err_no_mail'), false);
} else {
$mail = new GWF_Mail();
$mail->setSender($bot->getValidMail());
$mail->setSenderName('Silvester Stallhuhn');
$mail->setReceiver($user->getValidMail());
$mail->setReceiverName($user->getVar('user_name'));
$mail->setupGPG($bot);
$mail->setSubject($chall->lang('p2_subj'));
$mail->setBody($chall->lang('p2_body', array($SOLUTION)));
$mail->addAttachment('0xdeadc0de.asc', $key2, 'application/octet-stream', false);