Changeset 1356285
- Timestamp:
- 02/23/2016 06:39:04 AM (10 years ago)
- Location:
- wp-light-captcha/trunk
- Files:
-
- 2 added
- 2 edited
-
css (added)
-
css/style.css (added)
-
readme.txt (modified) (1 diff)
-
wp-light-captcha.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-light-captcha/trunk/readme.txt
r1321476 r1356285 29 29 ** This plugins has no view,just install and get captcha field in your login page ** 30 30 </div> 31 32 == Changelog == 33 = 1.0.1 = 34 * Style captcha answer input box -
wp-light-captcha/trunk/wp-light-captcha.php
r1321476 r1356285 2 2 /** 3 3 * Plugin Name: WP Light Captcha 4 * Plugin URI: http://learn24bd.com/portfolio/wp- captcha4 * Plugin URI: http://learn24bd.com/portfolio/wp-light-captcha 5 5 * Description: WP Light Captcha is very simple and lightweight captcha plugins for your WordPress site.You can protect unwanted login request from hackers. 6 * Version: 1.0 6 * Version: 1.0.1 7 7 * Author: Harun 8 8 * Author URI: http://learn24bd.com … … 11 11 require __DIR__ . "/lib/mc.class.php"; 12 12 add_action('login_form', 'wplc_login_form'); 13 13 14 function wplc_login_form() 14 15 { 15 16 Mc::putMcData(); 16 17 ?> 18 <style> 19 #wplc_user_answer{ 20 width: 100%; 21 height: 28px!important; 22 position: relative; 23 top: 7px; 24 font-size: 15px; 25 border-radius: 4px; 26 font-weight: 800; 27 color: #666; 28 } 29 </style> 17 30 <table> 18 31 <tr> 19 <td width="45%"><strong>Captcha:</strong> <?= Mc::getMcQuestion();?></td>32 <td width="45%"><strong>Captcha:</strong> <?=Mc::getMcQuestion();?></td> 20 33 <td> 21 <input type="hidden" name="wplc_a" value="<?= md5(Mc::getMcAnswer())?>">22 <input type="text" name="wplc_user_answer" placeholder="Put Answer" required="required">34 <input type="hidden" name="wplc_a" value="<?=md5(Mc::getMcAnswer())?>"> 35 <input type="text" id="wplc_user_answer" name="wplc_user_answer" placeholder="Put Answer" required="required"> 23 36 </td> 24 37 </tr> … … 31 44 function wplc_authenticate($user, $password) 32 45 { 33 if (isset($_POST['wplc_user_answer']) && isset($_POST['wplc_a'])) {34 $userAnswer = md5($_POST['wplc_user_answer']);46 if (isset($_POST['wplc_user_answer']) && isset($_POST['wplc_a'])) { 47 $userAnswer = md5($_POST['wplc_user_answer']); 35 48 $actualAnswer = $_POST['wplc_a']; 36 if ($userAnswer == $actualAnswer) {49 if ($userAnswer == $actualAnswer) { 37 50 return $user; 38 } 39 else { 51 } else { 40 52 $error = new WP_Error('denied', __('<strong>Incorrect!<strong>: Your captcha is incorrect')); 41 53 return $error; 42 54 } 43 } 44 else { 55 } else { 45 56 $error = new WP_Error('denied', __('<strong>Incorrect!<strong>: Your captcha is incorrect')); 46 57 return $error; … … 48 59 49 60 } 50 51
Note: See TracChangeset
for help on using the changeset viewer.