From b24a35ab85fbd25741143afc902868c42df0b363 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 18 Mar 2020 08:03:38 +1000 Subject: Indent code properly. --- src/sledjchisl/sledjchisl.c | 84 ++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 1f60673..8b9d567 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c @@ -3533,60 +3533,52 @@ static int validateName(reqData *Rd, qhashtbl_t *data) if (login) { -if (rt) -{ - bitch(Rd, "Login failed.", "Could not read user Lua file."); - ret += rt; - if (i == 0) + if (rt) { - bitch(Rd, "Login failed.", "No UserAccounts record with that name."); - ret++; - } - else - { - if (i != 1) + bitch(Rd, "Login failed.", "Could not read user Lua file."); + ret += rt; + if (i == 0) { - bitch(Rd, "Login failed.", "More than one UserAccounts record with that name."); + bitch(Rd, "Login failed.", "No UserAccounts record with that name."); ret++; } else { - dbPull(Rd, "UserAccounts", rows); - Rd->stuff->putstr(Rd->stuff, "UUID", xstrdup(getStrH(Rd->database, "UserAccounts.PrincipalID"))); - Rd->stuff->putstr(Rd->stuff, "level", xstrdup(getStrH(Rd->database, "UserAccounts.Userlevel"))); - if (s) {s--; *s = ' '; s++;} - Rd->stuff->putstr(Rd->stuff, "name", xstrdup(name)); + if (i != 1) + { + bitch(Rd, "Login failed.", "More than one UserAccounts record with that name."); + ret++; + } + else + { + dbPull(Rd, "UserAccounts", rows); + Rd->stuff->putstr(Rd->stuff, "UUID", xstrdup(getStrH(Rd->database, "UserAccounts.PrincipalID"))); + Rd->stuff->putstr(Rd->stuff, "level", xstrdup(getStrH(Rd->database, "UserAccounts.Userlevel"))); + if (s) {s--; *s = ' '; s++;} + Rd->stuff->putstr(Rd->stuff, "name", xstrdup(name)); + } } } -} -else -{ -// if (0 != rt) - { - } -// else - { - Rd->database->putstr(Rd->database, "UserAccounts.FirstName", name); - Rd->database->putstr(Rd->database, "UserAccounts.LastName", s); - Rd->database->putstr(Rd->database, "UserAccounts.Email", getStrH(tnm, "email")); - Rd->database->putstr(Rd->database, "UserAccounts.Created", getStrH(tnm, "created")); - Rd->database->putstr(Rd->database, "UserAccounts.PrincipleID", getStrH(tnm, "UUID")); - Rd->database->putstr(Rd->database, "UserAccounts.UserLevel", getStrH(tnm, "level")); - Rd->database->putstr(Rd->database, "UserAccounts.UserFlags", getStrH(tnm, "flags")); - Rd->database->putstr(Rd->database, "UserAccounts.UserTitle", getStrH(tnm, "title")); - Rd->database->putstr(Rd->database, "UserAccounts.active", getStrH(tnm, "active")); - Rd->database->putstr(Rd->database, "auth.passwordSalt", getStrH(tnm, "passwordSalt")); - Rd->database->putstr(Rd->database, "auth.passwordHash", getStrH(tnm, "passwordHash")); - - Rd->stuff->putstr(Rd->stuff, "UUID", xstrdup(getStrH(Rd->database, "UserAccounts.PrincipalID"))); - Rd->stuff->putstr(Rd->stuff, "level", xstrdup(getStrH(Rd->database, "UserAccounts.Userlevel"))); - if (s) {s--; *s = ' '; s++;} - Rd->stuff->putstr(Rd->stuff, "name", xstrdup(name)); - if (s) {s--; *s = '\0'; s++;} - } - - -} + else + { + Rd->database->putstr(Rd->database, "UserAccounts.FirstName", name); + Rd->database->putstr(Rd->database, "UserAccounts.LastName", s); + Rd->database->putstr(Rd->database, "UserAccounts.Email", getStrH(tnm, "email")); + Rd->database->putstr(Rd->database, "UserAccounts.Created", getStrH(tnm, "created")); + Rd->database->putstr(Rd->database, "UserAccounts.PrincipleID", getStrH(tnm, "UUID")); + Rd->database->putstr(Rd->database, "UserAccounts.UserLevel", getStrH(tnm, "level")); + Rd->database->putstr(Rd->database, "UserAccounts.UserFlags", getStrH(tnm, "flags")); + Rd->database->putstr(Rd->database, "UserAccounts.UserTitle", getStrH(tnm, "title")); + Rd->database->putstr(Rd->database, "UserAccounts.active", getStrH(tnm, "active")); + Rd->database->putstr(Rd->database, "auth.passwordSalt", getStrH(tnm, "passwordSalt")); + Rd->database->putstr(Rd->database, "auth.passwordHash", getStrH(tnm, "passwordHash")); + + Rd->stuff->putstr(Rd->stuff, "UUID", xstrdup(getStrH(Rd->database, "UserAccounts.PrincipalID"))); + Rd->stuff->putstr(Rd->stuff, "level", xstrdup(getStrH(Rd->database, "UserAccounts.Userlevel"))); + if (s) {s--; *s = ' '; s++;} + Rd->stuff->putstr(Rd->stuff, "name", xstrdup(name)); + if (s) {s--; *s = '\0'; s++;} + } } else if (strcmp("create", Rd->doit) == 0) { -- cgit v1.1