Changeset 3715 in main


Ignore:
Timestamp:
04/13/12 21:33:18 (10 years ago)
Author:
Garth Braithwaite
Message:

java and view - user profile account access UI finished.

Location:
trunk/src/main
Files:
1 added
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/org/ibisph/user/modelmap/AbstractUserStatus.java

    r3713 r3715  
    33import java.util.Date;
    44
    5 import org.dom4j.Document;
    65import org.dom4j.Element;
    76
    8 import org.ibisph.user.service.EmailVerification;
    97import org.ibisph.user.service.UserProfileXML;
    108import org.ibisph.util.XMLLib;
     
    2018  protected static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AbstractUserStatus.class);
    2119
    22   protected String captchaSessionName = AWTCaptchaServlet.CAPTCHA_SESSION_NAME;
    23 
    24   protected String userProfileModelMapKey = "UserProfile";
    25 
    2620  public static final String NO_USER_ID_STATUS              = "INVALID_USER_ID";
    2721  public static final String USER_DOES_NOT_EXIST_STATUS     = "USER_DOES_NOT_EXIST";
     
    3529  public static final String PASSWORD_EMAIL_SENT_STATUS     = "PASSWORD_EMAIL_SENT";
    3630
    37   protected UserProfileXML    userProfileService       = null;
    38   protected EmailVerification emailVerificationService = null;
     31  protected String captchaSessionName     = AWTCaptchaServlet.CAPTCHA_SESSION_NAME;
     32  protected String userProfileModelMapKey = "UserProfile";
    3933
    40   protected String defaultHTTPRequestVerificationURLPrefix = null;
     34  protected UserProfileXML userProfileService = null;
    4135
    4236
     
    4741    this.userProfileService = userProfileService;
    4842  }
    49   public void setEmailVerificationService(EmailVerification emailVerificationService) {
    50     this.emailVerificationService = emailVerificationService;
    51   }
    5243
    5344
     
    5748   * @param statusCode
    5849   */
    59   protected void setStatusCode(Element userProfileElement, String statusCode) {
    60     Element statusCodeElement = XMLLib.newElement("STATUS_CODE", statusCode);
    61     Element dateElement       = XMLLib.newElement("DATE", (new Date()).toString());
     50  protected void setStatus(Element userProfileElement, String statusCode) {
     51    Element statusCodeElement = XMLLib.newElement("STATUS", statusCode);
     52    Element dateElement       = XMLLib.newElement("UPDATED_DTS", (new Date()).toString());
    6253    XMLLib.replaceElement(userProfileElement, statusCodeElement);
    6354    XMLLib.replaceElement(userProfileElement, dateElement);
    6455  } //-------------------------- End of Method ------------------------------
    6556
    66   /**
    67    * Localizes setting of the user profile status.
    68    * @param userProfileDocument
    69    * @param statusCode
    70    */
    71   protected void setStatus(Document userProfileDocument, String statusCode) {
    72     Element statusCodeElement = XMLLib.newElement("STATUS", statusCode);
    73     Element dateElement       = XMLLib.newElement("UPDATED_DTS", (new Date()).toString());
    74     XMLLib.replaceElement(userProfileDocument, "", statusCodeElement);
    75     XMLLib.replaceElement(userProfileDocument, "", dateElement);
    76   } //-------------------------- End of Method ------------------------------
    77 
    7857} //============================ END OF CLASS =================================
    7958
  • trunk/src/main/java/org/ibisph/user/modelmap/ProcessUserRegistration.java

    r3713 r3715  
    1010
    1111import org.ibisph.modelmap.ProcessModelMapFromHTTPRequest;
     12import org.ibisph.user.service.EmailAccountAccess;
     13import org.ibisph.util.IOPath;
    1214import org.ibisph.util.StrLib;
    1315import org.ibisph.util.XMLLib;
     
    2022 */
    2123public class ProcessUserRegistration extends AbstractUserStatus implements ProcessModelMapFromHTTPRequest {
     24
     25  protected String defaultHTTPRequestVerificationURLPrefix = null;
     26  protected String verificationRequestURLPrefix = null;
     27  protected String verificationRequestURLPath   = null;
     28
     29  protected EmailAccountAccess emailVerificationService = null;
     30
     31
     32  /**
     33   * The base URL that the user request will reference in the email
     34   * message.  If this value is not set then the request path will be built
     35   * dynamically based on the requset.getContextPath concatenated with the
     36   * verificationRequestURLPath property.  The rest of the request consists
     37   * of the user's email address and the verification code value.
     38   *
     39   * @param verificationRequestURLPrefix
     40   */
     41  public void setVerificationRequestURLPrefix(String verificationRequestURLPrefix) {
     42    this.verificationRequestURLPrefix = verificationRequestURLPrefix;
     43  }
     44
     45  public void setEmailVerificationService(EmailAccountAccess emailVerificationService) {
     46    this.emailVerificationService = emailVerificationService;
     47  }
     48
     49  /**
     50   * The middle portion of the URL that the verify user request will be included
     51   * in the email message.  If the verificationRequestURLPrefix value is not set
     52   * then the request path will be built dynamically based on the requset.getContextPath
     53   * concatenated with this value.  The rest of the request consists of the user's
     54   * email address and the verification code value.
     55   *
     56   * @param verificationRequestURLPath
     57   */
     58  public void setVerificationRequestURLPath(String verificationRequestURLPath) {
     59    this.verificationRequestURLPath = verificationRequestURLPath;
     60  }
    2261
    2362  //------------------------ M A I N   R E Q U E S T   M O D E L   M E T H O D
     
    3675
    3776    String id = XMLLib.getText(userProfileElement, "ID");
    38 
    3977    if(!StrLib.isSomething(id)) {
    40       logger.error(".processModelMap - NO USER ID.  User's IP: {}", request.getRemoteAddr());
    41       setStatusCode(userProfileElement, AbstractUserStatus.NO_USER_ID_STATUS);
     78      logger.warn(".processModelMap - NO USER ID.  User's IP: {}", request.getRemoteAddr());
     79      setStatus(userProfileElement, AbstractUserStatus.NO_USER_ID_STATUS);
    4280      return;
    4381    }
     
    4684    Document userProfile = this.userProfileService.getUser(id);
    4785    if(null != userProfile) {
    48       logger.error(".processModelMap - USER ALREADY EXISTS.  Email Address: {}, User's IP: {}", id, request.getRemoteAddr());
    49       setStatusCode(userProfileElement, AbstractUserStatus.USER_PROFILE_EXISTS_STATUS);
     86      logger.warn(".processModelMap - USER ALREADY EXISTS.  User's ID: {}, User's IP: {}", id, request.getRemoteAddr());
     87      setStatus(userProfileElement, AbstractUserStatus.USER_PROFILE_EXISTS_STATUS);
    5088      return;
    5189    }
     
    5593    String userProfileCaptcha = XMLLib.getText(userProfileElement, "CAPTCHA");
    5694    if((null == userSessionCaptcha) || (null == userProfileCaptcha) || !userProfileCaptcha.equals(userSessionCaptcha)) {
    57       logger.error(".processModelMap - INVALID CAPTCHA.  Email Address: {}, User's IP: {}", id, request.getRemoteAddr());
    58       setStatusCode(userProfileElement, AbstractUserStatus.INVALID_CAPTCHA_STATUS);
     95      logger.info(".processModelMap - INVALID CAPTCHA.  User's ID: {}, User's IP: {}", id, request.getRemoteAddr());
     96      setStatus(userProfileElement, AbstractUserStatus.INVALID_CAPTCHA_STATUS);
    5997      return;
    6098    }
     
    63101    String emailAddress = XMLLib.getText(userProfileElement, "EMAIL_ADDRESS");
    64102    if(!StrLib.isSomething(emailAddress)) {
    65       logger.error(".processModelMap - MISSING EMAIL ADDRESS, User's IP: {}", request.getRemoteAddr());
    66       setStatusCode(userProfileElement, AbstractUserStatus.INVALID_EMAIL_ADDRESS_STATUS);
     103      logger.warn(".processModelMap - MISSING EMAIL ADDRESS, User's IP: {}", request.getRemoteAddr());
     104      setStatus(userProfileElement, AbstractUserStatus.INVALID_EMAIL_ADDRESS_STATUS);
    67105      return;
    68106    }
    69107
    70     String verificationCode = request.getSession().getId();
     108    String verificationValue = request.getSession().getId();
     109    if(sendVerificationEmail(request, userProfileElement, id, emailAddress, verificationValue)) {
     110      // if here then all was normal.  set the status code.
     111      Element verificationElement = XMLLib.newElement("VERIFICATION", verificationValue);
     112      XMLLib.replaceElement(userProfileElement, verificationElement);
     113      setStatus(userProfileElement, AbstractUserStatus.VERIFICATION_EMAIL_SENT_STATUS);
     114      this.userProfileService.saveUser(userProfileDocument);
     115    }
     116
     117  } //-------------------------- End of Method ------------------------------
     118
     119
     120  /**
     121   * Localized code for sending the verification email.
     122   * @param request
     123   * @param userProfileElement
     124   * @param id
     125   * @param emailAddress
     126   * @param verificationValue
     127   * @return
     128   */
     129  protected boolean sendVerificationEmail(
     130    HttpServletRequest request,
     131    Element userProfileElement,
     132    String id,
     133    String emailAddress,
     134    String verificationValue
     135  ) {
    71136    try {
    72       if(!StrLib.isSomething(defaultHTTPRequestVerificationURLPrefix)) {
     137      // if the default url is not set (first time through), then get the value
     138      // from the request and set it for future use.
     139      if(!StrLib.isSomething(this.defaultHTTPRequestVerificationURLPrefix)) {
    73140        String s = request.getRequestURL().toString();
    74141        this.defaultHTTPRequestVerificationURLPrefix =
    75142          s.substring(0, s.indexOf(request.getServletPath()));
    76143      }
    77       request.getRequestURL();
    78       emailVerificationService.sendEmailMessage(
     144      String urlPrefix = this.verificationRequestURLPrefix;
     145      if(!StrLib.isSomething(urlPrefix)) urlPrefix = IOPath.concat(
    79146        this.defaultHTTPRequestVerificationURLPrefix,
     147        this.verificationRequestURLPath, "/"
     148      );
     149
     150      String urlSuffix       = IOPath.concat(id, verificationValue, "/");
     151      String verificationURL = IOPath.concat(urlPrefix, urlSuffix, "/");
     152      emailVerificationService.sendMergedEmailMessage(
    80153        emailAddress,
    81         verificationCode
     154        verificationURL
    82155      );
    83156    }
    84157    catch(AddressException ae) {
    85       logger.error(".processModelMap - Email Address error, Address: {}", emailAddress);
    86       setStatusCode(userProfileElement, AbstractUserStatus.INVALID_EMAIL_ADDRESS_STATUS);
    87       return;
     158      logger.warn(".processModelMap - Email Address error, Address: {}", emailAddress);
     159      setStatus(userProfileElement, AbstractUserStatus.INVALID_EMAIL_ADDRESS_STATUS);
     160      return(false);
    88161    }
    89162    catch(Exception e) {
    90163      logger.error(".processModelMap - General Email Error. Address: {}", emailAddress, e);
    91       setStatusCode(userProfileElement, AbstractUserStatus.EMAIL_ERROR_STATUS);
    92       return;
     164      setStatus(userProfileElement, AbstractUserStatus.EMAIL_ERROR_STATUS);
     165      return(false);
    93166    }
    94167
    95     // if here then all was normal.  set the status code.
    96     Element verificationElement = XMLLib.newElement("VERIFICATION", verificationCode);
    97     XMLLib.replaceElement(userProfileElement, verificationElement);
    98     setStatusCode(userProfileElement, AbstractUserStatus.VERIFICATION_EMAIL_SENT_STATUS);
    99     this.userProfileService.saveUser(userProfileDocument);
    100   } //-------------------------- End of Method ------------------------------
     168    return(true);
     169} //-------------------------- End of Method ------------------------------
     170
    101171
    102172} //============================ END OF CLASS =================================
  • trunk/src/main/java/org/ibisph/user/modelmap/SendAccess.java

    r3713 r3715  
    11package org.ibisph.user.modelmap;
    22
    3 import java.util.Date;
    43import java.util.Map;
    54
     
    1110
    1211import org.ibisph.modelmap.ProcessModelMapFromHTTPRequest;
    13 import org.ibisph.user.service.EmailVerification;
    14 import org.ibisph.user.service.UserProfileXML;
     12import org.ibisph.user.service.EmailAccountAccess;
    1513import org.ibisph.util.StrLib;
    1614import org.ibisph.util.XMLLib;
    17 import org.ibisph.web.servlet.AWTCaptchaServlet;
    1815
    1916
     
    2320 * @author Garth Braithwaite, STG
    2421 */
    25 public class SendAccess extends AbstractUserStatus implements ProcessModelMapFromHTTPRequest {
     22public class SendAccess extends ProcessUserRegistration implements ProcessModelMapFromHTTPRequest {
    2623
     24  protected EmailAccountAccess emailPasswordService = null;
     25
     26
     27  public void setEmailPasswordService(EmailAccountAccess emailVerificationService) {
     28    this.emailPasswordService = emailVerificationService;
     29  }
     30
     31 
    2732  //------------------------ M A I N   R E Q U E S T   M O D E L   M E T H O D
    2833
     
    4247    String id = XMLLib.getText(userProfileElement, "ID");
    4348    if(!StrLib.isSomething(id)) {
    44       setStatusCode(userProfileElement, AbstractUserStatus.NO_USER_ID_STATUS);
     49      setStatus(userProfileElement, AbstractUserStatus.NO_USER_ID_STATUS);
    4550      return;
    4651    }
     
    5055    String userProfileCaptcha = XMLLib.getText(userProfileElement, "CAPTCHA");
    5156    if((null == userSessionCaptcha) || (null == userProfileCaptcha) || !userProfileCaptcha.equals(userSessionCaptcha)) {
    52       logger.error(".processModelMap - INVALID CAPTCHA.  Email Address: {}, User's IP: {}", id, request.getRemoteAddr());
    53       setStatusCode(userProfileElement, AbstractUserStatus.INVALID_CAPTCHA_STATUS);
     57      logger.info(".processModelMap - INVALID CAPTCHA.  User's ID: {}, User's IP: {}", id, request.getRemoteAddr());
     58      setStatus(userProfileElement, AbstractUserStatus.INVALID_CAPTCHA_STATUS);
    5459      return;
    5560    }
     
    5863    Document userProfile = this.userProfileService.getUser(id);
    5964    if(null == userProfile) {
    60       logger.error(".processModelMap - USER DOES NOT EXIST.  Email Address: {}, User's IP: {}", id, request.getRemoteAddr());
    61       setStatusCode(userProfileElement, AbstractUserStatus.USER_DOES_NOT_EXIST_STATUS);
     65      logger.warn(".processModelMap - USER DOES NOT EXIST.  User's ID: {}, User's IP: {}", id, request.getRemoteAddr());
     66      setStatus(userProfileElement, AbstractUserStatus.USER_DOES_NOT_EXIST_STATUS);
    6267      return;
    6368    }
     
    6570    // if here then check the status.  If verified then send the password else
    6671    // send the verify email.
    67     String userStatus = XMLLib.getText(userProfileElement, "STATUS");
    68     if(userStatus.equals(AbstractUserStatus.REGISTRATION_VERIFIED_STATUS)) {
    69 // try catch to send password...
    70       logger.error(".processModelMap - PASSWORD EMAILED.  Email Address: {}, User's IP: {}", id, request.getRemoteAddr());
    71       setStatusCode(userProfileElement, AbstractUserStatus.PASSWORD_EMAIL_SENT_STATUS);
    72       return;
     72    userProfileElement  = userProfile.getRootElement();
     73    String userStatus   = XMLLib.getText(userProfileElement, "STATUS");
     74    String emailAddress = XMLLib.getText(userProfileElement, "EMAIL_ADDRESS");
     75    if(AbstractUserStatus.REGISTRATION_VERIFIED_STATUS.equals(userStatus)) {
     76      String password = XMLLib.getText(userProfileElement, "PASSWORD");
     77      try {
     78        emailPasswordService.sendMergedEmailMessage(
     79          emailAddress,
     80          password
     81        );
     82      }
     83      catch(AddressException ae) {
     84        logger.warn(".processModelMap - Email Address error, Address: {}", emailAddress);
     85        setStatus(userProfileElement, AbstractUserStatus.INVALID_EMAIL_ADDRESS_STATUS);
     86        return;
     87      }
     88      catch(Exception e) {
     89        logger.error(".processModelMap - General Email Error. Address: {}", emailAddress, e);
     90        setStatus(userProfileElement, AbstractUserStatus.EMAIL_ERROR_STATUS);
     91        return;
     92      }
     93     
     94      logger.info(".processModelMap - PASSWORD EMAILED.  Email Address: {}, User's IP: {}", emailAddress, request.getRemoteAddr());
     95      setStatus(userProfileElement, AbstractUserStatus.PASSWORD_EMAIL_SENT_STATUS);
    7396    }
    7497
    75  // try catch to send verify email...
     98    // else send the verification
     99    else {
     100      String verificationValue = XMLLib.getText(userProfileElement, "VERIFICATION");
     101      sendVerificationEmail(request, userProfileElement, id, emailAddress, verificationValue);
     102      setStatus(userProfileElement, AbstractUserStatus.VERIFICATION_EMAIL_SENT_STATUS);
     103    }
    76104   
    77105  } //-------------------------- End of Method ------------------------------
  • trunk/src/main/java/org/ibisph/user/modelmap/VerifyUserRegistration.java

    r3713 r3715  
    77
    88import org.dom4j.Document;
     9import org.dom4j.Element;
    910
    1011import org.ibisph.modelmap.GetModelMapFromHTTPRequest;
     
    3435    String userID = IOPath.getFilename(path);
    3536    Document userProfileDocument = this.userProfileService.getUser(userID);
    36     String userVerificationValue = XMLLib.getText(userProfileDocument, "/USER/VERIFICATION");
     37    Element  userElement = userProfileDocument.getRootElement();
     38    String userVerificationValue = XMLLib.getText(userElement, "VERIFICATION");
    3739
    3840    if(!StrLib.isSomething(userID)) {
    3941      logger.error(".processModelMap - INVALID USER ID.  User's IP: {}", request.getRemoteAddr());
    40       userProfileDocument = XMLLib.newDocument("USER");
    41       setStatus(userProfileDocument, AbstractUserStatus.NO_USER_ID_STATUS);
     42      userElement = XMLLib.newElement("USER");
     43      userProfileDocument = XMLLib.newDocument(userElement);
     44      setStatus(userElement, AbstractUserStatus.NO_USER_ID_STATUS);
    4245    }
    4346
    4447    else if((null == requestVerificationValue) || (null == userVerificationValue) || !requestVerificationValue.equals(userVerificationValue)) {
    4548      logger.error(".processModelMap - INVALID VERFICATION.  Email Address: {}, User's IP: {}", userID, request.getRemoteAddr());
    46       setStatus(userProfileDocument, AbstractUserStatus.INVALID_VERIFICATION_STATUS);
     49      setStatus(userElement, AbstractUserStatus.INVALID_VERIFICATION_STATUS);
    4750    }
    4851
    4952    else {
    5053      // if here then verified.  set the status, save the user, and return.
    51       setStatus(userProfileDocument, AbstractUserStatus.REGISTRATION_VERIFIED_STATUS);
     54      setStatus(userElement, AbstractUserStatus.REGISTRATION_VERIFIED_STATUS);
    5255      this.userProfileService.saveUser(userProfileDocument);
    5356    }
  • trunk/src/main/java/org/ibisph/user/service/UserProfileXML.java

    r3706 r3715  
    1111/**
    1212 * Provides basic User Profile related helpers.  This includes XML file DAO
    13  * to load and save,
     13 * to load and save.
    1414 *
    1515 * @author Garth Braithwaite, STG
  • trunk/src/main/java/org/ibisph/user/springsecurity/XMLUserDetailsService.java

    r3535 r3715  
    1111import org.springframework.security.core.userdetails.UserDetailsService;
    1212import org.springframework.security.core.userdetails.UsernameNotFoundException;
     13import org.springframework.security.authentication.LockedException;
    1314
    1415import org.ibisph.databean.DataBean;
    1516import org.ibisph.user.databean.RoleAuthority;
    1617import org.ibisph.user.databean.UserRole;
     18import org.ibisph.user.modelmap.AbstractUserStatus;
    1719import org.ibisph.util.IOPath;
    1820import org.ibisph.util.XMLLib;
     
    112114      throw new UsernameNotFoundException(
    113115        "IBIS-PH UserDetails.loadUserByUsername - General Exception.  Exception Message: " +e.getLocalizedMessage());
     116    }
     117
     118    String verifiedStatus = XMLLib.getText(userDocument, "/USER/STATUS");
     119    if(!AbstractUserStatus.REGISTRATION_VERIFIED_STATUS.equals(verifiedStatus)) {
     120      throw new LockedException("Registration not verified.");
    114121    }
    115122
  • trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/user.xml

    r3713 r3715  
    114114            <property name="session">
    115115                        <bean class="org.springframework.jndi.JndiObjectFactoryBean">
     116<property name="jndiName" value="mail/doh_ibisph"/>
     117<!--
    116118                                <property name="jndiName" value="mail/doh_ibisph"/>
     119-->
    117120                                <property name="resourceRef" value="true"/>
    118121                        </bean>
     
    151154                <property name="HTTPRequestParameterNameToXMLElementNameList">
    152155                        <list>
    153                                 <bean class="org.ibisph.web.HTTPRequestParameterNameToXMLElementName"><constructor-arg value="emailAddress"/>    <constructor-arg value="ID"/></bean>
    154                                 <bean class="org.ibisph.web.HTTPRequestParameterNameToXMLElementName"><constructor-arg value="emailAddress"/>    <constructor-arg value="EMAIL_ADDRESS"/></bean>
    155                                 <bean class="org.ibisph.web.HTTPRequestParameterNameToXMLElementName"><constructor-arg value="captcha"/>         <constructor-arg value="CAPTCHA"/></bean>
    156                         </list>
    157                 </property>
    158         </bean>
    159 
    160         <bean id="User.EmailVerification.Service" class="org.ibisph.user.service.EmailVerification">
     156                                <bean class="org.ibisph.web.HTTPRequestParameterNameToXMLElementName"><constructor-arg value="userID"/> <constructor-arg value="ID"/></bean>
     157                                <bean class="org.ibisph.web.HTTPRequestParameterNameToXMLElementName"><constructor-arg value="userID"/> <constructor-arg value="EMAIL_ADDRESS"/></bean>
     158                                <bean class="org.ibisph.web.HTTPRequestParameterNameToXMLElementName"><constructor-arg value="captcha"/><constructor-arg value="CAPTCHA"/></bean>
     159                        </list>
     160                </property>
     161        </bean>
     162
     163        <bean id="User.EmailVerification.Service" class="org.ibisph.user.service.EmailAccountAccess">
    161164                <property name="javaMailSender"  ref="User.MailSender"/>
    162165                <property name="mailMessageFrom" value="user.verification@ibisph.org"/>
    163                 <property name="mailSubject"     value="User Account Verification"/>
    164                 <property name="mailMessageVerificationRequestURLSearchReplaceSignature" value="[URL_SearchSignature]"/>
     166                <property name="mailSubject"     value="IBIS-PH User Account Verification"/>
     167                <property name="mailMessageSearchReplaceSignature" value="[URL_SearchSignature]"/>
    165168                <property name="mailMessageHTML">
    166169                        <value><![CDATA[
     
    170173                                        <head>
    171174                                                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    172                                                 <title>Verification Email</title>
     175                                                <title>IBIS-PH Account Verification Email</title>
    173176                                        </head>
    174177                                <body>
    175                                                 To complete your account registration you must verify your
    176                                                 email by clicking on the <a href="[URL_SearchSignature]">
    177                                                 Activate Your Account</a> link.
     178                                                <h1>IBIS-PH User Registration Account Verification</h1>
     179                                                Your email address was entered into the IBIS-PH website
     180                                                as part of a self user registration process.  Before you
     181                                                can login and start using this account you must complete
     182                                                your account registration by verifying that this is your
     183                                                email address.  To verify simply click on the <a href="[URL_SearchSignature]">
     184                                                Activate Your Account</a> link. 
     185                                                <br/><br/>
     186
     187                                                NOTE: By activating your account you agree to all the
     188                                                usage terms and conditions for the Health Department.
     189                                                Your email address will NOT be given to any government
     190                                                agency or shared with any outside entity.  This account
     191                                                is simply used as a convience mechanism for you to be
     192                                                able to store and retrieve saved dataset queries. 
     193                                                <br/><br/>
     194
     195                                                If you have forgotten your password you must first verify
     196                                                your account via the above link.  Once verified you can
     197                                                request that your password be emailed to you.
     198                                                <br/><br/>
     199
     200                                                If you did NOT register for an account please notify
     201                                                our system administrator and report this issue.
    178202                                        </body>
    179203                                </html>
    180204                        ]]></value>
    181205                </property>
    182                 <property name="verificationRequestURLPath" value="verify/user/registration"/>
     206        </bean>
     207
     208        <bean id="User.EmailPassword.Service" class="org.ibisph.user.service.EmailAccountAccess">
     209                <property name="javaMailSender"  ref="User.MailSender"/>
     210                <property name="mailMessageFrom" value="user.password@ibisph.org"/>
     211                <property name="mailSubject"     value="Your IBIS-PH Account Password"/>
     212                <property name="mailMessageSearchReplaceSignature" value="[Password_SearchReplaceSignature]"/>
     213                <property name="mailMessageHTML">
     214                        <value><![CDATA[
     215                                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     216                                        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     217                                <html>
     218                                        <head>
     219                                                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     220                                                <title>IBIS-PH Password</title>
     221                                        </head>
     222                                <body>
     223                                                <h1>IBIS-PH User Password Reminder</h1>
     224                                                The password you entered when you registered for your
     225                                                IBIS-PH account is shown below.
     226                                                <br/><br/>
     227
     228                                                <h2>Password: [Password_SearchReplaceSignature]</h2>
     229                                                <br/><br/>
     230
     231                                                If you did NOT register for an account or is you did not
     232                                                request your password to be emailed to you please report
     233                                                this to the system administrator.
     234                                        </body>
     235                                </html>
     236                        ]]></value>
     237                </property>
    183238        </bean>
    184239
     
    206261                <property name="userProfileService"     ref="User.XML.Service"/>
    207262                <property name="emailVerificationService" ref="User.EmailVerification.Service"/>
     263                <property name="verificationRequestURLPath" value="verify/user/registration"/>
    208264        </bean>
    209265
     
    227283
    228284        <bean id="User.SendUserAccess.ModelMap" class="org.ibisph.user.modelmap.SendAccess">
    229                 <property name="userProfileModelMapKey" ref="User.UserProfile.ModelMapKey"/>
    230                 <property name="userProfileService"     ref="User.XML.Service"/>
     285                <property name="userProfileModelMapKey"     ref="User.UserProfile.ModelMapKey"/>
     286                <property name="userProfileService"         ref="User.XML.Service"/>
     287                <property name="emailVerificationService"   ref="User.EmailVerification.Service"/>
     288                <property name="verificationRequestURLPath" value="verify/user/registration"/>
     289                <property name="emailPasswordService"       ref="User.EmailPassword.Service"/>
    231290        </bean>
    232291
  • trunk/src/main/webapps/ibisph-view/WEB-INF/jsp/access_denied.jsp

    r3710 r3715  
    5959                                <h2>
    6060                                        A problem was encountered while trying to access the application.
    61                                         Either you are not authenticated or you are not authorized for
    62                                         the requested resource or your session has timed out.
     61                                        Possible Reasons:
     62                                        <hr/>
     63                                        <ul>
     64                                                <li>Invalid login credentials (username and/or password)</li>
     65                                                <li>You are not authorized for the requested resource </li>
     66                                                <li>Your account has not been verified or activated</li>
     67                                                <li>Your session has timed out</li>
     68                                        </ul>
    6369                                </h2><br/>
    6470
  • trunk/src/main/webapps/ibisph-view/xml/user/html_content/AccountAccess.xml

    r3713 r3715  
    2929                resend your account verification email.  For this page to work you must
    3030                enter your username (the email address you used when creating the
    31                 account) and the associated captcha. 
     31                account) and the associated captcha.  If you have not verified your
     32                account the verification email will be sent.  If you are verified then
     33                this access account request will email you your password to your
     34                supplied email address.
    3235                <br/><br/>
    3336
  • trunk/src/main/webapps/ibisph-view/xml/user/html_content/Status.xml

    r3713 r3715  
    2626                        You account must be activated before you can use it and the only
    2727                        way to activate is via your clicking on a verification link that
    28                         is contained within an email set to you. 
     28                        is contained within an email that is sent to you after submitting
     29                        a valid New User Registration request. 
    2930                        <br/><br/>
    3031
     
    4041
    4142                        Please press your browser's back button and correct the error.  If
    42                         you have forgotton your password please visit the <a ibis:href="user/AccountAccess.html">Account
     43                        you have forgotten your password please visit the <a ibis:href="user/AccountAccess.html">Account
    4344                        Access</a> page.  If you have concerns about this issue contact
    4445                        this application's system administrator to report the problem.
     
    4748                <ibis:ContiditionalSection id="INVALID_CAPTCHA">
    4849                        <h2 class="Error">Invalid Captcha Value</h2>
    49                         The email address you provided is invalid.  It must be non blank
    50                         and of the form name@some.mailserver.  Your email address is
    51                         critical as this is the mechanism which your account is activated.
    52                         You account must be activated before you can use it and the only
    53                         way to activate is via your clicking on a verification link that
    54                         is contained within an email set to you. 
     50                        The "captcha" value you entered does not match.  Captchas are used
     51                        to make sure that an actual human is making a request vs an unauthorized
     52                        computer application/system.  To get a new value to show,
     53                        simply refresh the page until you see a value that you understand
     54                        and can enter.  If you feel you have entered a valid value please
     55                        contact this application's system administrator to report the issue.
     56                </ibis:ContiditionalSection>
     57
     58                <ibis:ContiditionalSection id="INVALID_EMAIL_ADDRESS">
     59                        <h2 class="Error">Invalid Email Address</h2>
     60                        The email address you provided appears to be invalid.  Your email
     61                        address is critical as this is the mechanism which your account is
     62                        activated.  You account must be activated before you can use it and
     63                        the only way to activate is via your clicking on a verification
     64                        link that is contained within an email that is sent to you after
     65                        submitting a valid New User Registration request. 
    5566                        <br/><br/>
    5667
     
    6071                </ibis:ContiditionalSection>
    6172
    62                 <ibis:ContiditionalSection id="INVALID_EMAIL_ADDRESS">
    63                         <h2 class="Error">Invalid Email Address</h2>
    64                 </ibis:ContiditionalSection>
    65 
    6673                <ibis:ContiditionalSection id="EMAIL_ERROR">
    6774                        <h2 class="Error">Email Error</h2>
     75                        There appears to be a problem with our email server sending an email
     76                        message to you.  This is most likely a problem with our application.
     77                        You can press your browser's back button and try it again.  If you
     78                        are still having issues please contact this application's system
     79                        administrator to make sure that this problem has been reported.
     80
     81                        <h3>We're sorry for any inconvenience and appreciate your patience
     82                                and help.
     83                        </h3>
    6884                </ibis:ContiditionalSection>
    6985
    7086                <ibis:ContiditionalSection id="VERIFICATION_EMAIL_SENT">
    7187                        <h2>Verification Email Sent</h2>
     88                        An activation email has been sent to your email address.  Please
     89                        wait a few seconds then check your inbox.  Open the message and
     90                        click on the "Activation" link contained within the message.  The
     91                        application will validate your response and if successful you will
     92                        be shown a "Verified" message.  You will then be able to login to
     93                        your account using your email and the password you specified.  Once
     94                        logged in you can then create saved query definitions and query
     95                        criteria. 
     96                        <br/><br/>
     97
     98                        If you do NOT receive an account verification email message please
     99                        check you junk email folder.  If you still do not get a message
     100                        you should check with your email provider to make sure that they
     101                        are not screening the email as junk.  If you would like your
     102                        verification email sent again please visit the <a ibis:href="user/AccountAccess.html">Account
     103                        Access</a> page. 
     104                        <br/><br/>
     105
     106                        If you have concerns about this issue contact this application's
     107                        system administrator to report the problem.
    72108                </ibis:ContiditionalSection>
    73109
    74110                <ibis:ContiditionalSection id="INVALID_VERIFICATION">
    75111                        <h2 class="Error">Invalid/Mismatched Verification</h2>
     112                        The activation value that you are trying to use does NOT match
     113                        the value associated with your user information. 
     114                        <br/><br/>
     115
     116                        If you feel that this is an error please contact our office.
    76117                </ibis:ContiditionalSection>
    77118
    78 USER_DOES_NOT_EXIST
    79 PASSWORD_EMAIL_SENT
    80                
     119                <ibis:ContiditionalSection id="USER_DOES_NOT_EXIST">
     120                        <h2 class="Error">User Does NOT Exist</h2>
     121                        The system does not have any user that matches the supplied user
     122                        name/email address.
     123                        <br/><br/>
     124
     125                        Please press your browser's back button and correct the error.  If
     126                        you have entered a valid email address and you have been shown a
     127                        status message that states that you have been sent a verification
     128                        email then please contact this application's system administrator
     129                        to report the problem. 
     130                        <br/><br/>
     131
     132                        If you did not receive a verification email or the status screen
     133                        that shows that a verification email was sent then your user
     134                        registration information was not accepted.  You can try to register
     135                        again or if you feel that this is an application error please
     136                        contact our office.
     137                </ibis:ContiditionalSection>
     138
    81139                <ibis:ContiditionalSection id="VERIFIED">
    82140                        <h2>Account Verified and Active</h2>
    83141                </ibis:ContiditionalSection>
     142
     143                <ibis:ContiditionalSection id="PASSWORD_EMAIL_SENT">
     144                        <h2>Password Email Sent</h2>
     145                        An email has been sent to your email address that contains your
     146                        password.  Please wait a few seconds then check your inbox.  If
     147                        you do NOT receive a password email message please check you junk
     148                        email folder.  If you still do not get a message you should check
     149                        with your email provider to make sure that they are not screening
     150                        the email as junk. 
     151                        <br/><br/>
     152
     153                        If you have concerns about this issue contact this application's
     154                        system administrator to report the problem.
     155                </ibis:ContiditionalSection>
     156
    84157        </CONTENT>
    85158</HTML_CONTENT>
  • trunk/src/main/webapps/ibisph-view/xslt/html/SiteSpecific.xslt

    r3687 r3715  
    8989                        function onLoad()
    9090                        {
    91                                 // Append the ScriptEnabled CSS class name to the page container
    92                                 // element.  This allows menus to work if scripting is disabled
    93                                 // and to have a nicer more interactive feature set if scripting
    94                                 // is allowed.  Typically the ScriptEnabled class simply sets sub
    95                                 // menus to be hidden.
    96                                 (new EnhancedElement("page")).addClassName("ScriptEnabled");
    97 
    9891                                // setup the script enabled menus (adds mouse and keyboard event handlers)
    9992                                var menuControl = new ShowHideMenuControl();
     
    107100                                if(leftNavigationMenuElevator) window.onScrollEventManager.add(leftNavigationMenuElevator.windowScrollHandler);
    108101                                if(leftNavigationMenuElevator) window.onResizeEventManager.add(leftNavigationMenuElevator.windowResizeHandler);
     102
     103                                // Append the ScriptEnabled CSS class name to the page container
     104                                // element.  This allows menus to work if scripting is disabled
     105                                // and to have a nicer more interactive feature set if scripting
     106                                // is allowed.  Typically the ScriptEnabled class simply sets sub
     107                                // menus to be hidden.  This is added as the last item in the init
     108                                // script so that if there's a problem with any of the above
     109                                // script that things will not be collapsed/hidden.
     110                                (new EnhancedElement("page")).addClassName("ScriptEnabled");
    109111                        } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    110112
  • trunk/src/main/webapps/ibisph-view/xslt/html/query/definition/index/alphabetical/Page.xslt

    r3687 r3715  
    5151                </xsl:call-template>
    5252
    53                 <xsl:call-template name="QueryDefinitions.selectionListButtons"/>
     53                <xsl:if test="0 != count(//QUERY_DEFINITION)">
     54                        <xsl:call-template name="QueryDefinitions.selectionListButtons"/>
     55                </xsl:if>
    5456        </xsl:template>
    5557
Note: See TracChangeset for help on using the changeset viewer.