diff options
author | onefang | 2022-10-07 13:19:06 +1000 |
---|---|---|
committer | onefang | 2022-10-07 13:19:06 +1000 |
commit | d509ca03b22842116ebd197931fdcf509aef2108 (patch) | |
tree | b12665724fdca9195ad3f82413a7eb7097b36815 /src | |
parent | Don't free what is not allocated. (diff) | |
download | opensim-SC-d509ca03b22842116ebd197931fdcf509aef2108.zip opensim-SC-d509ca03b22842116ebd197931fdcf509aef2108.tar.gz opensim-SC-d509ca03b22842116ebd197931fdcf509aef2108.tar.bz2 opensim-SC-d509ca03b22842116ebd197931fdcf509aef2108.tar.xz |
Also disable and ban bits, though not fully implemented.
Diffstat (limited to '')
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index c02cba9..64ae6a3 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c | |||
@@ -5918,6 +5918,8 @@ static void accountWrite(reqData *Rd) | |||
5918 | if (!writeLuaString (Rd, fd, file, "vouched", "off")) goto notWritten; | 5918 | if (!writeLuaString (Rd, fd, file, "vouched", "off")) goto notWritten; |
5919 | if (!writeLuaString (Rd, fd, file, "voucher", NULL)) goto notWritten; | 5919 | if (!writeLuaString (Rd, fd, file, "voucher", NULL)) goto notWritten; |
5920 | if (!writeLuaString (Rd, fd, file, "approver", NULL)) goto notWritten; | 5920 | if (!writeLuaString (Rd, fd, file, "approver", NULL)) goto notWritten; |
5921 | if (!writeLuaString (Rd, fd, file, "banner", NULL)) goto notWritten; | ||
5922 | if (!writeLuaString (Rd, fd, file, "reason", NULL)) goto notWritten; | ||
5921 | if (!writeLuaString (Rd, fd, file, "link", link)) goto notWritten; | 5923 | if (!writeLuaString (Rd, fd, file, "link", link)) goto notWritten; |
5922 | l = strlen(end); | 5924 | l = strlen(end); |
5923 | if (l != writeall(fd, end, l)) | 5925 | if (l != writeall(fd, end, l)) |
@@ -7078,6 +7080,8 @@ static void accountViewWeb(reqData *Rd, inputForm *oF, inputValue *oV) | |||
7078 | *email = getStrH(Rd->database, "UserAccounts.Email"), | 7080 | *email = getStrH(Rd->database, "UserAccounts.Email"), |
7079 | *voucher = getStrH(Rd->database, "Lua.voucher"), | 7081 | *voucher = getStrH(Rd->database, "Lua.voucher"), |
7080 | *approver = getStrH(Rd->database, "Lua.approver"), | 7082 | *approver = getStrH(Rd->database, "Lua.approver"), |
7083 | *banner = getStrH(Rd->database, "Lua.banner"), | ||
7084 | *reason = getStrH(Rd->database, "Lua.reason"), | ||
7081 | *about = getStrH(Rd->database, "Lua.aboutMe"); | 7085 | *about = getStrH(Rd->database, "Lua.aboutMe"); |
7082 | time_t crtd = atol(getStrH(Rd->database, "UserAccounts.Created")); | 7086 | time_t crtd = atol(getStrH(Rd->database, "UserAccounts.Created")); |
7083 | 7087 | ||
@@ -7091,6 +7095,8 @@ static void accountViewWeb(reqData *Rd, inputForm *oF, inputValue *oV) | |||
7091 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>UUID :</b></span></font> %s</p>", getStrH(Rd->database, "UserAccounts.PrincipalID")); | 7095 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>UUID :</b></span></font> %s</p>", getStrH(Rd->database, "UserAccounts.PrincipalID")); |
7092 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Voucher :</b></span></font> %s</p>", voucher); | 7096 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Voucher :</b></span></font> %s</p>", voucher); |
7093 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Approver :</b></span></font> %s</p>", approver); | 7097 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Approver :</b></span></font> %s</p>", approver); |
7098 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Banner :</b></span></font> %s</p>", banner); | ||
7099 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Reason :</b></span></font> %s</p>", reason); | ||
7094 | HTMLtextArea(Rd->reply, "aboutMe", "About", 7, 50, 4, 16384, "", "off", "true", "soft", about, FALSE, TRUE); | 7100 | HTMLtextArea(Rd->reply, "aboutMe", "About", 7, 50, 4, 16384, "", "off", "true", "soft", about, FALSE, TRUE); |
7095 | accountWebSubs(Rd, oF); | 7101 | accountWebSubs(Rd, oF); |
7096 | accountWebFooter(Rd, oF); | 7102 | accountWebFooter(Rd, oF); |
@@ -7103,6 +7109,8 @@ static void accountEditWeb(reqData *Rd, inputForm *oF, inputValue *oV) | |||
7103 | *email = getStrH(Rd->database, "UserAccounts.Email"), | 7109 | *email = getStrH(Rd->database, "UserAccounts.Email"), |
7104 | *voucher = getStrH(Rd->database, "Lua.voucher"), | 7110 | *voucher = getStrH(Rd->database, "Lua.voucher"), |
7105 | *approver = getStrH(Rd->database, "Lua.approver"), | 7111 | *approver = getStrH(Rd->database, "Lua.approver"), |
7112 | *banner = getStrH(Rd->database, "Lua.banner"), | ||
7113 | *reason = getStrH(Rd->database, "Lua.reason"), | ||
7106 | *about = getStrH(Rd->database, "Lua.aboutMe"), | 7114 | *about = getStrH(Rd->database, "Lua.aboutMe"), |
7107 | *lvl = getLevel(atoi(level)); | 7115 | *lvl = getLevel(atoi(level)); |
7108 | short lv = atoi(level); | 7116 | short lv = atoi(level); |
@@ -7119,11 +7127,13 @@ static void accountEditWeb(reqData *Rd, inputForm *oF, inputValue *oV) | |||
7119 | HTMLtextArea(Rd->reply, "aboutMe", "About", 7, 50, 4, 16384, "", "off", "true", "soft", about, FALSE, TRUE); | 7127 | HTMLtextArea(Rd->reply, "aboutMe", "About", 7, 50, 4, 16384, "", "off", "true", "soft", about, FALSE, TRUE); |
7120 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Voucher :</b></span></font> %s</p>", voucher); | 7128 | Rd->reply->addstrf(Rd->reply, "<p><font size='5'><span style='font-size: x-large'><b>Voucher :</b></span></font> %s</p>", voucher); |
7121 | 7129 | ||
7122 | if (200 <= Rd->shs.level) | 7130 | if (200 <= Rd->shs.level) // Only gods can change level for accounts. |
7123 | { | 7131 | { |
7124 | qlisttbl_obj_t obj; | 7132 | qlisttbl_obj_t obj; |
7125 | 7133 | ||
7126 | HTMLhidden(Rd->reply, "approver", approver); | 7134 | HTMLhidden(Rd->reply, "approver", approver); |
7135 | HTMLhidden(Rd->reply, "banner", banner); | ||
7136 | HTMLhidden(Rd->reply, "reason", reason); | ||
7127 | HTMLselect(Rd->reply, "level", "level"); | 7137 | HTMLselect(Rd->reply, "level", "level"); |
7128 | memset((void*)&obj, 0, sizeof(obj)); // must be cleared before call | 7138 | memset((void*)&obj, 0, sizeof(obj)); // must be cleared before call |
7129 | accountLevels->lock(accountLevels); | 7139 | accountLevels->lock(accountLevels); |
@@ -7135,14 +7145,25 @@ static void accountEditWeb(reqData *Rd, inputForm *oF, inputValue *oV) | |||
7135 | if (strcmp(lvl, (char *) obj.data) == 0) | 7145 | if (strcmp(lvl, (char *) obj.data) == 0) |
7136 | is = true; | 7146 | is = true; |
7137 | 7147 | ||
7138 | // if ((is) || ((l <= Rd->shs.level) && (l != -200) && (l != -100) && (l != -50))) // Not above our pay grade, not newbie, validated, nor vouched for. | 7148 | /* "-256", "banned"); |
7139 | if ((is) || ((l <= Rd->shs.level) && (lv <= l))) // As per discussions, can't lower level. Do that in the console. | 7149 | "-240", "rejected"); |
7150 | "-230", "disabled"); | ||
7151 | "-200", "newbie"); | ||
7152 | "-100", "validated"); | ||
7153 | "-50", "vouched for"); | ||
7154 | "0", "approved"); // Note that http://opensimulator.org/wiki/Userlevel claims that 1 and above are "GOD_LIKE". | ||
7155 | "200", "god"); | ||
7156 | */ | ||
7157 | if ((is) || ((l <= Rd->shs.level) && (l != -200) && (l != -100) && (l != -50) && (strcmp("-256", (char *) obj.name) != 0) )) // Not above our pay grade, not newbie, validated, nor vouched for. Also skip banned. | ||
7158 | // if ((is) || ((l <= Rd->shs.level) && (lv <= l))) // As per discussions, can't lower level. Do that in the console. NOTE: No one can recall those discussions. lol | ||
7140 | HTMLoption(Rd->reply, (char *) obj.data, is); | 7159 | HTMLoption(Rd->reply, (char *) obj.data, is); |
7141 | } | 7160 | } |
7142 | accountLevels->unlock(accountLevels); | 7161 | accountLevels->unlock(accountLevels); |
7143 | HTMLselectEnd(Rd->reply); | 7162 | HTMLselectEnd(Rd->reply); |
7144 | 7163 | ||
7145 | Rd->reply->addstrf(Rd->reply, "<p><dl>"); | 7164 | Rd->reply->addstrf(Rd->reply, "<p><dl>"); |
7165 | Rd->reply->addstrf(Rd->reply, "<dt>banned</dt><dd>Account was banned.</dd>"); | ||
7166 | Rd->reply->addstrf(Rd->reply, "<dt>rejected</dt><dd>New account was rejected.</dd>"); | ||
7146 | Rd->reply->addstrf(Rd->reply, "<dt>disabled</dt><dd>Account cannot log in anywhere.</dd>"); | 7167 | Rd->reply->addstrf(Rd->reply, "<dt>disabled</dt><dd>Account cannot log in anywhere.</dd>"); |
7147 | Rd->reply->addstrf(Rd->reply, "<dt>newbie</dt><dd>Newly created account, not yet validated.</dd>"); | 7168 | Rd->reply->addstrf(Rd->reply, "<dt>newbie</dt><dd>Newly created account, not yet validated.</dd>"); |
7148 | Rd->reply->addstrf(Rd->reply, "<dt>validated</dt><dd>Newly created account, they have clicked on the validation link in their validation email.</dd>"); | 7169 | Rd->reply->addstrf(Rd->reply, "<dt>validated</dt><dd>Newly created account, they have clicked on the validation link in their validation email.</dd>"); |
@@ -7298,6 +7319,8 @@ V("Found Lua record."); | |||
7298 | Rd->database->putstr(Rd->database, "Lua.vouched", getStrH(tnm, "vouched")); | 7319 | Rd->database->putstr(Rd->database, "Lua.vouched", getStrH(tnm, "vouched")); |
7299 | Rd->database->putstr(Rd->database, "Lua.voucher", getStrH(tnm, "voucher")); | 7320 | Rd->database->putstr(Rd->database, "Lua.voucher", getStrH(tnm, "voucher")); |
7300 | Rd->database->putstr(Rd->database, "Lua.approver", getStrH(tnm, "approver")); | 7321 | Rd->database->putstr(Rd->database, "Lua.approver", getStrH(tnm, "approver")); |
7322 | Rd->database->putstr(Rd->database, "Lua.banner", getStrH(tnm, "banner")); | ||
7323 | Rd->database->putstr(Rd->database, "Lua.reason", getStrH(tnm, "reason")); | ||
7301 | } | 7324 | } |
7302 | // else if (rows) | 7325 | // else if (rows) |
7303 | if (rows) | 7326 | if (rows) |
@@ -7492,8 +7515,23 @@ static int accountSaveSub(reqData *Rd, inputForm *iF, inputValue *iV) | |||
7492 | { | 7515 | { |
7493 | if (200 <= Rd->shs.level) | 7516 | if (200 <= Rd->shs.level) |
7494 | { | 7517 | { |
7495 | I("%s %s approved by %s.", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName"), Rd->shs.name); | 7518 | if (strcmp("0", lvl) == 0) |
7496 | Rd->stuff->putstr(Rd->stuff, "approver", Rd->shs.name); | 7519 | { |
7520 | I("%s %s approved by %s.", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName"), Rd->shs.name); | ||
7521 | Rd->stuff->putstr(Rd->stuff, "approver", Rd->shs.name); | ||
7522 | } | ||
7523 | else if (strcmp("-240", lvl) == 0) | ||
7524 | { | ||
7525 | I("%s %s rejected by %s.", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName"), Rd->shs.name); | ||
7526 | Rd->stuff->putstr(Rd->stuff, "approver", Rd->shs.name); | ||
7527 | } | ||
7528 | else if (strcmp("-256", lvl) == 0) | ||
7529 | { | ||
7530 | I("%s %s banned by %s.", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName"), Rd->shs.name); | ||
7531 | Rd->stuff->putstr(Rd->stuff, "banner", Rd->shs.name); | ||
7532 | } | ||
7533 | else | ||
7534 | I("%s %s changed to %s by %s.", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName"), lvl, Rd->shs.name); | ||
7497 | } | 7535 | } |
7498 | else | 7536 | else |
7499 | { | 7537 | { |
@@ -7564,6 +7602,8 @@ static int accountValidateSub(reqData *Rd, inputForm *iF, inputValue *iV) | |||
7564 | Rd->stuff->putstr(Rd->stuff, "vouched", getStrH(Rd->database, "Lua.vouched")); | 7602 | Rd->stuff->putstr(Rd->stuff, "vouched", getStrH(Rd->database, "Lua.vouched")); |
7565 | Rd->stuff->putstr(Rd->stuff, "voucher", getStrH(Rd->database, "Lua.voucher")); | 7603 | Rd->stuff->putstr(Rd->stuff, "voucher", getStrH(Rd->database, "Lua.voucher")); |
7566 | Rd->stuff->putstr(Rd->stuff, "approver", getStrH(Rd->database, "Lua.approver")); | 7604 | Rd->stuff->putstr(Rd->stuff, "approver", getStrH(Rd->database, "Lua.approver")); |
7605 | Rd->stuff->putstr(Rd->stuff, "banner", getStrH(Rd->database, "Lua.banner")); | ||
7606 | Rd->stuff->putstr(Rd->stuff, "reason", getStrH(Rd->database, "Lua.reason")); | ||
7567 | Rd->shs.level = -100; | 7607 | Rd->shs.level = -100; |
7568 | Rd->database->putstr(Rd->database, "UserAccounts.UserLevel", "-100"); | 7608 | Rd->database->putstr(Rd->database, "UserAccounts.UserLevel", "-100"); |
7569 | accountWrite(Rd); | 7609 | accountWrite(Rd); |
@@ -8004,7 +8044,9 @@ void account_html(char *file, reqData *Rd, HTMLfile *thisFile) | |||
8004 | if (NULL == accountLevels) | 8044 | if (NULL == accountLevels) |
8005 | { | 8045 | { |
8006 | accountLevels = qlisttbl(QLISTTBL_LOOKUPFORWARD | QLISTTBL_THREADSAFE | QLISTTBL_UNIQUE); | 8046 | accountLevels = qlisttbl(QLISTTBL_LOOKUPFORWARD | QLISTTBL_THREADSAFE | QLISTTBL_UNIQUE); |
8007 | accountLevels->putstr(accountLevels, "-256", "disabled"); | 8047 | accountLevels->putstr(accountLevels, "-256", "banned"); |
8048 | accountLevels->putstr(accountLevels, "-240", "rejected"); | ||
8049 | accountLevels->putstr(accountLevels, "-230", "disabled"); | ||
8008 | accountLevels->putstr(accountLevels, "-200", "newbie"); | 8050 | accountLevels->putstr(accountLevels, "-200", "newbie"); |
8009 | accountLevels->putstr(accountLevels, "-100", "validated"); | 8051 | accountLevels->putstr(accountLevels, "-100", "validated"); |
8010 | accountLevels->putstr(accountLevels, "-50", "vouched for"); | 8052 | accountLevels->putstr(accountLevels, "-50", "vouched for"); |