String password = getPassword(session);
if (passwordsMatch(username, password)) {
Statement stmt = con.createStatement();
/*
we delete the userverify entry so they can no longer login
but maintain the userprofile, userorders and userinfo so we can still
track orders (from userorders) while maintaining the username integrity
(i.e. after deleting a username, if somebody wants to reuse the username
they can t
** this can be alleviated by using a unique userid rather than a username
** maybe implement this in a more complete design later
*/
String sqlStmt = "delete from userverify where username= " + username +
" ";
int rs = stmt.executeUpdate(sqlStmt);
stmt.close();
if (rs != 1) {
raiseError("USERVERIFYDELETE: result rows !=1 from " + sqlStmt,
failurepage, req, res);
}
// invalidate session, return to homepage
session.invalidate();
res.callPage(successpage, req);
} else {
uidPwdError(username, password, failurepage, req, res);
}
return;
} // end delete
// update user info based on parameters in request stream
if (action.equals("update")) {
String username = getUsername(session);
String password = getPassword(session);
if (passwordsMatch(username, password)) {
Hashtable errors = validateData(req);
if (errors.isEmpty()) {
// we assume that "anything" passed in the request environment barring
the username
// which can no longer be changed, is to be updated.
// remember that password is changed via action=changepassword
String sqlStmt = "update userinfo set (first_name, last_name,
email_address, birth_date, address)=( " + req.getParameter("first_name") + " , " +
req.getParameter("last_name") + " , " + req.getParameter("email_address") + " ,date( " +
req.getParameter("birth_date") + " ), " + req.getParameter("address") + " ) where
username= " + username + " ";
Statement stmt = con.createStatement();
int rs = stmt.executeUpdate(sqlStmt);
stmt.close();
if (rs != 1) {
raiseError("USERINFOUPDATE: result rows !=1 from " + sqlStmt,
failurepage, req, res);
}
// update userprofile
sqlStmt = "update userprofile set
(as400,netfinity,ncf,nw,s390,rs6000,scalable,vm,vse,windows,other) = (";
for (int i = 0; i < profileCols.length   1; i++) {
if (req.getParameter(profileCols[i]) != null) {
sqlStmt = sqlStmt + " y ,";
} else {
sqlStmt = sqlStmt + "null,";
}
}
if (req.getParameter(profileCols[profileCols.length   1]) != null) {
154
Linux Web Hosting with WebSphere, DB2, and Domino




  

Home

About Services Network Support FAQ Order Contact
 

Linux Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved