Re: Darn DG login page!
Re: Darn DG login page!
- Subject: Re: Darn DG login page!
- From: David LeBer <email@hidden>
- Date: Fri, 5 Nov 2004 14:28:36 -0500
On Nov 5, 2004, at 2:07 PM, Jeremy Matthews wrote:
Ok,
I have an Entity "MemberData", that stores user ID's ("idKey")
passwords ("idPassword"); privilege level ("statusLevel") in a
separate entity "MemberDataRel" that is accessed through a to-One
relationship in MemberData. Initially, I create a user with the same
id and password "admin" in the DB, so there is something (initially)
to compare against until other users are created. I'm using a DG to
query entries against a field for ID and Password. Everything is
mapped correctly, but the code is not working....can't see why
yet...but the hours are long.
Here is the fetch specification I drew in the Entity (and selected)
for the "loginDG" DG I created. I'm thinking this is unecessary
anyways?
((idKey = $idKey) and (idPassword = $idPassword))
I'm going to ignore your code as it looks horribly broken, and without
the bindings (.wod) I cannot decipher it.
I would have to start by saying that a WoDisplayGroup is horrible
overkill for this kind of thing.
I'd do something like this:
String username; // assume exists and bound to the username WOTextField
String password; // assume exists and bound to the password WOTextField
public WOComponent checkUserLogin() { // bound to your WOSubmitButton
EOEditingContext ec = session().defaultEditingContext();
NSDictionary args = new NSDictionary(new NSArray(new String[]
{username, password}),
new NSArray(new String[] {"username", "password"}));
try {
MemberData user = (MemberData)EOUtilities.objectMatchingValues(ec,
"MemberData", args);
// Hot dang! We got ourselves a user, Do something!
// return somePageOrOther;
} catch (EOObjectNotAvailableException e) {
// No user found, do something else.
// return this.context().page();
}
}
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden