Commit 8d7ed2cdaae90f209a4744b62327b0a6cc1c7d14
1 parent
f1a1399d
login via ldap and gdbm now works. Signup stores the user account as well as the…
… credentials but still returns a 500 and I have a memory leak most likely within the queue code. To reproduce this one has to start the server and send two requests via telnet to the server...no keep-alive just a single GET. refs #36
Showing
9 changed files
with
23 additions
and
16 deletions
... | ... | @@ -28,8 +28,15 @@ Session.prototype.loadJSON = function(data) |
28 | 28 | this.firstname = data.firstname; |
29 | 29 | this.surname = data.surname; |
30 | 30 | |
31 | + name = " "; | |
32 | + | |
31 | 33 | this.eSid.empty().append(this.id); |
32 | - $("#main p:eq(1) span:eq(0)").empty().append(" " + this.firstname + " " + this.surname); | |
34 | + if ('(null)' == this.firstname || '(null)' == this.surname) { | |
35 | + name += this.email; | |
36 | + } else { | |
37 | + name += this.firstname + " " + this.surname; | |
38 | + } | |
39 | + $("#main p:eq(1) span:eq(0)").empty().append(name); | |
33 | 40 | |
34 | 41 | this.draw(); |
35 | 42 | if (0 < this.timeleft) | ... | ... |
... | ... | @@ -50,11 +50,7 @@ applicationLogin( |
50 | 50 | session->user->email = CRED_PWD(credential).user; |
51 | 51 | session->user->nemail = &CRED_PWD(credential).nuser; |
52 | 52 | |
53 | - if (NULL == userLoad(session->user, this->users)) { | |
54 | - session->user->email = NULL; | |
55 | - session->user->nemail = NULL; | |
56 | - } | |
57 | - | |
53 | + userLoad(session->user, this->users); | |
58 | 54 | break; |
59 | 55 | |
60 | 56 | default: | ... | ... |
... | ... | @@ -111,7 +111,8 @@ authLdapAuthenticate(void * _this, Credential cred) |
111 | 111 | return TRUE; |
112 | 112 | } |
113 | 113 | |
114 | - fprintf(stderr, "%s\n", ldap_err2string(ldap_err)); | |
114 | + //fprintf(stderr, "%s\n", ldap_err2string(ldap_err)); | |
115 | + // @TODO do error logging instead. | |
115 | 116 | return FALSE; |
116 | 117 | } |
117 | 118 | ... | ... |
... | ... | @@ -45,7 +45,7 @@ httpResponseCtor(void * _this, va_list * params) |
45 | 45 | this->status = va_arg(* params, unsigned int); |
46 | 46 | reason = va_arg(* params, char *); |
47 | 47 | |
48 | - this->reason = memCalloc(1, strlen(reason)+1); | |
48 | + this->reason = memCalloc(1, strlen(reason)+1); | |
49 | 49 | strcpy(this->reason, reason); |
50 | 50 | |
51 | 51 | return 0; | ... | ... |
... | ... | @@ -40,7 +40,7 @@ static |
40 | 40 | int |
41 | 41 | sessionCtor(void * _this, va_list * params) |
42 | 42 | { |
43 | - Session this = _this; | |
43 | + Session this = _this; | |
44 | 44 | uuid_t uuid; |
45 | 45 | |
46 | 46 | this->livetime = time(NULL) + SESSION_LIVETIME; |
... | ... | @@ -56,6 +56,9 @@ static |
56 | 56 | void |
57 | 57 | sessionDtor(void * _this) |
58 | 58 | { |
59 | + Session this = _this; | |
60 | + | |
61 | + delete(this->user); | |
59 | 62 | } |
60 | 63 | |
61 | 64 | static | ... | ... |
... | ... | @@ -60,7 +60,10 @@ storageDtor(void * _this) |
60 | 60 | Storage this = _this; |
61 | 61 | |
62 | 62 | if (NULL != this->db_name) MEM_FREE(this->db_name); |
63 | - if (NULL != this->gdbm) gdbm_close(this->gdbm); | |
63 | + if (NULL != this->gdbm) { | |
64 | + gdbm_close(this->gdbm); | |
65 | + this->gdbm = NULL; | |
66 | + } | |
64 | 67 | } |
65 | 68 | |
66 | 69 | INIT_IFACE(Class, storageCtor, storageDtor, NULL); | ... | ... |
Please
register
or
login
to post a comment