Code cleanup and some fixes

This commit is contained in:
2023-08-30 04:41:13 +03:00
parent 41ddbcab9e
commit 074ce120e9
6 changed files with 43 additions and 32 deletions

View File

@@ -69,9 +69,11 @@ if (ThisFileIsRequested(__FILE__)) {
ReturnJSONError($Err_RDP_InvalidArgs, "only allowed symbols are: " . $Config["registration"]["allowed_syms"]);
}
// Check if login already exists
if (User_LoginExist($login))
ReturnJSONError($Err_RDP_InvalidArgs, "login already exists");
// Create account
$result = User_Create($login, $password, $email, $invite);
ReturnJSONData(["success" => $result]);
} else { // Not enough arguments