diff --git a/fas/fas.cfg b/fas/fas.cfg index 8942dbd..2bb9e44 100644 --- a/fas/fas.cfg +++ b/fas/fas.cfg @@ -1,5 +1,5 @@ [global] -# TODO: better namespacing (maybe fas.admingroup, etc.) +# TODO: better namespacing (maybe a [fas] section) admingroup = 'accounts' accounts_email = "nobody@fedoraproject.org" @@ -15,8 +15,8 @@ gpg_fingerprint = "C199 1E25 D00A D200 2D2E 54D1 BF7F 1647 C54E 8410" gpg_passphrase = "m00!s@ysth3c0w" gpg_keyserver = "hkp://subkeys.pgp.net" -cla_sign_group = "cla_sign" -cla_click_group = "cla_click" +cla_done_group = "cla_done" +cla_fedora_group = "cla_fedora" privileged_view_groups = "(^cla_.*)|(^fas-.*)" username_blacklist = "(.*-members)|(.*-sponsors)|(.*-administrators)|(root)|(webmaster)" @@ -32,8 +32,11 @@ openssl_l = "Raleigh" openssl_o = "Fedora Project" openssl_ou = "Upload Files" -# This is where all of your settings go for your development environment -# Settings that are the same for both development and production +# Groups that automatically grant membership to other groups +# Format: 'group1:a,b,c|group2:d,e,f' +auto_approve_groups = 'cvsextras:fedorabugs|cla_dell:cla_done|cla_fedora:cla_done|cla_redhat:cla_done|cla_ibm:cla_done' + +# This is where all of your settings go for your development environment # Settings that are the same for both development and production # (such as template engine, encodings, etc.) all go in # fas/config/app.cfg diff --git a/fas/fas/auth.py b/fas/fas/auth.py index b6b0a9f..9963b4a 100644 --- a/fas/fas/auth.py +++ b/fas/fas/auth.py @@ -69,27 +69,13 @@ def isApproved(person, group): else: return False -def signedCLAPrivs(person): +def CLADone(person): ''' Returns True if the user has completed the GPG-signed CLA ''' - cla_sign_group =config.get('cla_sign_group') + cla_done_group =config.get('cla_done_group') try: - if person.group_roles[cla_sign_group].role_status == 'approved': - return True - else: - return False - except KeyError: - return False - return False - -def clickedCLAPrivs(person): - ''' - Returns True if the user has completed the click-through CLA - ''' - cla_click_group = config.get('cla_click_group') - try: - if person.group_roles[cla_click_group].role_status == 'approved': + if person.group_roles[cla_done_group].role_status == 'approved': return True else: return False diff --git a/fas/fas/cla.py b/fas/fas/cla.py index 69001cf..e7f5785 100644 --- a/fas/fas/cla.py +++ b/fas/fas/cla.py @@ -25,9 +25,8 @@ class CLA(controllers.Controller): username = turbogears.identity.current.user_name person = People.by_username(username) - signedCLA = signedCLAPrivs(person) - clickedCLA = clickedCLAPrivs(person) - return dict(signedCLA=signedCLA, clickedCLA=clickedCLA) + cla = CLADone(person) + return dict(cla=cla) def jsonRequest(self): return 'tg_format' in cherrypy.request.params and \ @@ -53,20 +52,20 @@ class CLA(controllers.Controller): turbogears.flash(_('To sign the CLA we must have your telephone number, postal address and gpg key id. Please ensure they have been filled out')) turbogears.redirect('/user/edit/%s' % username) - if type == 'click': - # Disable click-through CLA for now - #if signedCLAPrivs(person): - # turbogears.flash(_('You have already signed the CLA, so it is unnecessary to complete the Click-through CLA.')) - # turbogears.redirect('/cla/') - # return dict() - #if clickedCLAPrivs(person): - # turbogears.flash(_('You have already completed the Click-through CLA.')) - # turbogears.redirect('/cla/') - # return dict() - turbogears.redirect('/cla/') - return dict() - elif type == 'sign': - if signedCLAPrivs(person): + # Disable click-through CLA for now + #if type == 'click': + # if signedCLAPrivs(person): + # turbogears.flash(_('You have already signed the CLA, so it is unnecessary to complete the Click-through CLA.')) + # turbogears.redirect('/cla/') + # return dict() + # if clickedCLAPrivs(person): + # turbogears.flash(_('You have already completed the Click-through CLA.')) + # turbogears.redirect('/cla/') + # return dict() + # turbogears.redirect('/cla/') + # return dict() + if type == 'sign': + if CLADone(person): turbogears.flash(_('You have already signed the CLA.')) turbogears.redirect('/cla/') return dict() @@ -92,11 +91,11 @@ class CLA(controllers.Controller): username = turbogears.identity.current.user_name person = People.by_username(username) - if signedCLAPrivs(person): + if CLADone(person): turbogears.flash(_('You have already signed the CLA.')) turbogears.redirect('/cla/') return dict() - groupname = config.get('cla_sign_group') + groupname = config.get('cla_fedora_group') group = Groups.by_name(groupname) ctx = gpgme.Context() @@ -189,41 +188,3 @@ that is associated with e-mail address %(email)s. The full signed ICLA is attach turbogears.redirect('/cla/') return dict() - @identity.require(turbogears.identity.not_anonymous()) - @error_handler(error) - # Don't expose click-through CLA for now. - #@expose(template="fas.templates.cla.index") - def click(self, agree): - '''Click-through CLA''' - username = turbogears.identity.current.user_name - person = People.by_username(username) - - if signedCLAPrivs(person): - turbogears.flash(_('You have already signed the CLA, so it is unnecessary to complete the Click-through CLA.')) - turbogears.redirect('/cla/') - return dict() - if clickedCLAPrivs(person): - turbogears.flash(_('You have already completed the Click-through CLA.')) - turbogears.redirect('/cla/') - return dict() - groupname = config.get('cla_click_group') - group = Groups.by_name(groupname) - if agree.lower() == 'i agree': - try: - person.apply(group, person) # Apply... - session.flush() - person.sponsor(group, person) # Approve... - session.flush() - except: - turbogears.flash(_("You could not be added to the '%s' group.") % group.name) - turbogears.redirect('/cla/view/click') - return dict() - else: - turbogears.flash(_("You have successfully agreed to the click-through CLA. You are now in the '%s' group.") % group.name) - turbogears.redirect('/cla/') - return dict() - else: - turbogears.flash(_("You have not agreed to the click-through CLA.") % group.name) - turbogears.redirect('/cla/view/click') - return dict() - diff --git a/fas/fas/controllers.py b/fas/fas/controllers.py index 790bd3a..d82bda7 100644 --- a/fas/fas/controllers.py +++ b/fas/fas/controllers.py @@ -72,12 +72,7 @@ class Root(controllers.RootController): def home(self): user_name = turbogears.identity.current.user_name person = People.by_username(user_name) - cla = None - cla = None - if clickedCLAPrivs(person): - cla = 'clicked' - if signedCLAPrivs(person): - cla = 'signed' + cla = CLADone(person) return dict(person=person, cla=cla) @expose(template="fas.templates.about") diff --git a/fas/fas/group.py b/fas/fas/group.py index 174af8d..d32c6b3 100644 --- a/fas/fas/group.py +++ b/fas/fas/group.py @@ -470,7 +470,7 @@ into the e-mail aliases within an hour. username = turbogears.identity.current.user_name person = People.by_username(username) if not groupname: - groupname = config.get('cla_sign_group') + groupname = config.get('cla_done_group') group = Groups.by_name(groupname) if not canViewGroup(person, group): diff --git a/fas/fas/help.py b/fas/fas/help.py index f8ba0aa..f8cdc47 100644 --- a/fas/fas/help.py +++ b/fas/fas/help.py @@ -33,7 +33,7 @@ class Help(controllers.Controller): 'group_type': ['Group Type', '''
Normally it is safe to leave this blank. Though some values include 'tracking', 'shell', 'cvs', 'git', 'hg', 'svn', and 'mtn'. This value only really matters if the group is to end up getting shell access or commit access somewhere like fedorahosted.
'''], 'group_needs_sponsor': ['Needs Sponsor', '''If your group requires sponsorship (recommended), this means that when a user is approved by a sponsor. That relationship is recorded in the account system. If user A sponsors user N, then in viewing the members of this group, people will know to contact user A about user N if something goes wrong. If this box is unchecked, this means that only approval is needed and no relationship is recorded about who did the approving
'''], 'group_self_removal': ['Self Removal', '''Should users be able to remove themselves from this group without sponsor / admin intervention? (recommended yes)
'''], - 'group_prerequisite': ['Must Belong To', '''Before a user can join this group, they must belong to the group listed in this box. This value cannot be removed without administrative intervention, only changed. Recommended values are for the 'cla_sign' group.
'''], + 'group_prerequisite': ['Must Belong To', '''Before a user can join this group, they must belong to the group listed in this box. This value cannot be removed without administrative intervention, only changed. Recommended values are for the 'cla_done' group.
'''], 'group_join_message': ['Join Message', '''This message will go out to users when they join the group. It should be informative and offer tips about what to do next. A description of the group would also be valuable here
'''], 'gencert': ['Client Side Cert', '''The client side cert is generally used to grant access to upload packages to Fedora or for other authentication purposes like with koji. If you are not a package maintainer there is no need to worry about the client side cert
'''], } diff --git a/fas/fas/templates/cla/click.html b/fas/fas/templates/cla/click.html deleted file mode 100644 index 85db7bd..0000000 --- a/fas/fas/templates/cla/click.html +++ /dev/null @@ -1,23 +0,0 @@ - - -- - ${Markup(_('There are two ways to sign the CLA. Most users will want to do a signed CLA as it will promote them to a full contributor in Fedora. The click-through CLA only grants partial access but may be preferred for those with special legal considerations. See: <a href="http://fedoraproject.org/wiki/Legal/CLAAcceptanceHierarchies">CLA Acceptance Hierarchies</a> for more information.'))} + + ${Markup(_('In order to become a full Fedora contributor, you must sign the CLA.'))}
-
+
${Markup(_('You have already sucessfully signed the <a href="%s">CLA</a>.') % tg.url('/cla/view'))}
diff --git a/fas/fas/templates/cla/view.html b/fas/fas/templates/cla/view.html index 6c2c1a5..c91a893 100644 --- a/fas/fas/templates/cla/view.html +++ b/fas/fas/templates/cla/view.html @@ -7,24 +7,11 @@${Markup(_('Use the below link to download/save the CLA as fedora-icla-%(username)s.txt, and run: <pre>gpg -as fedora-icla-%(username)s.txt</pre> After, upload fedora-icla-%(username)s.txt.asc in the form below.') % {'username': person.username})} diff --git a/fas/fas/templates/group/new.html b/fas/fas/templates/group/new.html index 6037801..f74862c 100644 --- a/fas/fas/templates/group/new.html +++ b/fas/fas/templates/group/new.html @@ -41,7 +41,7 @@
- ${_('Welcome to the Fedora Accounts System 2. Please submit bugs to https://fedorahosted.org/fedora-infrastructure/ or stop by #fedora-admin on irc.freenode.net')} + ${_('Welcome to the Fedora Accounts System 2. Please submit bugs to <a href="https://fedorahosted.org/fedora-infrastructure/">https://fedorahosted.org/fedora-infrastructure/<a> or stop by #fedora-admin on irc.freenode.net')}