Skip to content

Commit

Permalink
Added License Checking on login/status check.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fexcraft committed Apr 4, 2020
1 parent be0657f commit ebf7681
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/net/fexcraft/app/fmt/utils/SessionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SessionHandler {

private static boolean loggedin, encrypted;
private static String sessionid, hashpw, usermail, username, userid;
private static String perm = "free", permname = "Public Free Version";
private static String perm = "free", permname = "Public Version";

public static void load(){
Print.console("Loading auth data from FILE.");
Expand Down Expand Up @@ -64,6 +64,12 @@ public static void checkIfLoggedIn(boolean retry, boolean first){
if(obj.has("name")) username = obj.get("name").getAsString();
Print.console("Username updated to: " + username);
if(first) Print.console(">>>> Welcome back! <<<<");
obj = HttpUtil.request("http://fexcraft.net/session/api", "r=fmt_status", getCookieArr());
if(obj != null && obj.has("license") && obj.has("license_title")){
perm = obj.get("license").getAsString();
permname = obj.get("license_title").getAsString();
Print.console("License updated to: " + permname + " (" + perm + ")");
}
}
else if(retry){
if(!first) load();
Expand Down

0 comments on commit ebf7681

Please sign in to comment.