本文整理汇总了PHP中Securimage::check方法的典型用法代码示例。如果您正苦于以下问题:PHP Securimage::check方法的具体用法?PHP Securimage::check怎么用?PHP Securimage::check使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Securimage
的用法示例。
在下文中一共展示了Securimage::check方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createNew
function createNew()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|is_unique[user.login]');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('first', 'First', "required");
$this->form_validation->set_rules('last', 'last', "required");
$this->form_validation->set_rules('email', 'Email', "required|is_unique[user.email]");
if ($this->form_validation->run() == FALSE) {
$this->load->view('account/newForm');
} else {
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
echo "The security code entered was incorrect.<br /><br />";
echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
exit;
}
$user = new User();
$user->login = $this->input->post('username');
$user->first = $this->input->post('first');
$user->last = $this->input->post('last');
$clearPassword = $this->input->post('password');
$user->encryptPassword($clearPassword);
$user->email = $this->input->post('email');
$this->load->model('user_model');
$error = $this->user_model->insert($user);
$this->load->view('account/loginForm');
}
}
示例2: createNew
function createNew()
{
include_once $_SERVER['DOCUMENT_ROOT'] . '/tanks/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// you should handle the error so that the form processor doesn't continue
// or you can use the following code if there is no validation
echo "The security code entered was incorrect.<br /><br />";
echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
exit;
}
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|is_unique[user.login]');
$this->form_validation->set_rules('password', 'Password', 'required');
$this->form_validation->set_rules('first', 'First', "required");
$this->form_validation->set_rules('last', 'last', "required");
$this->form_validation->set_rules('email', 'Email', "required|is_unique[user.email]");
if ($this->form_validation->run() == FALSE) {
$this->load->view('account/newForm');
} else {
//FIXME: notify user on success
$user = new User();
$user->login = $this->input->post('username');
$user->first = $this->input->post('first');
$user->last = $this->input->post('last');
$clearPassword = $this->input->post('password');
$user->encryptPassword($clearPassword);
$user->email = $this->input->post('email');
$this->load->model('user_model');
$this->user_model->insert($user);
$this->load->view('account/loginForm');
}
}
示例3: findpassword
function findpassword()
{
if (strtoupper($_SERVER['REQUEST_METHOD']) === 'POST') {
$this->load->helper(array('server'));
include_once FCPATH . 'resource/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($this->input->post('captcha_code')) === false) {
json_response(array('success' => FALSE, 'msg' => 'Error Captcha'));
} else {
$this->form_validation->set_rules('username', 'Username Or Email', 'trim|required');
if ($this->form_validation->run() === FALSE) {
json_response(array('success' => FALSE, 'msg' => validation_errors()));
} else {
$username = trim($this->input->post('username'));
$this->db->where('username', $username);
$this->db->or_where('email', $username);
$row = $this->db->get('users')->row();
if ($row) {
// send change password link email to user
json_response(array('success' => TRUE, 'msg' => 'Send Success Info'));
} else {
json_response(array('success' => FALSE, 'msg' => 'Invalid User'));
}
}
}
} else {
$this->load->view('findpassword');
}
}
示例4: test
public function test(&$element, $value, $group = null, &$input = null, &$form = null)
{
// If the field is empty and not required, the field is valid.
require_once JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_mightytouch' . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'securimage.php';
$img = new Securimage();
return $img->check($value);
}
示例5: run
public function run($form)
{
$img = new Securimage();
try {
$code = $form->get('code');
if (!$img->check($code)) {
throw new CaptchaIncorretoException();
}
$nome = $form->get('nome');
$empresa = $form->get('empresa');
$telefone = $form->get('telefone');
$assunto = $form->get('assunto');
$mensagem = $form->get('mensagem');
$msg = new Mensagem(null, $nome, $empresa, $telefone, $assunto, $mensagem, Constants::$_ATIVO);
$fachada = Fachada::getInstance();
$fachada->cadastroMensagem()->cadastrar($msg);
$this->setMessage("Mensagem cadastrada com sucesso.", Constants::$_MSG_SUCCESS);
$this->load('100%');
$this->setForward(Forward::go(FaleConoscoPage::$NM_PAGINA . '&msg_cadastro=sucesso'));
} catch (CaptchaIncorretoException $e) {
$this->setMessage("As letras não foram digitadas corretamente! Por favor, tente novamente...", Constants::$_MSG_ERROR);
$this->load('100%');
$this->setForward(Forward::$_BACK);
}
}
示例6: process_si_contact_form
function process_si_contact_form()
{
if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['do'] == 'contact') {
// if the form has been submitted
/*foreach($_POST as $key => $value) {
if (!is_array($key)) {
// sanitize the input data
if ($key != 'ct_message') $value = strip_tags($value);
$_POST[$key] = htmlspecialchars(stripslashes(trim($value)));
}
}*/
$captcha = @$_POST['ct_captcha'];
// the user's entry for the captcha code
//$name = substr($name, 0, 64); // limit name to 64 characters
// Only try to validate the captcha if the form has no errors
// This is especially important for ajax calls
require_once dirname(__FILE__) . '/securimage.php';
$securimage = new Securimage();
if ($securimage->check($captcha) == false) {
echo 'denaied123';
} else {
echo 'success123';
}
}
// POST
}
示例7: captchaCheck
public static function captchaCheck()
{
$_POST['captcha_code'] = empty($_POST['captcha_code']) ? '' : $_POST['captcha_code'];
if (include public_path(config('coaster::admin.public') . '/securimage/securimage.php')) {
$secure_image = new \Securimage();
}
return isset($secure_image) ? $secure_image->check($_POST['captcha_code']) : false;
}
示例8: validate
public function validate(AF_Element $element) {
if (class_exists('Securimage')) {
$securimage = new Securimage();
return $securimage->check($element->value);
}
else {
die('AF_SecurimageValidator ERROR! Class Securimage not found.');
}
}
示例9: Securimage
function check_captha($captcha = "")
{
$securimage = new Securimage();
if ($securimage->check($captcha) == false) {
return false;
} else {
return true;
}
}
示例10: is_validate_captcha
function is_validate_captcha($code)
{
// CAPTCHA Class
include_once dirname(__FILE__) . '/lib/securimage/securimage.php';
$securimage = new Securimage();
if (false == $securimage->check($code)) {
return 0;
}
return 1;
}
示例11: verifyCaptcha
function verifyCaptcha($captcha)
{
$this->load->library('securimage/securimage');
$securimage = new Securimage();
// set error message if the captcha code is incorrect
if ($securimage->check($captcha) == false) {
$this->form_validation->set_message('verifyCaptcha', 'Verification code does not match the displayed image');
return false;
}
return true;
}
示例12: checkCaptcha
/**
* キャプチャコードチェック。
*/
public function checkCaptcha($check)
{
App::import('Vendor', 'Securimage', array('file' => 'securimage/securimage.php'));
$securimage = new Securimage();
foreach ($check as $key => $value) {
if ($securimage->check($value) === false) {
return false;
}
}
return true;
}
示例13: _valid_captcha
public function _valid_captcha($captcha)
{
/*Captcha*/
$this->load->library('securimage');
$securimage = new Securimage();
if (!$securimage->check($captcha)) {
return FALSE;
} else {
return TRUE;
}
}
示例14: validateCaptcha
function validateCaptcha($captchacode, $errorMsg)
{
$result = "";
include_once 'lib/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($captchacode) == false) {
// the code was incorrect
$result = $errorMsg . "<br />";
}
return $result;
}
示例15: _check_captcha
public function _check_captcha()
{
$this->load->library('securimage/securimage');
$securimage = new Securimage();
if (!$securimage->check($this->input->post('captcha'))) {
$this->form_validation->set_message('_check_captcha', 'The code you entered is invalid');
return FALSE;
} else {
return TRUE;
}
}