aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authoronefang2020-05-18 14:22:17 +1000
committeronefang2020-05-18 14:22:17 +1000
commit0bb88e283f31125ed5b7a8787b6b84716f4a3cc2 (patch)
tree2485e85e23101f56a8d21e76c2d9753f052bab6d /src
parentVarious small cleanups. (diff)
downloadopensim-SC_OLD-0bb88e283f31125ed5b7a8787b6b84716f4a3cc2.zip
opensim-SC_OLD-0bb88e283f31125ed5b7a8787b6b84716f4a3cc2.tar.gz
opensim-SC_OLD-0bb88e283f31125ed5b7a8787b6b84716f4a3cc2.tar.bz2
opensim-SC_OLD-0bb88e283f31125ed5b7a8787b6b84716f4a3cc2.tar.xz
Show account name correctly.
Diffstat (limited to 'src')
-rw-r--r--src/sledjchisl/sledjchisl.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c
index 45e5919..f34d1a6 100644
--- a/src/sledjchisl/sledjchisl.c
+++ b/src/sledjchisl/sledjchisl.c
@@ -4562,10 +4562,6 @@ static int nameValidate(reqData *Rd, inputForm *iF, inputValue *iV)
4562 Rd->stuff->putstr(Rd->stuff, "firstName", name); 4562 Rd->stuff->putstr(Rd->stuff, "firstName", name);
4563 Rd->stuff->putstr(Rd->stuff, "lastName", s); 4563 Rd->stuff->putstr(Rd->stuff, "lastName", s);
4564 Rd->stuff->putstrf(Rd->stuff, "name", "%s %s", name, s); 4564 Rd->stuff->putstrf(Rd->stuff, "name", "%s %s", name, s);
4565// TODO - fix this, so we don't show "You are user" when we are not, but everything else still works.
4566// if ('\0' != getStrH(Rd->queries, "user")[0])
4567 if (NULL != Rd->shs.name) free(Rd->shs.name);
4568 Rd->shs.name = Rd->stuff->getstr(Rd->stuff, "name", true);
4569 } 4565 }
4570 } 4566 }
4571 } 4567 }
@@ -5195,6 +5191,7 @@ d("accountRead() UUID %s, name %s %s", uuid, first, last);
5195 5191
5196 if (0 == rt) 5192 if (0 == rt)
5197 { 5193 {
5194T("Found Lua record.");
5198 ret += 1; 5195 ret += 1;
5199 Rd->database->putstr(Rd->database, "UserAccounts.FirstName", first); 5196 Rd->database->putstr(Rd->database, "UserAccounts.FirstName", first);
5200 Rd->database->putstr(Rd->database, "UserAccounts.LastName", last); 5197 Rd->database->putstr(Rd->database, "UserAccounts.LastName", last);
@@ -5219,9 +5216,11 @@ d("accountRead() UUID %s, name %s %s", uuid, first, last);
5219// else if (rows) 5216// else if (rows)
5220 if (rows) 5217 if (rows)
5221 { 5218 {
5222 ret += rows->rows->size(rows->rows); 5219 rt = rows->rows->size(rows->rows);
5223 if (1 == ret) 5220 if (1 == rt)
5224 { 5221 {
5222 ret = rt;
5223T("Found database record.");
5225 dbPull(Rd, "UserAccounts", rows); 5224 dbPull(Rd, "UserAccounts", rows);
5226 5225
5227 char *name = xmprintf("%s %s", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName")); 5226 char *name = xmprintf("%s %s", getStrH(Rd->database, "UserAccounts.FirstName"), getStrH(Rd->database, "UserAccounts.LastName"));
@@ -5305,7 +5304,7 @@ static int accountDelSub(reqData *Rd, inputForm *iF, inputValue *iV)
5305static int accountCreateSub(reqData *Rd, inputForm *iF, inputValue *iV) 5304static int accountCreateSub(reqData *Rd, inputForm *iF, inputValue *iV)
5306{ 5305{
5307 int ret = 0; 5306 int ret = 0;
5308 char *uuid = Rd->shs.UUID, *first = getStrH(Rd->stuff, "firstName"), *last = getStrH(Rd->stuff, "lastName"); 5307 char *uuid = Rd->shs.UUID, *first = getStrH(Rd->stuff, "name"), *last = NULL;
5309 int c = accountRead(Rd, uuid, first, last); 5308 int c = accountRead(Rd, uuid, first, last);
5310 5309
5311 if (strcmp("POST", Rd->Method) == 0) 5310 if (strcmp("POST", Rd->Method) == 0)
@@ -5327,6 +5326,8 @@ static int accountCreateSub(reqData *Rd, inputForm *iF, inputValue *iV)
5327 { 5326 {
5328 Rd->stuff->putstr(Rd->stuff, "passHash", h); 5327 Rd->stuff->putstr(Rd->stuff, "passHash", h);
5329 Rd->stuff->putstr(Rd->stuff, "passSalt", salt); 5328 Rd->stuff->putstr(Rd->stuff, "passSalt", salt);
5329 if (NULL != Rd->shs.name) free(Rd->shs.name);
5330 Rd->shs.name = Rd->stuff->getstr(Rd->stuff, "name", true);
5330 free(h); 5331 free(h);
5331 Rd->shs.status = SHS_REFRESH; 5332 Rd->shs.status = SHS_REFRESH;
5332 } 5333 }