Browse Source

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

release0.1.5
Georg Hopp 12 years ago
parent
commit
8d7ed2cdaa
  1. 9
      assets/js/session.js
  2. 1
      src/application/adapter/http/update.c
  3. 4
      src/application/application.c
  4. 6
      src/application/login.c
  5. 3
      src/auth/ldap.c
  6. 3
      src/session/session.c
  7. 5
      src/storage/storage.c

9
assets/js/session.js

@ -28,8 +28,15 @@ Session.prototype.loadJSON = function(data)
this.firstname = data.firstname; this.firstname = data.firstname;
this.surname = data.surname; this.surname = data.surname;
name = " ";
this.eSid.empty().append(this.id); this.eSid.empty().append(this.id);
$("#main p:eq(1) span:eq(0)").empty().append(" " + this.firstname + " " + this.surname);
if ('(null)' == this.firstname || '(null)' == this.surname) {
name += this.email;
} else {
name += this.firstname + " " + this.surname;
}
$("#main p:eq(1) span:eq(0)").empty().append(name);
this.draw(); this.draw();
if (0 < this.timeleft) if (0 < this.timeleft)

1
src/application/adapter/http/update.c

@ -223,6 +223,7 @@ signupAdapter(Application application, HttpWorker worker, Session session)
} }
delete(credential); delete(credential);
delete(user);
} }

4
src/application/application.c

@ -71,10 +71,6 @@ applicationDtor(void * _this)
delete(this->active_sessions); delete(this->active_sessions);
for (i=0; i<this->nauth; i++) {
delete(this->auth[i]);
}
MEM_FREE(this->auth); MEM_FREE(this->auth);
} }

6
src/application/login.c

@ -50,11 +50,7 @@ applicationLogin(
session->user->email = CRED_PWD(credential).user; session->user->email = CRED_PWD(credential).user;
session->user->nemail = &CRED_PWD(credential).nuser; session->user->nemail = &CRED_PWD(credential).nuser;
if (NULL == userLoad(session->user, this->users)) {
session->user->email = NULL;
session->user->nemail = NULL;
}
userLoad(session->user, this->users);
break; break;
default: default:

3
src/auth/ldap.c

@ -111,7 +111,8 @@ authLdapAuthenticate(void * _this, Credential cred)
return TRUE; return TRUE;
} }
fprintf(stderr, "%s\n", ldap_err2string(ldap_err));
//fprintf(stderr, "%s\n", ldap_err2string(ldap_err));
// @TODO do error logging instead.
return FALSE; return FALSE;
} }

3
src/session/session.c

@ -56,6 +56,9 @@ static
void void
sessionDtor(void * _this) sessionDtor(void * _this)
{ {
Session this = _this;
delete(this->user);
} }
static static

5
src/storage/storage.c

@ -60,7 +60,10 @@ storageDtor(void * _this)
Storage this = _this; Storage this = _this;
if (NULL != this->db_name) MEM_FREE(this->db_name); if (NULL != this->db_name) MEM_FREE(this->db_name);
if (NULL != this->gdbm) gdbm_close(this->gdbm);
if (NULL != this->gdbm) {
gdbm_close(this->gdbm);
this->gdbm = NULL;
}
} }
INIT_IFACE(Class, storageCtor, storageDtor, NULL); INIT_IFACE(Class, storageCtor, storageDtor, NULL);

Loading…
Cancel
Save