From 3ead342302f4ff8f7a741dc8925357ef96a586b2 Mon Sep 17 00:00:00 2001 From: Tekaoh <45337851+Tekaoh@users.noreply.github.com> Date: Fri, 8 May 2020 11:53:43 -0400 Subject: [PATCH] Settle down, Matt --- README.md | 8 ++++---- swg-auth/includes/swg-auth-admin-level-check.php | 4 ++-- swg-auth/includes/swg-auth-check.php | 6 +++--- swg-auth/public/html/swg-auth-resources-html.php | 1 + swg-auth/swg-auth.php | 4 ++-- trunk/readme.txt | 12 ++++++------ 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 8a873b8..3b2e036 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# SWG Authentication for Wordpress +# SWG Authentication for WordPress # Usage: 1. Upload the plugin files to the `wp-content/plugins/swg-auth/` directory or install the plugin through the WordPress Admin Panel. -2. Activate the plugin through the Wordpress Admin Panel. -3. Get the SWG Server config you need from SWG Auth -> Server Config +2. Activate the plugin through the WordPress Admin Panel. +3. Get the SWG Server Config you need from SWG Auth -> Server Config 4. Done! # Notes: -- Existing users should make a Wordpress account with the _same username_ that they were already using in order to gain access to their existing characters +- Existing users should make a WordPress account with the _same username_ that they were already using in order to gain access to their existing characters - HTTPS is recommended to avoid sending packets that contain plain text passwords diff --git a/swg-auth/includes/swg-auth-admin-level-check.php b/swg-auth/includes/swg-auth-admin-level-check.php index e29a86c..47e7656 100644 --- a/swg-auth/includes/swg-auth-admin-level-check.php +++ b/swg-auth/includes/swg-auth-admin-level-check.php @@ -8,7 +8,7 @@ if ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] === 'swg-auth-admin-level' // Look up the user's Admin level $level = get_user_meta( $user->ID, 'swg-auth-admin-level', true ); - // If the user is a Wordpress Admin, send back level 50 + // If the user is a WordPress Admin, send back level 50 if ( user_can( $user, 'administrator' ) ) { $response[ 'message' ] = "50"; @@ -23,6 +23,6 @@ if ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] === 'swg-auth-admin-level' // JSON Encode our response so that the server can understand it echo json_encode( $response ); - // Once we've responded, we don't want Wordpress to continue + // Once we've responded, we don't want WordPress to continue die; } diff --git a/swg-auth/includes/swg-auth-check.php b/swg-auth/includes/swg-auth-check.php index 33cfbbf..e6b32bf 100644 --- a/swg-auth/includes/swg-auth-check.php +++ b/swg-auth/includes/swg-auth-check.php @@ -3,14 +3,14 @@ // Check if the swg-auth action is requested and that a user_name and user_password are provided if ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] === 'swg-auth' && isset( $_POST[ 'user_name' ] ) && isset( $_POST[ 'user_password' ] ) ) { - // Ask Wordpress to authenticate the user_name and user_password + // Ask WordPress to authenticate the user_name and user_password $user = wp_authenticate_username_password( null, $_POST[ 'user_name' ], $_POST[ 'user_password' ] ); // Check if the authentication request returned an error if ( is_wp_error( $user ) ) { $response[ 'message' ] = "Account does not exist or password was incorrect"; - // Wordpress Administrators are always let in + // WordPress Administrators are always let in } elseif ( user_can( $user, 'administrator' ) ) { $response[ 'message' ] = "success"; @@ -29,6 +29,6 @@ if ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] === 'swg-auth' && isset( $_ // JSON Encode our response so that the LoginServer knows what we're talking about echo json_encode( $response ); - // Once we've responded, we don't want Wordpress to continue + // Once we've responded, we don't want WordPress to continue die; } diff --git a/swg-auth/public/html/swg-auth-resources-html.php b/swg-auth/public/html/swg-auth-resources-html.php index 49282a2..b45974f 100644 --- a/swg-auth/public/html/swg-auth-resources-html.php +++ b/swg-auth/public/html/swg-auth-resources-html.php @@ -262,5 +262,6 @@ elseif ( isset( $_GET[ 'display' ] ) && $_GET[ 'display' ] === 'class' && isset( Server Config +2. Activate the plugin through the WordPress Admin Panel. +3. Get the SWG Server Config you need from SWG Auth -> Server Config 4. Done! == Changelog == @@ -43,14 +43,14 @@ If you're running a Star Wars Galaxies server, now you can use Wordpress to mana = 0.4 = * Optionally, you can require that new accounts have to be specifically approved for game access -* You can now ban an account from the game from the Wordpress Admin Panel +* You can now ban an account from the game from the WordPress Admin Panel = 0.3 = * Added an admin menu that provides you with the server config you need * Bug fixes = 0.2 = -* Wordpress can now take requests for admin level checks +* WordPress can now take requests for admin level checks = 0.1 = * Authentication is functional