当前位置: 首页>>代码示例>>PHP>>正文


PHP Securimage::check方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:ajitpawar,项目名称:connect4,代码行数:30,代码来源:account.php

示例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');
     }
 }
开发者ID:QamarMirza,项目名称:CSC309,代码行数:34,代码来源:account.php

示例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');
     }
 }
开发者ID:ishawge,项目名称:cxpcms,代码行数:29,代码来源:Login.php

示例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);
 }
开发者ID:AxelFG,项目名称:ckbran-inf,代码行数:7,代码来源:mecaptcha.php

示例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);
     }
 }
开发者ID:vagnerbarros,项目名称:anphpf,代码行数:25,代码来源:FaleConoscoAction.php

示例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
}
开发者ID:janitham,项目名称:deviceDependent,代码行数:26,代码来源:example_form.php

示例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;
 }
开发者ID:web-feet,项目名称:coasterframework,代码行数:8,代码来源:Securimage.php

示例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.');
		}
	}
开发者ID:renq,项目名称:ML-Lib,代码行数:9,代码来源:SecurimageValidator.php

示例9: Securimage

 function check_captha($captcha = "")
 {
     $securimage = new Securimage();
     if ($securimage->check($captcha) == false) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:selametsubu,项目名称:e-ppid,代码行数:9,代码来源:securimages_lib.php

示例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;
}
开发者ID:uiblee,项目名称:wilfully,代码行数:10,代码来源:contact.php

示例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;
 }
开发者ID:4cylinder,项目名称:connect4,代码行数:11,代码来源:account.php

示例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;
 }
开发者ID:rasken2003,项目名称:trpg-ranking,代码行数:14,代码来源:TmpUser.php

示例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;
     }
 }
开发者ID:nathanaelito,项目名称:clickbuena_ci,代码行数:11,代码来源:Contact.php

示例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;
}
开发者ID:dwaard,项目名称:ww_kans3,代码行数:11,代码来源:formvalidationtools.php

示例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;
     }
 }
开发者ID:kabircse,项目名称:CI-HTI-Securimage,代码行数:11,代码来源:secureimagetest.php


注:本文中的Securimage::check方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。