Plugin Directory

Changeset 2818593


Ignore:
Timestamp:
11/15/2022 11:05:50 PM (3 years ago)
Author:
thevisad
Message:

Adding in Version 4

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

Legend:

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

    r2803598 r2818593  
    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.3
     14 * Version: 0.0.4
    1515 * Author: thevisad
    1616 * Author URI: https://hngamers.com/
  • hngamers-atavism-user-verification/tags/0.0.4/readme.txt

    r2803598 r2818593  
    33Tags: user verification, atavism online
    44Requires at least: 5.2
    5 Tested up to: 6.0
     5Tested up to: 6.1.1
    66Requires PHP: 5.6
    7 Stable tag: 0.0.3
     7Stable tag: 0.0.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • hngamers-atavism-user-verification/tags/0.0.4/templates/hngamers-atavism-verify-user.php

    r2803598 r2818593  
    7878}
    7979
     80function hngamers_atavism_user_verify_check_mysql_error($str) {
     81    die("ERROR: ".$str);
     82}
     83
    8084function hngamers_atavism_user_verify_check_wordpress_user($usernamePost, $userPassword) {
    8185    //https://developer.wordpress.org/reference/functions/get_option/
     
    8791        $options[ 'hngamers_atavism_master_db_schema_string' ],
    8892        $options[ 'hngamers_atavism_master_db_port_string' ]
    89     );
     93    ) or hngamers_atavism_user_verify_check_mysql_error(mysqli_error($sel_db));
    9094
    9195    if (VerifyWordPressUser($usernamePost)) {   
     
    100104                if(!mysqli_num_rows($result)) {
    101105                    echo(esc_html(trim($user->ID)));
    102                 }       
     106                } else
     107                {
     108                    // Database issue
     109                    echo(esc_html( '-4' ));
     110                }                   
    103111               
    104112                foreach ($result as $data) {
    105113                    if ( empty( $data['status'] ) ) {
    106                         echo(esc_html( '-1, user banned' ));
    107                         exit();
     114                        // banned
     115                        echo(esc_html( '-2' ));
    108116                    } else {
     117                        // return the users ID
    109118                        echo(esc_html(trim($user->ID)));
    110119                    }
     
    112121            }
    113122            else {
    114                 echo(esc_html( '-1, wrong pass' ));
     123                echo(esc_html( '-1' ));
    115124            }
    116         }else{
    117             echo(esc_html( '-1, user not found' ));
     125        }
     126        else
     127        {
     128            echo(esc_html( '-3' ));
    118129        }
    119130    }
    120131    else
    121132    {
    122         echo(esc_html( '-1, user not found' ));
     133        echo(esc_html( '-3' ));
    123134    }
    124135}
  • hngamers-atavism-user-verification/trunk/atavism-verify.php

    r2803598 r2818593  
    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.3
     14 * Version: 0.0.4
    1515 * Author: thevisad
    1616 * Author URI: https://hngamers.com/
  • hngamers-atavism-user-verification/trunk/readme.txt

    r2803598 r2818593  
    33Tags: user verification, atavism online
    44Requires at least: 5.2
    5 Tested up to: 6.0
     5Tested up to: 6.1.1
    66Requires PHP: 5.6
    7 Stable tag: 0.0.3
     7Stable tag: 0.0.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • hngamers-atavism-user-verification/trunk/templates/hngamers-atavism-verify-user.php

    r2803598 r2818593  
    7878}
    7979
     80function hngamers_atavism_user_verify_check_mysql_error($str) {
     81    die("ERROR: ".$str);
     82}
     83
    8084function hngamers_atavism_user_verify_check_wordpress_user($usernamePost, $userPassword) {
    8185    //https://developer.wordpress.org/reference/functions/get_option/
     
    8791        $options[ 'hngamers_atavism_master_db_schema_string' ],
    8892        $options[ 'hngamers_atavism_master_db_port_string' ]
    89     );
     93    ) or hngamers_atavism_user_verify_check_mysql_error(mysqli_error($sel_db));
    9094
    9195    if (VerifyWordPressUser($usernamePost)) {   
     
    100104                if(!mysqli_num_rows($result)) {
    101105                    echo(esc_html(trim($user->ID)));
    102                 }       
     106                } else
     107                {
     108                    // Database issue
     109                    echo(esc_html( '-4' ));
     110                }                   
    103111               
    104112                foreach ($result as $data) {
    105113                    if ( empty( $data['status'] ) ) {
    106                         echo(esc_html( '-1, user banned' ));
    107                         exit();
     114                        // banned
     115                        echo(esc_html( '-2' ));
    108116                    } else {
     117                        // return the users ID
    109118                        echo(esc_html(trim($user->ID)));
    110119                    }
     
    112121            }
    113122            else {
    114                 echo(esc_html( '-1, wrong pass' ));
     123                echo(esc_html( '-1' ));
    115124            }
    116         }else{
    117             echo(esc_html( '-1, user not found' ));
     125        }
     126        else
     127        {
     128            echo(esc_html( '-3' ));
    118129        }
    119130    }
    120131    else
    121132    {
    122         echo(esc_html( '-1, user not found' ));
     133        echo(esc_html( '-3' ));
    123134    }
    124135}
Note: See TracChangeset for help on using the changeset viewer.