Changeset 12816 for main/waeup.ikoba


Ignore:
Timestamp:
23 Mar 2015, 16:47:58 (10 years ago)
Author:
Henrik Bettermann
Message:

Ticket #11 compromise

Redirect to CustomerChangePasswordPage? if PasswordMandate? was used so that customers are reminded of changing the password. But we do not require a password change. Maybe customers feel comfortable with the generated password.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/browser/pages.py

    r12540 r12816  
    280280                    #      _('Your personal data record is outdated. Please update.'),
    281281                    #      type='warning')
    282                     self.redirect(self.application_url() + rel_link)
     282                    if camefrom == 'PasswordMandate':
     283                        self.redirect(
     284                            self.application_url() +
     285                            rel_link +
     286                            '/changepassword')
     287                    else:
     288                        self.redirect(self.application_url() + rel_link)
    283289                    return
    284290                if not self.camefrom:
  • main/waeup.ikoba/trunk/src/waeup/ikoba/mandates/browser.py

    r11954 r12816  
    1919"""
    2020import grok
     21from urllib import urlencode
    2122from waeup.ikoba.browser.layout import UtilityView
    2223from waeup.ikoba.interfaces import ICompany
     
    4243            return
    4344        msg = mandate.execute()
     45        self.mandate_name = mandate.__class__.__name__
    4446        self.flash(msg)
    4547        return
    4648
    4749    def render(self):
    48         self.redirect(self.url(self.context, 'login'))
     50        args = {'camefrom': self.mandate_name}
     51        self.redirect(self.url(self.context) + '/login?%s' % urlencode(args))
    4952        return
  • main/waeup.ikoba/trunk/src/waeup/ikoba/mandates/tests.py

    r11984 r12816  
    153153            % mandate.mandate_id)
    154154        # Password has been set.
    155         self.assertTrue('Password has been successfully set. Login with your new password.'
     155        self.assertTrue(
     156            'Password has been successfully set. Login with your new password.'
    156157            in self.browser.contents)
    157158        self.assertTrue(IUserAccount(customer).checkPassword('mypwd1'))
     
    159160        self.assertEqual(len(self.app['mandates'].keys()), 0)
    160161        # We redirect to login page not to the frontpage.
    161         self.assertEqual(self.browser.url, 'http://localhost/app/login')
     162        self.assertEqual(
     163            self.browser.url,
     164            'http://localhost/app/login?camefrom=PasswordMandate')
     165        # After login we redirect to the changepassword page.
     166        self.browser.getControl(name="form.login").value = customer.customer_id
     167        self.browser.getControl(name="form.password").value = 'mypwd1'
     168        self.browser.getControl("Login").click()
     169        self.assertEqual(
     170            self.browser.url,
     171            'http://localhost/app/customers/%s/changepassword'
     172            % customer.customer_id)
Note: See TracChangeset for help on using the changeset viewer.