當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。