Plugin Directory

Changeset 2803598


Ignore:
Timestamp:
10/24/2022 06:04:06 PM (3 years ago)
Author:
thevisad
Message:

Adding in Version 3

Location:
hngamers-atavism-user-verification
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hngamers-atavism-user-verification/tags/0.0.3/atavism-verify.php

    r2802987 r2803598  
    1212 * Plugin URI: https://hngamers.com/courses/development/atavism/atavism-wordpress-cms/
    1313 * Description:  This is the user verification plugin for the HNG Core Atavism series and allows users to verify and log into the game server from the wordpress logins.
    14  * Version: 0.0.2
     14 * Version: 0.0.3
    1515 * Author: thevisad
    1616 * Author URI: https://hngamers.com/
     
    8181            "subscribers_only"         => "1",
    8282            "email_login"         => "1",
    83             "pmp_subscription_id"         => "1"
     83            "pmp_subscription_id"         => "1",
     84            "atavism_loginserver_ip"         => "1"
     85
    8486
    8587        );
     
    117119            add_settings_field('email_login', "Use Emails as login?", array( $this,'hngamers_atavism_user_verify_plugin_email_login_dropdown_fn'), __FILE__, 'hngamers_atavism_user_verify_plugin');
    118120            add_settings_field('pmp_subscription_id', 'Paid memberships Pro Subscription ID', array( $this,'hngamers_atavism_user_verify_plugin_setting_string'), __FILE__, 'hngamers_atavism_user_verify_plugin', 'pmp_subscription_id');
     121            add_settings_field('atavism_loginserver_ip', 'Comma Separated Server IP list', array( $this,'hngamers_atavism_user_verify_plugin_setting_string'), __FILE__, 'hngamers_atavism_user_verify_plugin', 'atavism_loginserver_ip');
     122
    119123    }
    120124   
     
    178182        $input['subscribers_only'] = wp_filter_nohtml_kses($input['subscribers_only']);
    179183        $input['email_login'] = wp_filter_nohtml_kses($input['email_login']);
    180 
     184        $input['atavism_loginserver_ip'] = wp_filter_nohtml_kses($input['atavism_loginserver_ip']);
    181185        $input['pmp_subscription_id'] = wp_filter_nohtml_kses($input['pmp_subscription_id']);
    182186
  • hngamers-atavism-user-verification/tags/0.0.3/readme.txt

    r2802987 r2803598  
    55Tested up to: 6.0
    66Requires PHP: 5.6
    7 Stable tag: 0.0.2
     7Stable tag: 0.0.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2929
    3030== Changelog ==
     31= 0.0.3 =
     32Add IP verification process to ensure that only the Atavism Server can reach out to the verify script. Must add the servers IP to the admin page, that will be calling the script in order to proceed.
     33
    3134= 0.0.2 =
    3235Minor corrections changes
  • hngamers-atavism-user-verification/tags/0.0.3/templates/hngamers-atavism-verify-user.php

    r2802987 r2803598  
    88{
    99    $options = get_option('hngamers_atavism_user_verify_plugin_options');
     10    $allowlist = preg_split ("/\,/", $options['atavism_loginserver_ip']);
     11   
     12    if (!in_array($_SERVER['REMOTE_ADDR'], $allowlist)) {
     13        return;
     14    }
     15   
    1016    $subscribers_only = $options['subscribers_only'];
    1117    if($subscribers_only == 2)
     
    106112            }
    107113            else {
    108                 echo(esc_html( '-1, user not found or wrong pass' ));
     114                echo(esc_html( '-1, wrong pass' ));
    109115            }
    110116        }else{
    111             echo(esc_html( '-1, user not found or wrong pass' ));
     117            echo(esc_html( '-1, user not found' ));
    112118        }
    113119    }
    114120    else
    115121    {
    116         echo(esc_html( '-1, user not found or wrong pass' ));
     122        echo(esc_html( '-1, user not found' ));
    117123    }
    118124}
  • hngamers-atavism-user-verification/trunk/atavism-verify.php

    r2802987 r2803598  
    1212 * Plugin URI: https://hngamers.com/courses/development/atavism/atavism-wordpress-cms/
    1313 * Description:  This is the user verification plugin for the HNG Core Atavism series and allows users to verify and log into the game server from the wordpress logins.
    14  * Version: 0.0.2
     14 * Version: 0.0.3
    1515 * Author: thevisad
    1616 * Author URI: https://hngamers.com/
     
    8181            "subscribers_only"         => "1",
    8282            "email_login"         => "1",
    83             "pmp_subscription_id"         => "1"
     83            "pmp_subscription_id"         => "1",
     84            "atavism_loginserver_ip"         => "1"
     85
    8486
    8587        );
     
    117119            add_settings_field('email_login', "Use Emails as login?", array( $this,'hngamers_atavism_user_verify_plugin_email_login_dropdown_fn'), __FILE__, 'hngamers_atavism_user_verify_plugin');
    118120            add_settings_field('pmp_subscription_id', 'Paid memberships Pro Subscription ID', array( $this,'hngamers_atavism_user_verify_plugin_setting_string'), __FILE__, 'hngamers_atavism_user_verify_plugin', 'pmp_subscription_id');
     121            add_settings_field('atavism_loginserver_ip', 'Comma Separated Server IP list', array( $this,'hngamers_atavism_user_verify_plugin_setting_string'), __FILE__, 'hngamers_atavism_user_verify_plugin', 'atavism_loginserver_ip');
     122
    119123    }
    120124   
     
    178182        $input['subscribers_only'] = wp_filter_nohtml_kses($input['subscribers_only']);
    179183        $input['email_login'] = wp_filter_nohtml_kses($input['email_login']);
    180 
     184        $input['atavism_loginserver_ip'] = wp_filter_nohtml_kses($input['atavism_loginserver_ip']);
    181185        $input['pmp_subscription_id'] = wp_filter_nohtml_kses($input['pmp_subscription_id']);
    182186
  • hngamers-atavism-user-verification/trunk/readme.txt

    r2802987 r2803598  
    55Tested up to: 6.0
    66Requires PHP: 5.6
    7 Stable tag: 0.0.2
     7Stable tag: 0.0.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2929
    3030== Changelog ==
     31= 0.0.3 =
     32Add IP verification process to ensure that only the Atavism Server can reach out to the verify script. Must add the servers IP to the admin page, that will be calling the script in order to proceed.
     33
    3134= 0.0.2 =
    3235Minor corrections changes
  • hngamers-atavism-user-verification/trunk/templates/hngamers-atavism-verify-user.php

    r2802987 r2803598  
    88{
    99    $options = get_option('hngamers_atavism_user_verify_plugin_options');
     10    $allowlist = preg_split ("/\,/", $options['atavism_loginserver_ip']);
     11   
     12    if (!in_array($_SERVER['REMOTE_ADDR'], $allowlist)) {
     13        return;
     14    }
     15   
    1016    $subscribers_only = $options['subscribers_only'];
    1117    if($subscribers_only == 2)
     
    106112            }
    107113            else {
    108                 echo(esc_html( '-1, user not found or wrong pass' ));
     114                echo(esc_html( '-1, wrong pass' ));
    109115            }
    110116        }else{
    111             echo(esc_html( '-1, user not found or wrong pass' ));
     117            echo(esc_html( '-1, user not found' ));
    112118        }
    113119    }
    114120    else
    115121    {
    116         echo(esc_html( '-1, user not found or wrong pass' ));
     122        echo(esc_html( '-1, user not found' ));
    117123    }
    118124}
Note: See TracChangeset for help on using the changeset viewer.