Show
Ignore:
Timestamp:
06/13/08 04:12:52 (7 months ago)
Author:
pacopablo
Message:
  • Apply patch from s0undt3ch removing email verification for anonymous users. Refs #442
  • Apply patch from s0undt3ch implementing functional tests and fixing existing tests. Closes #3137.

Thanks for the patches s0undt3ch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • accountmanagerplugin/trunk/acct_mgr/templates/login.html

    r3727 r3832  
    2525      </div> 
    2626 
    27       <form method="post" action=""> 
     27      <form method="post" id="acctmgr_loginform" action=""> 
    2828        <input type="hidden" name="referer" value="${referer}" /> 
    2929        <div> 
  • accountmanagerplugin/trunk/acct_mgr/templates/prefs_account.html

    r3731 r3832  
    2020    </div> 
    2121 
    22     <form method="post" action="" 
     22    <form method="post" action="" id="acctmgr_delete_account" 
    2323          onsubmit="return confirm('Are you sure you want to delete your account?');"> 
    2424      <div class="field"> 
     
    4444      <h2>Error</h2> 
    4545      <p>$account.error</p> 
    46     </div> 
    47     <div class="system-message" py:if="account.force_change_passwd"> 
    48       <h2>Immediate action required</h2> 
    49       <p>You are required to change password because of a recent 
    50         password change request.</p> 
    51       <p><strong>Please change your password now.</strong></p> 
    5246    </div> 
    5347    <p py:if="account.message">$account.message</p> 
  • accountmanagerplugin/trunk/acct_mgr/templates/register.html

    r3727 r3832  
    2424      </div> 
    2525 
    26       <form method="post" action=""> 
     26      <form method="post" id="acctmgr_registerform" action=""> 
    2727        <fieldset> 
    2828          <legend>Required</legend> 
  • accountmanagerplugin/trunk/acct_mgr/templates/reset_password.html

    r3727 r3832  
    4141      <p py:if="reset.message">$reset.message</p> 
    4242 
    43       <form method="post" action=""> 
     43      <form method="post" id="acctmgr_passwd_reset" action=""> 
    4444        <div> 
    4545          <label>Username: 
  • accountmanagerplugin/trunk/acct_mgr/templates/verify_email.html

    r3799 r3832  
    2626      is incorrect.</p> 
    2727 
    28       <form method="post" action=""
     28      <form method="post" action="" id="acctmgr_verify_email"
    2929        <div> 
    3030          <label for="token">Verification Token:</label> 
  • accountmanagerplugin/trunk/acct_mgr/tests/db.py

    r2120 r3832  
    2222    def setUp(self): 
    2323        #self.basedir = os.path.realpath(tempfile.mkdtemp()) 
    24         self.env = EnvironmentStub(
     24        self.env = EnvironmentStub(enable=['trac.*', 'acct_mgr.*']
    2525        self.env.config.set('account-manager', 'password_store', 
    2626                            'SessionStore') 
  • accountmanagerplugin/trunk/acct_mgr/tests/__init__.py

    r2120 r3832  
    1212import doctest 
    1313import unittest 
     14try: 
     15    import twill, subprocess 
     16    INCLUDE_FUNCTIONAL_TESTS = True 
     17except ImportError:     
     18    INCLUDE_FUNCTIONAL_TESTS = False 
    1419 
    1520def suite(): 
     
    1823    suite.addTest(htfile.suite()) 
    1924    suite.addTest(db.suite()) 
     25    if INCLUDE_FUNCTIONAL_TESTS: 
     26        from acct_mgr.tests.functional import suite as functional_suite 
     27        suite.addTest(functional_suite()) 
    2028    return suite 
    2129 
    2230if __name__ == '__main__': 
     31    import sys 
     32    if '--skip-functional-tests' in sys.argv: 
     33        sys.argv.remove('--skip-functional-tests') 
     34        INCLUDE_FUNCTIONAL_TESTS = False 
    2335    unittest.main(defaultTest='suite') 
  • accountmanagerplugin/trunk/acct_mgr/web_ui.py

    r3799 r3832  
    214214        data = {'delete_enabled': delete_enabled} 
    215215        force_change_password = req.session.get('force_change_passwd', False) 
    216         if force_change_password: 
    217             data['force_change_passwd'] = True 
    218216        if req.method == 'POST': 
    219217            if action == 'save': 
    220218                data.update(self._do_change_password(req)) 
    221219                if force_change_password: 
    222                     data['force_change_passwd'] = False 
    223220                    del(req.session['force_change_passwd']) 
    224221                    req.session.save() 
     222                    chrome.add_notice(req, MessageWrapper(tag( 
     223                        "Thank you for taking the time to update your password." 
     224                    ))) 
     225                    force_change_password = False 
    225226            elif action == 'delete' and delete_enabled: 
    226227                data.update(self._do_delete(req)) 
    227228            else: 
    228229                data.update({'error': 'Invalid action'}) 
     230        if force_change_password: 
     231            chrome.add_warning(req, MessageWrapper(tag( 
     232                "You are required to change password because of a recent " 
     233                "password change request. ", 
     234                tag.b("Please change your password now.")))) 
    229235        return data 
    230236 
     
    509515 
    510516    def pre_process_request(self, req, handler): 
     517        if not req.session.authenticated: 
     518            # Anonymous users should register and perms should be tweaked so 
     519            # that anonymous users can't edit wiki pages and change or create 
     520            # tickets. As such, this email verifying code won't be used on them 
     521            return handler 
    511522        if handler is not self and 'email_verification_token' in req.session: 
    512523            chrome.add_warning(req, MessageWrapper(tag.span( 
     
    518529 
    519530    def post_process_request(self, req, template, data, content_type): 
     531        if not req.session.authenticated: 
     532            # Anonymous users should register and perms should be tweaked so 
     533            # that anonymous users can't edit wiki pages and change or create 
     534            # tickets. As such, this email verifying code won't be used on them 
     535            return template, data, content_type 
    520536        if req.session.get('email') != req.session.get('email_verification_sent_to'): 
    521537            req.session['email_verification_token'] = self._gen_token()