Merge lp:~salgado/launchpad/remove-changepassword-page into lp:launchpad/db-devel

Proposed by Guilherme Salgado
Status: Merged
Approved by: Gary Poster
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~salgado/launchpad/remove-changepassword-page
Merge into: lp:launchpad/db-devel
Diff against target: 152 lines (+8/-64)
3 files modified
lib/lp/registry/browser/configure.zcml (+0/-6)
lib/lp/registry/browser/person.py (+5/-58)
lib/lp/registry/interfaces/person.py (+3/-0)
To merge this branch: bzr merge lp:~salgado/launchpad/remove-changepassword-page
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) release-critical Approve
Gary Poster (community) Approve
Review via email: mp+20750@code.launchpad.net

Description of the change

Remove the +changepassword page

Now we're an OpenID consumer, so users should be changing their password
on the OP.

--
Guilherme Salgado <email address hidden>

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Looks good. Thank you, Salgado.

You have already responded in r9076 to the following request from IRC, which I include here for completeness.

"""
do we have a bug for removing CIP? If not, please create one, and then add the fact that we need to remove IPersonChangePassword to the bug description, and then make a reference to that bug in the XXX in lib/lp/registry/interfaces/person.py, and then add an "improvement" card for removing CIP to the kanban board in the bug grabbag referring to the bug to remove CIP.
"""

Gary

review: Approve
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

Land this on production-devel for a regular CP.

review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2010-02-19 11:55:02 +0000
+++ lib/lp/registry/browser/configure.zcml 2010-03-05 14:53:30 +0000
@@ -790,12 +790,6 @@
790 permission="zope.Public"790 permission="zope.Public"
791 template="../templates/person-claim.pt"/>791 template="../templates/person-claim.pt"/>
792 <browser:page792 <browser:page
793 name="+changepassword"
794 for="lp.registry.interfaces.person.IPerson"
795 class="lp.registry.browser.person.PersonChangePasswordView"
796 permission="launchpad.Edit"
797 template="../../app/templates/generic-edit.pt"/>
798 <browser:page
799 name="+editlanguages"793 name="+editlanguages"
800 for="lp.registry.interfaces.person.IPerson"794 for="lp.registry.interfaces.person.IPerson"
801 class="lp.registry.browser.person.PersonLanguagesView"795 class="lp.registry.browser.person.PersonLanguagesView"
802796
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2010-02-25 23:29:29 +0000
+++ lib/lp/registry/browser/person.py 2010-03-05 14:53:30 +0000
@@ -20,7 +20,6 @@
20 'PersonAssignedBugTaskSearchListingView',20 'PersonAssignedBugTaskSearchListingView',
21 'PersonBrandingView',21 'PersonBrandingView',
22 'PersonBugsMenu',22 'PersonBugsMenu',
23 'PersonChangePasswordView',
24 'PersonClaimView',23 'PersonClaimView',
25 'PersonCodeOfConductEditView',24 'PersonCodeOfConductEditView',
26 'PersonCommentedBugTaskSearchListingView',25 'PersonCommentedBugTaskSearchListingView',
@@ -149,7 +148,6 @@
149from canonical.launchpad.interfaces.gpghandler import (148from canonical.launchpad.interfaces.gpghandler import (
150 GPGKeyNotFoundError, IGPGHandler)149 GPGKeyNotFoundError, IGPGHandler)
151from lp.services.worlddata.interfaces.language import ILanguageSet150from lp.services.worlddata.interfaces.language import ILanguageSet
152from canonical.launchpad.interfaces.launchpad import IPasswordEncryptor
153from canonical.launchpad.interfaces.logintoken import ILoginTokenSet151from canonical.launchpad.interfaces.logintoken import ILoginTokenSet
154from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet152from canonical.launchpad.interfaces.oauth import IOAuthConsumerSet
155from lp.blueprints.interfaces.specification import SpecificationFilter153from lp.blueprints.interfaces.specification import SpecificationFilter
@@ -165,9 +163,9 @@
165from lp.registry.interfaces.mailinglistsubscription import (163from lp.registry.interfaces.mailinglistsubscription import (
166 MailingListAutoSubscribePolicy)164 MailingListAutoSubscribePolicy)
167from lp.registry.interfaces.person import (165from lp.registry.interfaces.person import (
168 INewPerson, IPerson, IPersonChangePassword, IPersonClaim,166 INewPerson, IPerson, IPersonClaim, IPersonSet, ITeam, ITeamReassignment,
169 IPersonSet, ITeam, ITeamReassignment, PersonCreationRationale,167 PersonCreationRationale, PersonVisibility, TeamMembershipRenewalPolicy,
170 PersonVisibility, TeamMembershipRenewalPolicy, TeamSubscriptionPolicy)168 TeamSubscriptionPolicy)
171from lp.registry.interfaces.poll import IPollSet, IPollSubset169from lp.registry.interfaces.poll import IPollSet, IPollSubset
172from lp.registry.interfaces.ssh import ISSHKeySet, SSHKeyType170from lp.registry.interfaces.ssh import ISSHKeySet, SSHKeyType
173from lp.registry.interfaces.teammembership import (171from lp.registry.interfaces.teammembership import (
@@ -887,12 +885,6 @@
887 return Link(target, text, icon='edit')885 return Link(target, text, icon='edit')
888886
889 @enabled_with_permission('launchpad.Edit')887 @enabled_with_permission('launchpad.Edit')
890 def editpassword(self):
891 target = '+changepassword'
892 text = 'Change your password'
893 return Link(target, text, icon='edit')
894
895 @enabled_with_permission('launchpad.Edit')
896 def edit(self):888 def edit(self):
897 target = '+edit'889 target = '+edit'
898 text = 'Change details'890 text = 'Change details'
@@ -917,7 +909,7 @@
917 facet = 'overview'909 facet = 'overview'
918 links = ['edit', 'branding', 'common_edithomepage',910 links = ['edit', 'branding', 'common_edithomepage',
919 'editemailaddresses', 'editlanguages', 'editwikinames',911 'editemailaddresses', 'editlanguages', 'editwikinames',
920 'editircnicknames', 'editjabberids', 'editpassword',912 'editircnicknames', 'editjabberids',
921 'editsshkeys', 'editpgpkeys', 'editlocation', 'memberships',913 'editsshkeys', 'editpgpkeys', 'editlocation', 'memberships',
922 'codesofconduct', 'karma', 'administer', 'administer_account',914 'codesofconduct', 'karma', 'administer', 'administer_account',
923 'projects', 'activate_ppa', 'maintained',915 'projects', 'activate_ppa', 'maintained',
@@ -1093,11 +1085,6 @@
1093 text = 'OpenPGP Keys'1085 text = 'OpenPGP Keys'
1094 return Link(target, text)1086 return Link(target, text)
10951087
1096 def passwords(self):
1097 target = '+changepassword'
1098 text = 'Passwords'
1099 return Link(target, text)
1100
11011088
1102class TeamMenuMixin(PPANavigationMenuMixIn, CommonMenuLinks):1089class TeamMenuMixin(PPANavigationMenuMixIn, CommonMenuLinks):
1103 """Base class of team menus.1090 """Base class of team menus.
@@ -3881,45 +3868,6 @@
3881 token.sendGPGValidationRequest(key)3868 token.sendGPGValidationRequest(key)
38823869
38833870
3884class PersonChangePasswordView(LaunchpadFormView):
3885
3886 implements(IPersonEditMenu)
3887
3888 label = "Change your password"
3889 schema = IPersonChangePassword
3890 field_names = ['currentpassword', 'password']
3891 custom_widget('password', PasswordChangeWidget)
3892
3893 @property
3894 def next_url(self):
3895 return canonical_url(self.context)
3896
3897 def validate(self, form_values):
3898 current_password = form_values.get('currentpassword')
3899 encryptor = getUtility(IPasswordEncryptor)
3900 if not encryptor.validate(current_password, self.context.password):
3901 self.setFieldError('currentpassword', _(
3902 "The provided password doesn't match your current password."))
3903 # This is not part of the widget, since the value may
3904 # be optional in some forms.
3905 new_password = self.request.form.get('field.password', '')
3906 if new_password.strip() == '':
3907 self.setFieldError('password', _(
3908 "Setting an empty password is not allowed."))
3909
3910 @action(_("Change Password"), name="submit")
3911 def submit_action(self, action, data):
3912 password = data['password']
3913 self.context.password = password
3914 self.request.response.addInfoNotification(_(
3915 "Password changed successfully"))
3916
3917 @property
3918 def cancel_url(self):
3919 """The URL that the 'Cancel' link should return to."""
3920 return canonical_url(self.context)
3921
3922
3923class BasePersonEditView(LaunchpadEditFormView):3871class BasePersonEditView(LaunchpadEditFormView):
39243872
3925 schema = IPerson3873 schema = IPerson
@@ -5898,8 +5846,7 @@
5898 usedfor = IPersonIndexMenu5846 usedfor = IPersonIndexMenu
5899 facet = 'overview'5847 facet = 'overview'
5900 title = 'Change person'5848 title = 'Change person'
5901 links = ('edit', 'administer', 'administer_account',5849 links = ('edit', 'administer', 'administer_account', 'branding')
5902 'branding', 'editpassword')
59035850
59045851
5905class ITeamIndexMenu(Interface):5852class ITeamIndexMenu(Interface):
59065853
=== modified file 'lib/lp/registry/interfaces/person.py'
--- lib/lp/registry/interfaces/person.py 2010-02-27 10:19:18 +0000
+++ lib/lp/registry/interfaces/person.py 2010-03-05 14:53:30 +0000
@@ -431,6 +431,9 @@
431 super(PersonNameField, self)._validate(input)431 super(PersonNameField, self)._validate(input)
432432
433433
434# XXX: salgado, 2010/03/05, bug=532688: This is currently used by c-i-p, so it
435# can't be removed yet. As soon as we stop using c-i-p, though, we'll be able
436# to remove this.
434class IPersonChangePassword(Interface):437class IPersonChangePassword(Interface):
435 """The schema used by Person +changepassword form."""438 """The schema used by Person +changepassword form."""
436439

Subscribers

People subscribed via source and target branches

to status/vote changes: