Plugin Directory

Changeset 1356285


Ignore:
Timestamp:
02/23/2016 06:39:04 AM (10 years ago)
Author:
haruncpi
Message:

style changes

Location:
wp-light-captcha/trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • wp-light-captcha/trunk/readme.txt

    r1321476 r1356285  
    2929 ** This plugins has no view,just install and get captcha field in your login page **
    3030</div>
     31
     32== Changelog ==
     33= 1.0.1 =
     34* Style captcha answer input box
  • wp-light-captcha/trunk/wp-light-captcha.php

    r1321476 r1356285  
    22/**
    33 * Plugin Name: WP Light Captcha
    4  * Plugin URI: http://learn24bd.com/portfolio/wp-captcha
     4 * Plugin URI: http://learn24bd.com/portfolio/wp-light-captcha
    55 * 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
    77 * Author: Harun
    88 * Author URI: http://learn24bd.com
     
    1111require __DIR__ . "/lib/mc.class.php";
    1212add_action('login_form', 'wplc_login_form');
     13
    1314function wplc_login_form()
    1415{
    1516    Mc::putMcData();
    1617    ?>
     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>
    1730    <table>
    1831        <tr>
    19             <td width="45%"><strong>Captcha:</strong> <?= Mc::getMcQuestion(); ?></td>
     32            <td width="45%"><strong>Captcha:</strong> <?=Mc::getMcQuestion();?></td>
    2033            <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">
    2336            </td>
    2437        </tr>
     
    3144function wplc_authenticate($user, $password)
    3245{
    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']);
    3548        $actualAnswer = $_POST['wplc_a'];
    36         if($userAnswer == $actualAnswer) {
     49        if ($userAnswer == $actualAnswer) {
    3750            return $user;
    38         }
    39         else {
     51        } else {
    4052            $error = new WP_Error('denied', __('<strong>Incorrect!<strong>: Your captcha is incorrect'));
    4153            return $error;
    4254        }
    43     }
    44     else {
     55    } else {
    4556        $error = new WP_Error('denied', __('<strong>Incorrect!<strong>: Your captcha is incorrect'));
    4657        return $error;
     
    4859
    4960}
    50 
    51 
Note: See TracChangeset for help on using the changeset viewer.