Fixes issues with account creation.

This commit is contained in:
James Quinley 2022-08-01 13:42:04 -07:00
parent 4fd6678791
commit f67bc0274f
2 changed files with 50 additions and 88 deletions

View File

@ -53,6 +53,7 @@ public class electronicMailHandler {
} catch (Exception e) {
e.printStackTrace();
System.err.println("Email ONBOARD Not sent due to an error");
secureCalls.banAction(receiverEmail);
if (e instanceof SendFailedException) {
secureCalls.banAction(receiverEmail);
}

View File

@ -516,6 +516,8 @@ public class delegationServices {
else
{
System.out.println("RS14");
System.out.println(password + "From Client");
System.out.println(Password + "From Trusted Server");
if (Password.equals(password)) {
System.out.println("R3c");
Token = (int) accountServer.get("Token");
@ -568,7 +570,7 @@ public class delegationServices {
BasicDBObject updateQuery = new BasicDBObject();
BasicDBObject updateQuery1 = new BasicDBObject();
updateQuery.append("$set",
new BasicDBObject().append("type", 7));
new BasicDBObject().append("type", 9));
updateQuery1.append("$set",
new BasicDBObject().append("status", true));
dCollection.updateOne(searchQuery, updateQuery);
@ -600,7 +602,7 @@ public class delegationServices {
BasicDBObject updateQuery = new BasicDBObject();
BasicDBObject updateQuery1 = new BasicDBObject();
updateQuery.append("$set",
new BasicDBObject().append("type", 9));
new BasicDBObject().append("type", 7));
updateQuery1.append("$set",
new BasicDBObject().append("status", true));
dCollection.updateOne(searchQuery, updateQuery);
@ -1108,49 +1110,10 @@ public class delegationServices {
System.out.println("UUID Free (While EXP)" + exDr);
}
}
System.out.println("Token & UUID Free (Main)");
System.out.println("Creating.");
Document createForm = new Document();
Document FnetInit = new Document();
createForm.append("User", User);
createForm.append("Password", Password);
createForm.append("Status", true);
createForm.append("Flagged", false);
createForm.append("Email", Email);
createForm.append("FName", FName);
createForm.append("Entitlements", "NA");
createForm.append("Path", "C:\\ObsidianCoreStudios\\Application\\");
createForm.append("Freinds", " ");
createForm.append("Token", tokenSTGEN);
createForm.append("UUID", UUID);
createForm.append("Control", 1);
createForm.append("Upgrade", 0);
createForm.append("Version","2");
createForm.append("keyStatus", false);
//createForm.append("Uid",uid);
createForm.append("lastNet", Macid);
accountS.insertOne(createForm);
FnetInit.append("User", User);
FnetInit.append("Status", true);
FnetInit.append("Friends", " ");
FnetInit.append("Token", tokenSTGEN);
FnetInit.append("UUID", UUID);
FnetInit.append("Control", 1);
FNETDOC.insertOne(FnetInit);
BasicDBObject searchQuery = new BasicDBObject();
searchQuery.append("clientid", ClientID);
electronicMailHandler.Onboarding(Email, User);
BasicDBObject updateQuery = new BasicDBObject();
BasicDBObject updateQuery1 = new BasicDBObject();
updateQuery.append("$set",
new BasicDBObject().append("type", 4));
updateQuery1.append("$set",
new BasicDBObject().append("status", true));
dCollection.updateOne(searchQuery, updateQuery);
dCollection.updateOne(searchQuery, updateQuery1);
System.out.println("Update Request With Finished Status");
delegationTimer.DeleteTargetRequest(ClientID);
} catch (NullPointerException uuid) {
System.out.println("UUID Free");
}
System.out.println("Token Free");
System.out.println("Token & UUID Free (Main)");
System.out.println("Creating.");
Document createForm = new Document();
@ -1196,8 +1159,6 @@ public class delegationServices {
}
}
}
}
if (requesttype == 20)
//TODO rewrite to just need username, password will be set by system later