From 904ded296973c591da04c4d0183ae23c986f1973 Mon Sep 17 00:00:00 2001
From: Mike McGrath
Date: Sat, 15 Mar 2008 17:58:30 -0500
Subject: [PATCH 1/2] added initial theme stuff
---
fas/build/lib/fas/__init__.py | 30 +
fas/build/lib/fas/auth.py | 218 ++++++
fas/build/lib/fas/cla.py | 120 ++++
fas/build/lib/fas/commands.py | 51 ++
fas/build/lib/fas/config/__init__.py | 0
fas/build/lib/fas/config/log.cfg | 29 +
fas/build/lib/fas/controllers.py | 145 ++++
fas/build/lib/fas/feeds.py | 17 +
fas/build/lib/fas/group.py | 532 ++++++++++++++
fas/build/lib/fas/help.py | 50 ++
fas/build/lib/fas/json_request.py | 73 ++
fas/build/lib/fas/model.py | 470 +++++++++++++
fas/build/lib/fas/openid_fas.py | 112 +++
fas/build/lib/fas/openssl_fas.py | 82 +++
fas/build/lib/fas/release.py | 18 +
fas/build/lib/fas/safasprovider.py | 219 ++++++
fas/build/lib/fas/templates/__init__.py | 0
fas/build/lib/fas/templates/about.html | 17 +
fas/build/lib/fas/templates/cla/__init__.py | 0
fas/build/lib/fas/templates/cla/cla.html | 82 +++
fas/build/lib/fas/templates/cla/cla.txt | 145 ++++
fas/build/lib/fas/templates/cla/index.html | 26 +
fas/build/lib/fas/templates/error.html | 25 +
fas/build/lib/fas/templates/group/__init__.py | 0
fas/build/lib/fas/templates/group/dump.txt | 3 +
fas/build/lib/fas/templates/group/edit.html | 55 ++
fas/build/lib/fas/templates/group/invite.html | 43 ++
fas/build/lib/fas/templates/group/list.html | 54 ++
fas/build/lib/fas/templates/group/new.html | 57 ++
fas/build/lib/fas/templates/group/view.html | 123 ++++
fas/build/lib/fas/templates/help.html | 12 +
fas/build/lib/fas/templates/home.html | 33 +
fas/build/lib/fas/templates/login.html | 33 +
fas/build/lib/fas/templates/master.html | 104 +++
.../lib/fas/templates/openid/__init__.py | 0
fas/build/lib/fas/templates/openid/about.html | 15 +
fas/build/lib/fas/templates/openid/auth.txt | 1 +
fas/build/lib/fas/templates/openid/id.html | 21 +
.../lib/fas/templates/openid/trusted.html | 20 +
fas/build/lib/fas/templates/user/__init__.py | 0
fas/build/lib/fas/templates/user/cert.txt | 2 +
.../lib/fas/templates/user/changepass.html | 20 +
fas/build/lib/fas/templates/user/edit.html | 88 +++
fas/build/lib/fas/templates/user/list.html | 45 ++
fas/build/lib/fas/templates/user/new.html | 42 ++
.../lib/fas/templates/user/resetpass.html | 20 +
.../lib/fas/templates/user/verifyemail.html | 21 +
.../lib/fas/templates/user/verifypass.html | 22 +
fas/build/lib/fas/templates/user/view.html | 99 +++
fas/build/lib/fas/templates/welcome.html | 26 +
fas/build/lib/fas/tests/__init__.py | 0
fas/build/lib/fas/tests/test_controllers.py | 37 +
fas/build/lib/fas/tests/test_model.py | 22 +
fas/build/lib/fas/user.py | 656 ++++++++++++++++++
fas/build/scripts-2.5/fasClient | 577 +++++++++++++++
fas/build/scripts-2.5/restricted-shell | 67 ++
fas/fas/static/{ => theme/fas}/css/style.css | 0
.../static/{ => theme/fas}/images/account.png | Bin
.../{ => theme/fas}/images/approved.png | Bin
.../static/{ => theme/fas}/images/arrow.png | Bin
.../static/{ => theme/fas}/images/attn.png | Bin
.../fas}/images/control-separator.png | Bin
.../static/{ => theme/fas}/images/favicon.ico | Bin
.../{ => theme/fas}/images/footer-bottom.png | Bin
.../{ => theme/fas}/images/footer-top.png | Bin
.../static/{ => theme/fas}/images/head.png | Bin
.../fas}/images/header-icon_account.png | Bin
.../{ => theme/fas}/images/header_inner.png | Bin
.../static/{ => theme/fas}/images/help.png | Bin
fas/fas/static/{ => theme/fas}/images/hr.png | Bin
.../{ => theme/fas}/images/icon_tool-item.png | Bin
.../{ => theme/fas}/images/icon_warning.png | Bin
.../static/{ => theme/fas}/images/info.png | Bin
.../static/{ => theme/fas}/images/infobar.png | Bin
.../static/{ => theme/fas}/images/logo.png | Bin
fas/fas/static/{ => theme/fas}/images/ok.png | Bin
.../static/{ => theme/fas}/images/queue.png | Bin
.../static/{ => theme/fas}/images/shadow.png | Bin
.../static/{ => theme/fas}/images/sidebar.png | Bin
.../fas}/images/status_approved.png | Bin
.../fas}/images/status_incomplete.png | Bin
.../fas}/images/status_rejected.png | Bin
.../static/{ => theme/fas}/images/success.png | Bin
.../fas}/images/tg_under_the_hood.png | Bin
.../static/{ => theme/fas}/images/tools.png | Bin
.../fas}/images/topnav-separator.png | Bin
.../static/{ => theme/fas}/images/topnav.png | Bin
.../{ => theme/fas}/images/unapproved.png | Bin
.../fas}/images/under_the_hood_blue.png | Bin
fas/fas/templates/master.html | 5 +-
90 files changed, 4782 insertions(+), 2 deletions(-)
create mode 100644 fas/build/lib/fas/__init__.py
create mode 100644 fas/build/lib/fas/auth.py
create mode 100644 fas/build/lib/fas/cla.py
create mode 100644 fas/build/lib/fas/commands.py
create mode 100644 fas/build/lib/fas/config/__init__.py
create mode 100644 fas/build/lib/fas/config/log.cfg
create mode 100644 fas/build/lib/fas/controllers.py
create mode 100644 fas/build/lib/fas/feeds.py
create mode 100644 fas/build/lib/fas/group.py
create mode 100644 fas/build/lib/fas/help.py
create mode 100644 fas/build/lib/fas/json_request.py
create mode 100644 fas/build/lib/fas/model.py
create mode 100644 fas/build/lib/fas/openid_fas.py
create mode 100644 fas/build/lib/fas/openssl_fas.py
create mode 100644 fas/build/lib/fas/release.py
create mode 100644 fas/build/lib/fas/safasprovider.py
create mode 100644 fas/build/lib/fas/templates/__init__.py
create mode 100644 fas/build/lib/fas/templates/about.html
create mode 100644 fas/build/lib/fas/templates/cla/__init__.py
create mode 100644 fas/build/lib/fas/templates/cla/cla.html
create mode 100644 fas/build/lib/fas/templates/cla/cla.txt
create mode 100644 fas/build/lib/fas/templates/cla/index.html
create mode 100644 fas/build/lib/fas/templates/error.html
create mode 100644 fas/build/lib/fas/templates/group/__init__.py
create mode 100644 fas/build/lib/fas/templates/group/dump.txt
create mode 100644 fas/build/lib/fas/templates/group/edit.html
create mode 100644 fas/build/lib/fas/templates/group/invite.html
create mode 100644 fas/build/lib/fas/templates/group/list.html
create mode 100644 fas/build/lib/fas/templates/group/new.html
create mode 100644 fas/build/lib/fas/templates/group/view.html
create mode 100644 fas/build/lib/fas/templates/help.html
create mode 100644 fas/build/lib/fas/templates/home.html
create mode 100644 fas/build/lib/fas/templates/login.html
create mode 100644 fas/build/lib/fas/templates/master.html
create mode 100644 fas/build/lib/fas/templates/openid/__init__.py
create mode 100644 fas/build/lib/fas/templates/openid/about.html
create mode 100644 fas/build/lib/fas/templates/openid/auth.txt
create mode 100644 fas/build/lib/fas/templates/openid/id.html
create mode 100644 fas/build/lib/fas/templates/openid/trusted.html
create mode 100644 fas/build/lib/fas/templates/user/__init__.py
create mode 100644 fas/build/lib/fas/templates/user/cert.txt
create mode 100644 fas/build/lib/fas/templates/user/changepass.html
create mode 100644 fas/build/lib/fas/templates/user/edit.html
create mode 100644 fas/build/lib/fas/templates/user/list.html
create mode 100644 fas/build/lib/fas/templates/user/new.html
create mode 100644 fas/build/lib/fas/templates/user/resetpass.html
create mode 100644 fas/build/lib/fas/templates/user/verifyemail.html
create mode 100644 fas/build/lib/fas/templates/user/verifypass.html
create mode 100644 fas/build/lib/fas/templates/user/view.html
create mode 100644 fas/build/lib/fas/templates/welcome.html
create mode 100644 fas/build/lib/fas/tests/__init__.py
create mode 100644 fas/build/lib/fas/tests/test_controllers.py
create mode 100644 fas/build/lib/fas/tests/test_model.py
create mode 100644 fas/build/lib/fas/user.py
create mode 100755 fas/build/scripts-2.5/fasClient
create mode 100755 fas/build/scripts-2.5/restricted-shell
rename fas/fas/static/{ => theme/fas}/css/style.css (100%)
rename fas/fas/static/{ => theme/fas}/images/account.png (100%)
rename fas/fas/static/{ => theme/fas}/images/approved.png (100%)
rename fas/fas/static/{ => theme/fas}/images/arrow.png (100%)
rename fas/fas/static/{ => theme/fas}/images/attn.png (100%)
rename fas/fas/static/{ => theme/fas}/images/control-separator.png (100%)
rename fas/fas/static/{ => theme/fas}/images/favicon.ico (100%)
rename fas/fas/static/{ => theme/fas}/images/footer-bottom.png (100%)
rename fas/fas/static/{ => theme/fas}/images/footer-top.png (100%)
rename fas/fas/static/{ => theme/fas}/images/head.png (100%)
rename fas/fas/static/{ => theme/fas}/images/header-icon_account.png (100%)
rename fas/fas/static/{ => theme/fas}/images/header_inner.png (100%)
rename fas/fas/static/{ => theme/fas}/images/help.png (100%)
rename fas/fas/static/{ => theme/fas}/images/hr.png (100%)
rename fas/fas/static/{ => theme/fas}/images/icon_tool-item.png (100%)
rename fas/fas/static/{ => theme/fas}/images/icon_warning.png (100%)
rename fas/fas/static/{ => theme/fas}/images/info.png (100%)
rename fas/fas/static/{ => theme/fas}/images/infobar.png (100%)
rename fas/fas/static/{ => theme/fas}/images/logo.png (100%)
rename fas/fas/static/{ => theme/fas}/images/ok.png (100%)
rename fas/fas/static/{ => theme/fas}/images/queue.png (100%)
rename fas/fas/static/{ => theme/fas}/images/shadow.png (100%)
rename fas/fas/static/{ => theme/fas}/images/sidebar.png (100%)
rename fas/fas/static/{ => theme/fas}/images/status_approved.png (100%)
rename fas/fas/static/{ => theme/fas}/images/status_incomplete.png (100%)
rename fas/fas/static/{ => theme/fas}/images/status_rejected.png (100%)
rename fas/fas/static/{ => theme/fas}/images/success.png (100%)
rename fas/fas/static/{ => theme/fas}/images/tg_under_the_hood.png (100%)
rename fas/fas/static/{ => theme/fas}/images/tools.png (100%)
rename fas/fas/static/{ => theme/fas}/images/topnav-separator.png (100%)
rename fas/fas/static/{ => theme/fas}/images/topnav.png (100%)
rename fas/fas/static/{ => theme/fas}/images/unapproved.png (100%)
rename fas/fas/static/{ => theme/fas}/images/under_the_hood_blue.png (100%)
diff --git a/fas/build/lib/fas/__init__.py b/fas/build/lib/fas/__init__.py
new file mode 100644
index 0000000..e333e3c
--- /dev/null
+++ b/fas/build/lib/fas/__init__.py
@@ -0,0 +1,30 @@
+from fas import release
+__version__ = release.VERSION
+
+class FASError(Exception):
+ '''FAS Error'''
+ pass
+
+class ApplyError(FASError):
+ '''Raised when a user could not apply to a group'''
+ pass
+
+class ApproveError(FASError):
+ '''Raised when a user could not be approved in a group'''
+ pass
+
+class SponsorError(FASError):
+ '''Raised when a user could not be sponsored in a group'''
+ pass
+
+class UpgradeError(FASError):
+ '''Raised when a user could not be upgraded in a group'''
+ pass
+
+class DowngradeError(FASError):
+ '''Raised when a user could not be downgraded in a group'''
+ pass
+
+class RemoveError(FASError):
+ '''Raised when a user could not be removed from a group'''
+ pass
diff --git a/fas/build/lib/fas/auth.py b/fas/build/lib/fas/auth.py
new file mode 100644
index 0000000..05b5deb
--- /dev/null
+++ b/fas/build/lib/fas/auth.py
@@ -0,0 +1,218 @@
+from turbogears import config
+
+from fas.model import Groups
+from fas.model import PersonRoles
+from fas.model import People
+
+from sqlalchemy.exceptions import *
+import turbogears
+
+import re
+
+def isAdmin(person):
+ '''
+ Returns True if the user is a FAS admin (a member of the admingroup)
+ '''
+ admingroup = config.get('admingroup')
+ try:
+ if person.group_roles[admingroup].role_status == 'approved':
+ return True
+ else:
+ return False
+ except KeyError:
+ return False
+ return False
+
+def canAdminGroup(person, group):
+ '''
+ Returns True if the user is allowed to act as an admin for a group
+ '''
+ if isAdmin(person) or (group.owner == person):
+ return True
+ else:
+ try:
+ role = PersonRoles.query.filter_by(group=group, member=person).one()
+ except IndexError:
+ ''' Not in the group '''
+ return False
+ except InvalidRequestError:
+ return False
+ if role.role_status == 'approved' and role.role_type == 'administrator':
+ return True
+ return False
+
+def canSponsorGroup(person, group):
+ '''
+ Returns True if the user is allowed to act as a sponsor for a group
+ '''
+ try:
+ if isAdmin(person) or \
+ group.owner == person:
+ return True
+ else:
+ try:
+ role = PersonRoles.query.filter_by(group=group, member=person).one()
+ except IndexError:
+ ''' Not in the group '''
+ return False
+ if role.role_status == 'approved' and role.role_type == 'sponsor':
+ return True
+ return False
+ except:
+ return False
+
+def isApproved(person, group):
+ '''
+ Returns True if the user is an approved member of a group
+ '''
+ try:
+ if person.group_roles[group.name].role_status == 'approved':
+ return True
+ else:
+ return False
+ except KeyError:
+ return False
+ return False
+
+def CLADone(person):
+ '''
+ Returns True if the user has completed the CLA
+ '''
+ cla_done_group =config.get('cla_done_group')
+ try:
+ if person.group_roles[cla_done_group].role_status == 'approved':
+ return True
+ else:
+ return False
+ except KeyError:
+ return False
+ return False
+
+def canEditUser(person, target):
+ '''
+ Returns True if the user has privileges to edit the target user
+ '''
+ if person == target:
+ return True
+ elif isAdmin(person):
+ return True
+ else:
+ return False
+
+def canCreateGroup(person, group):
+ '''
+ Returns True if the user can create groups
+ '''
+ # Should groupname restrictions go here?
+ if isAdmin(person):
+ return True
+ else:
+ return False
+
+def canEditGroup(person, group):
+ '''
+ Returns True if the user can edit the group
+ '''
+ if canAdminGroup(person, group):
+ return True
+ else:
+ return False
+
+def canViewGroup(person, group):
+ '''
+ Returns True if the user can view the group
+ '''
+ # If the group matched by privileged_view_groups, then
+ # only people that can admin the group can view it
+ privilegedViewGroups = config.get('privileged_view_groups')
+ if re.compile(privilegedViewGroups).match(group.name):
+ if canAdminGroup(person, group):
+ return True
+ else:
+ return False
+ else:
+ return True
+
+def canApplyGroup(person, group, applicant):
+ '''
+ Returns True if the user can apply applicant to the group
+ '''
+ # User must satisfy all dependencies to join.
+ # This is bypassed for people already in the group and for the
+ # owner of the group (when they initially make it).
+ prerequisite = group.prerequisite
+ # TODO: Make this return more useful info.
+ if prerequisite:
+ if prerequisite in person.approved_memberships:
+ pass
+ else:
+ turbogears.flash(_('%s membership required before application to this group is allowed') % prerequisite.name)
+ return False
+ # A user can apply themselves, and FAS admins can apply other people.
+
+ if (person == applicant) or \
+ canAdminGroup(person, group):
+ return True
+ else:
+ turbogears.flash(_('%s membership required before application to this group is allowed') % prerequisite.name)
+ return False
+
+def canSponsorUser(person, group, target):
+ '''
+ Returns True if the user can sponsor target in the group
+ '''
+ # This is just here in case we want to add more complex checks in the future
+ if canSponsorGroup(person, group):
+ return True
+ else:
+ return False
+
+def canRemoveUser(person, group, target):
+ '''
+ Returns True if the user can remove target from the group
+ '''
+ # Only administrators can remove administrators.
+ if canAdminGroup(target, group) and \
+ not canAdminGroup(person, group):
+ return False
+ # A user can remove themself from a group if user_can_remove is 1
+ # Otherwise, a sponsor can remove sponsors/users.
+ elif ((person == target) and (group.user_can_remove == True)) or \
+ canSponsorGroup(person, group):
+ return True
+ else:
+ return False
+
+def canUpgradeUser(person, group, target):
+ '''
+ Returns True if the user can upgrade target in the group
+ '''
+ # Group admins can upgrade anybody.
+ # The controller should handle the case where the target
+ # is already a group admin.
+ if canAdminGroup(person, group):
+ return True
+ # Sponsors can only upgrade non-sponsors (i.e. normal users)
+ # TODO: Don't assume that canSponsorGroup means that the user is a sponsor
+ elif canSponsorGroup(person, group) and \
+ not canSponsorGroup(target, group):
+ return True
+ else:
+ return False
+
+def canDowngradeUser(person, group, target):
+ '''
+ Returns True if the user can downgrade target in the group
+ '''
+ # Group admins can downgrade anybody.
+ if canAdminGroup(person, group):
+ return True
+ # Sponsors can only downgrade sponsors.
+ # The controller should handle the case where the target
+ # is already a normal user.
+ elif canSponsorGroup(person, group) and \
+ not canAdminGroup(person, group):
+ return True
+ else:
+ return False
+
diff --git a/fas/build/lib/fas/cla.py b/fas/build/lib/fas/cla.py
new file mode 100644
index 0000000..c6aa636
--- /dev/null
+++ b/fas/build/lib/fas/cla.py
@@ -0,0 +1,120 @@
+import turbogears
+from turbogears import controllers, expose, paginate, identity, redirect, widgets, validate, validators, error_handler
+from turbogears.database import session
+
+import cherrypy
+
+from datetime import datetime
+import re
+import turbomail
+from genshi.template.plugin import TextTemplateEnginePlugin
+
+from fas.model import People
+from fas.model import Log
+from fas.auth import *
+
+class CLA(controllers.Controller):
+
+ def __init__(self):
+ '''Create a CLA Controller.'''
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @expose(template="fas.templates.cla.index")
+ def index(self):
+ '''Display the CLAs (and accept/do not accept buttons)'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ if not person.telephone or not person.postal_address:
+ turbogears.flash('Postal Address and telephone number are required to complete the cla, please fill them out')
+ turbogears.redirect('/user/edit/%s' % username)
+ cla = CLADone(person)
+ return dict(cla=cla, person=person, date=datetime.utcnow().ctime())
+
+ def jsonRequest(self):
+ return 'tg_format' in cherrypy.request.params and \
+ cherrypy.request.params['tg_format'] == 'json'
+
+ @expose(template="fas.templates.error")
+ def error(self, tg_errors=None):
+ '''Show a friendly error message'''
+ if not tg_errors:
+ turbogears.redirect('/')
+ return dict(tg_errors=tg_errors)
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
+ @expose(template="genshi-text:fas.templates.cla.cla", format="text", content_type='text/plain; charset=utf-8')
+ def text(self, type=None):
+ '''View CLA as text'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ return dict(person=person, date=datetime.utcnow().ctime())
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
+ @expose(template="genshi-text:fas.templates.cla.cla", format="text", content_type='text/plain; charset=utf-8')
+ def download(self, type=None):
+ '''Download CLA'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ return dict(person=person, date=datetime.utcnow().ctime())
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
+ @expose(template="fas.templates.cla.index")
+ def send(self, agree=False):
+ '''Send CLA'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ if CLADone(person):
+ turbogears.flash(_('You have already completed the CLA.'))
+ turbogears.redirect('/cla/')
+ return dict()
+ if not agree:
+ turbogears.flash(_("You have not completed the CLA."))
+ turbogears.redirect('/user/view/%s' % person.username)
+ if not person.telephone or \
+ not person.postal_address:
+ turbogears.flash(_('To complete the CLA, we must have your telephone number and postal address. Please ensure they have been filled out.'))
+ turbogears.redirect('/user/edit/%s' % username)
+ groupname = config.get('cla_fedora_group')
+ group = Groups.by_name(groupname)
+ try:
+ # Everything is correct.
+ person.apply(group, person) # Apply...
+ session.flush()
+ person.sponsor(group, person) # Sponsor!
+ except:
+ # TODO: If apply succeeds and sponsor fails, the user has
+ # to remove themselves from the CLA group before they can
+ # complete the CLA and go through the above try block again.
+ turbogears.flash(_("You could not be added to the '%s' group.") % group.name)
+ turbogears.redirect('/cla/')
+ return dict()
+ else:
+ dt = datetime.utcnow()
+ Log(author_id=person.id, description='Completed CLA', changetime=dt)
+ message = turbomail.Message(config.get('accounts_email'), config.get('legal_cla_email'), 'Fedora ICLA completed')
+ message.plain = '''
+Fedora user %(username)s has completed an ICLA (below).
+Username: %(username)s
+Email: %(email)s
+Date: %(date)s
+
+=== CLA ===
+
+''' % {'username': person.username,
+ 'human_name': person.human_name,
+ 'email': person.email,
+ 'postal_address': person.postal_address,
+ 'telephone': person.telephone,
+ 'facsimile': person.facsimile,
+ 'date': dt.ctime(),}
+ # Sigh.. if only there were a nicer way.
+ plugin = TextTemplateEnginePlugin()
+ message.plain += plugin.render(template='fas.templates.cla.cla', info=dict(person=person), format='text')
+ turbomail.enqueue(message)
+ turbogears.flash(_("You have successfully completed the CLA. You are now in the '%s' group.") % group.name)
+ turbogears.redirect('/user/view/%s' % person.username)
+ return dict()
+
diff --git a/fas/build/lib/fas/commands.py b/fas/build/lib/fas/commands.py
new file mode 100644
index 0000000..dbbaf2d
--- /dev/null
+++ b/fas/build/lib/fas/commands.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+"""This module contains functions called from console script entry points."""
+
+import os
+import sys
+
+import pkg_resources
+pkg_resources.require("TurboGears")
+
+import turbogears
+import cherrypy
+
+cherrypy.lowercase_api = True
+
+class ConfigurationError(Exception):
+ pass
+
+def start():
+ '''Start the CherryPy application server.'''
+ setupdir = os.path.dirname(os.path.dirname(__file__))
+ curdir = os.getcwd()
+
+ # First look on the command line for a desired config file,
+ # if it's not on the command line, then look for 'setup.py'
+ # in the current directory. If there, load configuration
+ # from a file called 'dev.cfg'. If it's not there, the project
+ # is probably installed and we'll look first for a file called
+ # 'prod.cfg' in the current directory and then for a default
+ # config file called 'default.cfg' packaged in the egg.
+ if len(sys.argv) > 1:
+ configfile = sys.argv[1]
+ elif os.path.exists(os.path.join(setupdir, 'setup.py')) \
+ and os.path.exists(os.path.join(setupdir, 'dev.cfg')):
+ configfile = os.path.join(setupdir, 'dev.cfg')
+ elif os.path.exists(os.path.join(curdir, 'fas.cfg')):
+ configfile = os.path.join(curdir, 'fas.cfg')
+ elif os.path.exists(os.path.join('/etc/fas.cfg')):
+ configfile = os.path.join('/etc/fas.cfg')
+ else:
+ try:
+ configfile = pkg_resources.resource_filename(
+ pkg_resources.Requirement.parse("fas"),
+ "config/default.cfg")
+ except pkg_resources.DistributionNotFound:
+ raise ConfigurationError("Could not find default configuration.")
+
+ turbogears.update_config(configfile=configfile,
+ modulename="fas.config")
+
+ from fas.controllers import Root
+ turbogears.start_server(Root())
diff --git a/fas/build/lib/fas/config/__init__.py b/fas/build/lib/fas/config/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/fas/build/lib/fas/config/log.cfg b/fas/build/lib/fas/config/log.cfg
new file mode 100644
index 0000000..ce776f8
--- /dev/null
+++ b/fas/build/lib/fas/config/log.cfg
@@ -0,0 +1,29 @@
+# LOGGING
+# Logging is often deployment specific, but some handlers and
+# formatters can be defined here.
+
+[logging]
+[[formatters]]
+[[[message_only]]]
+format='*(message)s'
+
+[[[full_content]]]
+format='*(asctime)s *(name)s *(levelname)s *(message)s'
+
+[[handlers]]
+[[[debug_out]]]
+class='StreamHandler'
+level='DEBUG'
+args='(sys.stdout,)'
+formatter='full_content'
+
+[[[access_out]]]
+class='StreamHandler'
+level='INFO'
+args='(sys.stdout,)'
+formatter='message_only'
+
+[[[error_out]]]
+class='StreamHandler'
+level='ERROR'
+args='(sys.stdout,)'
diff --git a/fas/build/lib/fas/controllers.py b/fas/build/lib/fas/controllers.py
new file mode 100644
index 0000000..b092bf5
--- /dev/null
+++ b/fas/build/lib/fas/controllers.py
@@ -0,0 +1,145 @@
+from turbogears import controllers, expose, config
+from model import *
+from turbogears import identity, redirect, widgets, validate, validators, error_handler
+from cherrypy import request, response
+
+from turbogears import exception_handler
+import turbogears
+import cherrypy
+import time
+
+from fas.user import User
+from fas.group import Group
+from fas.cla import CLA
+from fas.json_request import JsonRequest
+from fas.help import Help
+from fas.auth import *
+#from fas.openid_fas import OpenID
+
+import os
+import sys
+reload(sys)
+sys.setdefaultencoding('utf-8')
+
+def add_custom_stdvars(vars):
+ return vars.update({"gettext": _})
+
+turbogears.view.variable_providers.append(add_custom_stdvars)
+
+def get_locale(locale=None):
+ if locale:
+ return locale
+ try:
+ return turbogears.identity.current.user.locale
+ except AttributeError:
+ return turbogears.i18n.utils._get_locale()
+
+config.update({'i18n.get_locale': get_locale})
+
+# from fas import json
+# import logging
+# log = logging.getLogger("fas.controllers")
+
+#TODO: Appropriate flash icons for errors, etc.
+# mmcgrath wonders if it will be handy to expose an encrypted mailer with fas over json for our apps
+
+class Root(controllers.RootController):
+
+ user = User()
+ group = Group()
+ cla = CLA()
+ json = JsonRequest()
+ help = Help()
+ #openid = OpenID()
+
+ # TODO: Find a better place for this.
+ os.environ['GNUPGHOME'] = config.get('gpghome')
+
+ @expose(template="fas.templates.welcome", allow_json=True)
+ def index(self):
+ if turbogears.identity.not_anonymous():
+ if 'tg_format' in request.params \
+ and request.params['tg_format'] == 'json':
+ # redirects don't work with JSON calls. This is a bit of a
+ # hack until we can figure out something better.
+ return dict()
+ turbogears.redirect('/home')
+ return dict(now=time.ctime())
+
+ @expose(template="fas.templates.home", allow_json=True)
+ @identity.require(identity.not_anonymous())
+ def home(self):
+ user_name = turbogears.identity.current.user_name
+ person = People.by_username(user_name)
+ cla = CLADone(person)
+ return dict(person=person, cla=cla)
+
+ @expose(template="fas.templates.about")
+ def about(self):
+ return dict()
+
+ @expose(template="fas.templates.login", allow_json=True)
+ def login(self, forward_url=None, previous_url=None, *args, **kwargs):
+ '''Page to become authenticated to the Account System.
+
+ This shows a small login box to type in your username and password
+ from the Fedora Account System.
+
+ Arguments:
+ :forward_url: The url to send to once authentication succeeds
+ :previous_url: The url that sent us to the login page
+ '''
+ if forward_url == '.':
+ forward_url = turbogears.url('/../home')
+ if not identity.current.anonymous \
+ and identity.was_login_attempted() \
+ and not identity.get_identity_errors():
+ # User is logged in
+ turbogears.flash(_('Welcome, %s') % People.by_username(turbogears.identity.current.user_name).human_name)
+ if 'tg_format' in request.params \
+ and request.params['tg_format'] == 'json':
+ # When called as a json method, doesn't make any sense to
+ # redirect to a page. Returning the logged in identity
+ # is better.
+ return dict(user = identity.current.user)
+ if not forward_url:
+ forward_url = turbogears.url('/')
+ raise redirect(forward_url)
+
+ forward_url=None
+ previous_url= request.path
+
+ if identity.was_login_attempted():
+ msg=_("The credentials you supplied were not correct or "
+ "did not grant access to this resource.")
+ elif identity.get_identity_errors():
+ msg=_("You must provide your credentials before accessing "
+ "this resource.")
+ else:
+ msg=_("Please log in.")
+ forward_url= '.'
+
+ cherrypy.response.status=403
+ return dict(message=msg, previous_url=previous_url, logging_in=True,
+ original_parameters=request.params,
+ forward_url=forward_url)
+
+ @expose(allow_json=True)
+ def logout(self):
+ identity.current.logout()
+ turbogears.flash(_('You have successfully logged out.'))
+ if 'tg_format' in request.params \
+ and request.params['tg_format'] == 'json':
+ # When called as a json method, doesn't make any sense to
+ # redirect to a page. Returning the logged in identity
+ # is better.
+ return dict(status=True)
+ raise redirect('/')
+
+ @expose()
+ def language(self, locale):
+ locale_key = config.get("i18n.session_key", "locale")
+ cherrypy.session[locale_key] = locale
+ raise redirect(request.headers.get("Referer", "/"))
+
+
diff --git a/fas/build/lib/fas/feeds.py b/fas/build/lib/fas/feeds.py
new file mode 100644
index 0000000..93a64c8
--- /dev/null
+++ b/fas/build/lib/fas/feeds.py
@@ -0,0 +1,17 @@
+import urllib
+from xml.dom import minidom
+
+
+class Koji:
+ def __init__(self, userName, url='http://publictest8/koji/recentbuilds?user='):
+ buildFeed = minidom.parse(urllib.urlopen(url + userName))
+ try:
+ self.userLink = buildFeed.getElementsByTagName('link')[0].childNodes[0].data
+ self.builds = {}
+ for build in buildFeed.getElementsByTagName('item'):
+ link = build.getElementsByTagName('link')[0].childNodes[0].data
+ self.builds[link] = {}
+ self.builds[link]['title'] = build.getElementsByTagName('title')[0].childNodes[0].data
+ self.builds[link]['pubDate'] = build.getElementsByTagName('pubDate')[0].childNodes[0].data
+ except IndexError:
+ return
diff --git a/fas/build/lib/fas/group.py b/fas/build/lib/fas/group.py
new file mode 100644
index 0000000..c96b92c
--- /dev/null
+++ b/fas/build/lib/fas/group.py
@@ -0,0 +1,532 @@
+import turbogears
+from turbogears import controllers, expose, paginate, identity, redirect, widgets, validate, validators, error_handler
+from turbogears.database import session
+
+import cherrypy
+import sqlalchemy
+
+import fas
+from fas.auth import *
+from fas.user import KnownUser
+
+import re
+import turbomail
+
+class KnownGroup(validators.FancyValidator):
+ '''Make sure that a group already exists'''
+ def _to_python(self, value, state):
+ return value.strip()
+ def validate_python(self, value, state):
+ try:
+ g = Groups.by_name(value)
+ except InvalidRequestError:
+ raise validators.Invalid(_("The group '%s' does not exist.") % value, value, state)
+
+class UnknownGroup(validators.FancyValidator):
+ '''Make sure that a group doesn't already exist'''
+ def _to_python(self, value, state):
+ return value.strip()
+ def validate_python(self, value, state):
+ try:
+ g = Groups.by_name(value)
+ except InvalidRequestError:
+ pass
+ else:
+ raise validators.Invalid(_("The group '%s' already exists.") % value, value, state)
+
+class GroupCreate(validators.Schema):
+
+ name = validators.All(
+ UnknownGroup,
+ validators.String(max=32, min=3),
+ validators.Regex(regex='^[a-z0-9\-_]+$'),
+ )
+ display_name = validators.NotEmpty
+ owner = validators.All(
+ KnownUser,
+ validators.NotEmpty,
+ )
+ prerequisite = KnownGroup
+ #group_type = something
+
+class GroupSave(validators.Schema):
+ groupname = validators.All(KnownGroup, validators.String(max=32, min=3))
+ display_name = validators.NotEmpty
+ owner = KnownUser
+ prerequisite = KnownGroup
+ #group_type = something
+
+class GroupApply(validators.Schema):
+ groupname = KnownGroup
+ targetname = KnownUser
+
+class GroupSponsor(validators.Schema):
+ groupname = KnownGroup
+ targetname = KnownUser
+
+class GroupRemove(validators.Schema):
+ groupname = KnownGroup
+ targetname = KnownUser
+
+class GroupUpgrade(validators.Schema):
+ groupname = KnownGroup
+ targetname = KnownUser
+
+class GroupDowngrade(validators.Schema):
+ groupname = KnownGroup
+ targetname = KnownUser
+
+class GroupView(validators.Schema):
+ groupname = KnownGroup
+
+class GroupEdit(validators.Schema):
+ groupname = KnownGroup
+
+class GroupInvite(validators.Schema):
+ groupname = KnownGroup
+
+class GroupSendInvite(validators.Schema):
+ groupname = KnownGroup
+ target = validators.Email(not_empty=True, strip=True),
+
+#class findUser(widgets.WidgetsList):
+# username = widgets.AutoCompleteField(label=_('Username'), search_controller='search', search_param='username', result_name='people')
+# action = widgets.HiddenField(default='apply', validator=validators.String(not_empty=True))
+# groupname = widgets.HiddenField(validator=validators.String(not_empty=True))
+#
+#findUserForm = widgets.ListForm(fields=findUser(), submit_text=_('Invite'))
+
+class Group(controllers.Controller):
+
+ def __init__(self):
+ '''Create a Group Controller.'''
+
+ @identity.require(turbogears.identity.not_anonymous())
+ def index(self):
+ '''Perhaps show a nice explanatory message about groups here?'''
+ return dict()
+
+ def jsonRequest(self):
+ return 'tg_format' in cherrypy.request.params and \
+ cherrypy.request.params['tg_format'] == 'json'
+
+ @expose(template="fas.templates.error")
+ def error(self, tg_errors=None):
+ '''Show a friendly error message'''
+ if not tg_errors:
+ turbogears.redirect('/')
+ return dict(tg_errors=tg_errors)
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupView())
+ @error_handler(error)
+ @expose(template="fas.templates.group.view", allow_json=True)
+ def view(self, groupname):
+ '''View group'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ group = Groups.by_name(groupname)
+
+ if not canViewGroup(person, group):
+ turbogears.flash(_("You cannot view '%s'") % group.name)
+ turbogears.redirect('/group/list')
+ return dict()
+ else:
+ return dict(group=group)
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @expose(template="fas.templates.group.new")
+ def new(self):
+ '''Display create group form'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+
+ if not canCreateGroup(person, Groups.by_name(config.get('admingroup'))):
+ turbogears.flash(_('Only FAS adminstrators can create groups.'))
+ turbogears.redirect('/')
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupCreate())
+ @error_handler(error)
+ @expose(template="fas.templates.group.new")
+ def create(self, name, display_name, owner, group_type, needs_sponsor=0, user_can_remove=1, prerequisite='', joinmsg=''):
+ '''Create a group'''
+
+ groupname = name
+ person = People.by_username(turbogears.identity.current.user_name)
+ person_owner = People.by_username(owner)
+
+ if not canCreateGroup(person, Groups.by_name(config.get('admingroup'))):
+ turbogears.flash(_('Only FAS adminstrators can create groups.'))
+ turbogears.redirect('/')
+ try:
+ owner = People.by_username(owner)
+ group = Groups()
+ group.name = name
+ group.display_name = display_name
+ group.owner_id = person_owner.id
+ group.group_type = group_type
+ group.needs_sponsor = bool(needs_sponsor)
+ group.user_can_remove = bool(user_can_remove)
+ if prerequisite:
+ prerequisite = Groups.by_name(prerequisite)
+ group.prerequisite = prerequisite
+ group.joinmsg = joinmsg
+ # Log here
+ session.flush()
+ except TypeError:
+ turbogears.flash(_("The group: '%s' could not be created.") % groupname)
+ return dict()
+ else:
+ try:
+ owner.apply(group, person) # Apply...
+ session.flush()
+ owner.sponsor(group, person)
+ owner.upgrade(group, person)
+ owner.upgrade(group, person)
+ except KeyError:
+ turbogears.flash(_("The group: '%(group)s' has been created, but '%(user)s' could not be added as a group administrator.") % {'group': group.name, 'user': owner.username})
+ else:
+ turbogears.flash(_("The group: '%s' has been created.") % group.name)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupEdit())
+ @error_handler(error)
+ @expose(template="fas.templates.group.edit")
+ def edit(self, groupname):
+ '''Display edit group form'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ group = Groups.by_name(groupname)
+
+ if not canAdminGroup(person, group):
+ turbogears.flash(_("You cannot edit '%s'.") % group.name)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict(group=group)
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupSave())
+ @error_handler(error)
+ @expose(template="fas.templates.group.edit")
+ def save(self, groupname, display_name, owner, group_type, needs_sponsor=0, user_can_remove=1, prerequisite='', joinmsg=''):
+ '''Edit a group'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ group = Groups.by_name(groupname)
+
+ if not canEditGroup(person, group):
+ turbogears.flash(_("You cannot edit '%s'.") % group.name)
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ try:
+ owner = People.by_username(owner)
+ group.display_name = display_name
+ group.owner = owner
+ group.group_type = group_type
+ group.needs_sponsor = bool(needs_sponsor)
+ group.user_can_remove = bool(user_can_remove)
+ if prerequisite:
+ prerequisite = Groups.by_name(prerequisite)
+ group.prerequisite = prerequisite
+ group.joinmsg = joinmsg
+ # Log here
+ session.flush()
+ except:
+ turbogears.flash(_('The group details could not be saved.'))
+ else:
+ turbogears.flash(_('The group details have been saved.'))
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict(group=group)
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @expose(template="fas.templates.group.list", allow_json=True)
+ def list(self, search='*'):
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+
+ memberships = {}
+ groups = []
+ re_search = re.sub(r'\*', r'%', search).lower()
+ results = Groups.query.filter(Groups.name.like(re_search)).order_by('name').all()
+ if self.jsonRequest():
+ membersql = sqlalchemy.select([PersonRoles.c.person_id, PersonRoles.c.group_id, PersonRoles.c.role_type], PersonRoles.c.role_status=='approved').order_by(PersonRoles.c.group_id)
+ members = membersql.execute()
+ for member in members:
+ try:
+ memberships[member[1]].append({'person_id': member[0], 'role_type': member[2]})
+ except KeyError:
+ memberships[member[1]]=[{'person_id': member[0], 'role_type': member[2]}]
+ for group in results:
+ if canViewGroup(person, group):
+ groups.append(group)
+ if not len(groups):
+ turbogears.flash(_("No Groups found matching '%s'") % search)
+ return dict(groups=groups, search=search, memberships=memberships)
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupApply())
+ @error_handler(error)
+ @expose(template='fas.templates.group.view')
+ def apply(self, groupname, targetname=None):
+ '''Apply to a group'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ if not targetname:
+ target = person
+ else:
+ target = People.by_username(targetname)
+ group = Groups.by_name(groupname)
+
+ if not canApplyGroup(person, group, target):
+ turbogears.flash(_('%(user)s can not apply to %(group)s.') % \
+ {'user': target.username, 'group': group.name })
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+ else:
+ try:
+ target.apply(group, person)
+ except fas.ApplyError, e:
+ turbogears.flash(_('%(user)s could not apply to %(group)s: %(error)s') % \
+ {'user': target.username, 'group': group.name, 'error': e})
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ # TODO: How do we handle gettext calls for these kinds of emails?
+ # TODO: CC to right place, put a bit more thought into how to most elegantly do this
+ # TODO: Maybe that @fedoraproject.org (and even -sponsors) should be configurable somewhere?
+ message = turbomail.Message(config.get('accounts_email'), '%(group)s-sponsors@%(host)s' % {'group': group.name, 'host': config.get('email_host')}, \
+ "Fedora '%(group)s' sponsor needed for %(user)s" % {'user': target.username, 'group': group.name})
+ url = config.get('base_url_filter.base_url') + '/group/edit/%s' % groupname
+
+ message.plain = _('''
+Fedora user %(user)s, aka %(name)s <%(email)s> has requested
+membership for %(applicant)s (%(applicant_name)s) in the %(group)s group and needs a sponsor.
+
+Please go to %(url)s to take action.
+''') % {'user': person.username, 'name': person.human_name, 'applicant': target.username, 'applicant_name': target.human_name, 'email': person.email, 'url': url, 'group': group.name}
+ turbomail.enqueue(message)
+ turbogears.flash(_('%(user)s has applied to %(group)s!') % \
+ {'user': target.username, 'group': group.name})
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupSponsor())
+ @error_handler(error)
+ @expose(template='fas.templates.group.view')
+ def sponsor(self, groupname, targetname):
+ '''Sponsor user'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ target = People.by_username(targetname)
+ group = Groups.by_name(groupname)
+
+ if not canSponsorUser(person, group, target):
+ turbogears.flash(_("You cannot sponsor '%s'") % target.username)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+ else:
+ try:
+ target.sponsor(group, person)
+ except fas.SponsorError, e:
+ turbogears.flash(_("%(user)s could not be sponsored in %(group)s: %(error)s") % \
+ {'user': target.username, 'group': group.name, 'error': e})
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ import turbomail
+ message = turbomail.Message(config.get('accounts_email'), target.email, "Your Fedora '%s' membership has been sponsored" % group.name)
+ message.plain = _('''
+%(name)s <%(email)s> has sponsored you for membership in the %(group)s
+group of the Fedora account system. If applicable, this change should
+propagate into the e-mail aliases and CVS repository within an hour.
+
+%(joinmsg)s
+''') % {'group': group.name, 'name': person.human_name, 'email': person.email, 'joinmsg': group.joinmsg}
+ turbomail.enqueue(message)
+ turbogears.flash(_("'%s' has been sponsored!") % target.human_name)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupRemove())
+ @error_handler(error)
+ @expose(template='fas.templates.group.view')
+ def remove(self, groupname, targetname):
+ '''Remove user from group'''
+ # TODO: Add confirmation?
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ target = People.by_username(targetname)
+ group = Groups.by_name(groupname)
+
+ if not canRemoveUser(person, group, target):
+ turbogears.flash(_("You cannot remove '%(user)s' from '%(group)s'.") % {'user': target.username, 'group': group.name})
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+ else:
+ try:
+ target.remove(group, target)
+ except fas.RemoveError, e:
+ turbogears.flash(_("%(user)s could not be removed from %(group)s: %(error)s") % \
+ {'user': target.username, 'group': group.name, 'error': e})
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ message = turbomail.Message(config.get('accounts_email'), target.email, "Your Fedora '%s' membership has been removed" % group.name)
+ message.plain = _('''
+%(name)s <%(email)s> has removed you from the '%(group)s'
+group of the Fedora Accounts System This change is effective
+immediately for new operations, and should propagate into the e-mail
+aliases within an hour.
+''') % {'group': group.name, 'name': person.human_name, 'email': person.email}
+ turbomail.enqueue(message)
+ turbogears.flash(_('%(name)s has been removed from %(group)s') % \
+ {'name': target.username, 'group': group.name})
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupUpgrade())
+ @error_handler(error)
+ @expose(template='fas.templates.group.view')
+ def upgrade(self, groupname, targetname):
+ '''Upgrade user in group'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ target = People.by_username(targetname)
+ group = Groups.by_name(groupname)
+
+ if not canUpgradeUser(person, group, target):
+ turbogears.flash(_("You cannot upgrade '%s'") % target.username)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+ else:
+ try:
+ target.upgrade(group, person)
+ except fas.UpgradeError, e:
+ turbogears.flash(_('%(name)s could not be upgraded in %(group)s: %(error)s') % \
+ {'name': target.username, 'group': group.name, 'error': e})
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ import turbomail
+ message = turbomail.Message(config.get('accounts_email'), target.email, "Your Fedora '%s' membership has been upgraded" % group.name)
+ # Should we make person.upgrade return this?
+ role = PersonRoles.query.filter_by(group=group, member=target).one()
+ status = role.role_type
+ message.plain = _('''
+%(name)s <%(email)s> has upgraded you to %(status)s status in the
+'%(group)s' group of the Fedora Accounts System This change is
+effective immediately for new operations, and should propagate
+into the e-mail aliases within an hour.
+''') % {'group': group.name, 'name': person.human_name, 'email': person.email, 'status': status}
+ turbomail.enqueue(message)
+ turbogears.flash(_('%s has been upgraded!') % target.username)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @validate(validators=GroupDowngrade())
+ @error_handler(error)
+ @expose(template='fas.templates.group.view')
+ def downgrade(self, groupname, targetname):
+ '''Upgrade user in group'''
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ target = People.by_username(targetname)
+ group = Groups.by_name(groupname)
+
+ if not canDowngradeUser(person, group, target):
+ turbogears.flash(_("You cannot downgrade '%s'") % target.username)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+ else:
+ try:
+ target.downgrade(group, person)
+ except fas.DowngradeError, e:
+ turbogears.flash(_('%(name)s could not be downgraded in %(group)s: %(error)s') % \
+ {'name': target.username, 'group': group.name, 'error': e})
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ import turbomail
+ message = turbomail.Message(config.get('accounts_email'), target.email, "Your Fedora '%s' membership has been downgraded" % group.name)
+ role = PersonRoles.query.filter_by(group=group, member=target).one()
+ status = role.role_type
+ message.plain = _('''
+%(name)s <%(email)s> has downgraded you to %(status)s status in the
+'%(group)s' group of the Fedora Accounts System This change is
+effective immediately for new operations, and should propagate
+into the e-mail aliases within an hour.
+''') % {'group': group.name, 'name': person.human_name, 'email': person.email, 'status': status}
+ turbomail.enqueue(message)
+ turbogears.flash(_('%s has been downgraded!') % target.username)
+ turbogears.redirect('/group/view/%s' % group.name)
+ return dict()
+
+ @identity.require(turbogears.identity.not_anonymous())
+ @error_handler(error)
+ @expose(template="genshi-text:fas.templates.group.dump", format="text", content_type='text/plain; charset=utf-8')
+ def dump(self, groupname=None):
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ if not groupname:
+# groupname = config.get('cla_done_group')
+ people = People.query.order_by('username').all()
+ else:
+ people = []
+ groups = Groups.by_name(groupname)
+ for role in groups.approved_roles:
+ people.append(role.member)
+ if not canViewGroup(person, groups):
+ turbogears.flash(_("You cannot view '%s'") % group.name)
+ turbogears.redirect('/group/list')
+ return dict()
+
+ return dict(people=people)
+
+ @identity.require(identity.not_anonymous())
+ @validate(validators=GroupInvite())
+ @error_handler(error)
+ @expose(template='fas.templates.group.invite')
+ def invite(self, groupname):
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ group = Groups.by_name(groupname)
+
+ return dict(person=person, group=group)
+
+ @identity.require(identity.not_anonymous())
+ @validate(validators=GroupSendInvite())
+ @error_handler(error)
+ @expose(template='fas.templates.group.invite')
+ def sendinvite(self, groupname, target):
+ import turbomail
+ username = turbogears.identity.current.user_name
+ person = People.by_username(username)
+ group = Groups.by_name(groupname)
+
+ if isApproved(person, group):
+ message = turbomail.Message(person.email, target, _('Come join The Fedora Project!'))
+ message.plain = _('''
+%(name)s <%(email)s> has invited you to join the Fedora
+Project! We are a community of users and developers who produce a
+complete operating system from entirely free and open source software
+(FOSS). %(name)s thinks that you have knowledge and skills
+that make you a great fit for the Fedora community, and that you might
+be interested in contributing.
+
+How could you team up with the Fedora community to use and develop your
+skills? Check out http://fedoraproject.org/join-fedora for some ideas.
+Our community is more than just software developers -- we also have a
+place for you whether you're an artist, a web site builder, a writer, or
+a people person. You'll grow and learn as you work on a team with other
+very smart and talented people.
+
+Fedora and FOSS are changing the world -- come be a part of it!''') % {'name': person.human_name, 'email': person.email}
+ turbomail.enqueue(message)
+ turbogears.flash(_('Message sent to: %s') % target)
+ turbogears.redirect('/group/view/%s' % group.name)
+ else:
+ turbogears.flash(_("You are not in the '%s' group.") % group.name)
+ return dict(target=target, person=person, group=group)
+
diff --git a/fas/build/lib/fas/help.py b/fas/build/lib/fas/help.py
new file mode 100644
index 0000000..b00aedd
--- /dev/null
+++ b/fas/build/lib/fas/help.py
@@ -0,0 +1,50 @@
+import turbogears
+from turbogears import controllers, expose, paginate, identity, redirect, widgets, validate, validators, error_handler
+from turbogears.database import session
+
+from fas.auth import *
+
+# TODO: gettext like crazy.
+class Help(controllers.Controller):
+ help = { 'none' : ['Error', '
We could not find that help item
'],
+ 'user_ircnick' : ['IRC Nick (Optional)', '
IRC Nick is used to identify yourself on irc.freenode.net. Please register your nick on irc.freenode.net first, then fill this in so people can find you online when they need to
'],
+ 'user_email' : ['Email (Required)', '
This email address should be your prefered email contact and will be used to send various official emails to. This is also where your @fedoraproject.org email will get forwarded
'],
+ 'user_human_name' : ['Full Name (Required)', '
Your Human Name or "real life" name
'],
+ 'user_gpg_keyid' : ['GPG Key', '
A GPG key is generally used to prove that a message or email came from you or to encrypt information so that only the recipients can read it. This can be used when a password reset is sent to your email.
'],
+ 'user_telephone' : ['Telephone', '
Required in order to complete the CLA. Sometimes during a time of emergency someone from the Fedora Project may need to contact you. For more information see our Privacy Policy
'],
+ 'user_postal_address': ['Postal Address', '
Required in order to complete the CLA. This should be a mailing address where you can be contacted. See our Privacy Policy about any concerns.
'],
+ 'user_timezone': ['Timezone (Optional)', '
Please specify the time zone you are in.
'],
+ 'user_comments': ['Comments (Optional)', '
Misc comments about yourself.
'],
+ 'user_account_status': ['Account Status', '
Shows account status, possible values include
Valid
Disabled
Expired
'],
+ 'user_cla' : ['CLA', '
In order to become a full Fedora contributor you must complete the Contributor License Agreement. This license is a legal agreement between you and Red Hat. Full status allows people to contribute content and code and is recommended for anyone interested in getting involved in the Fedora Project.
'],
+ 'user_ssh_key' : ['Public SSH Key', '
Many resources require public key authentiaction to work. By uploading your public key to us, you can then log in to our servers. Type "man ssh-keygen" for more information on creating your key. Once created you will want to upload ~/.ssh/id_dsa.pub or ~/.ssh/id_rsa.pub
'],
+ 'user_locale': ['Locale', '
For non-english speaking peoples this allows individuals to select which locale they are in.
'],
+
+ 'group_apply': ['Apply', '
Applying for a group is like applying for a job and it can certainly take a while to get in. Many groups have their own rules about how to actually get approved or sponsored. For more information on how the account system works see the about page.
'],
+ 'group_remove': ['Remove', '''
Removing a person from a group will cause that user to no longer be in the group. They will need to re-apply to get in. Admins can remove anyone, Sponsors can remove users, users can't remove anyone.
'''],
+ 'group_upgrade': ['Upgrade', '''
Upgrade a persons status in this group.
from user -> to sponsor
From sponsor -> administrator
administrators cannot be upgraded beyond administrator
'''],
+ 'group_downgrade': ['Downgrade', '''
Downgrade a persons status in the group.
from administrator -> to sponsor
From sponsor -> user
users cannot be downgraded below user, you may want to remove them
'''],
+ 'group_approve': ['Approve', '''
A sponsor or administrator can approve users to be in a group. Once the user has applied for the group, go to the group's page and click approve to approve the user.
'''],
+ 'group_sponsor': ['Sponsor', '''
A sponsor or administrator can sponsor users to be in a gruop. Once the user has applied for the group, go to the group's page and click approve to sponsor the user. Sponsorship of a user implies that you are approving a user and may mentor and answer their questions as they come up.
'''],
+ 'group_user_add': ['Add User', '''
Manually add a user to a group. Place their username in this field and click 'Add'
'''],
+ 'group_name': ['Group Name', '''
The name of the group you'd like to create. It should be alphanumeric though '-'s are allowed
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.
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
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.
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
${_('''FAS is designed around an open architecture. Unlike the traditional account systems where a single admin or group of admins decide who gets to be in what group, FAS is completely designed to be self operating per team. Every group is given at least one administrator who can then approve other people in the group. Also, unlike traditional account systems. FAS allows people to apply for the groups they want to be in. This paridigm is interesting as it allows anyone to find out who is in what groups and contact them. This openness is brought over from the same philosophies that make Open Source popular.''')}
+
${_('Etiquette')}
+
${_("People shouldn't assume that by applying for a group that they're then in that group. Consider it like applying for another job. It often takes time. For best odds of success, learn about the group you're applying for and get to know someone in the group. Find someone with sponsor or admin access and ask them if they'd have time to mentor you. Plan on spending at least a few days learning about the group, doing a mundain task, participating on the mailing list. Sometimes this process can take weeks depending on the group. It's best to know you will get sponsored before you apply.")}
+
${_('Users, Sponsors, Administrators')}
+
${_('''Once you're in the group, you're in the group. Sponsorship and Administrators typically have special access in the group in questions. Some groups consider sponsorship level to be of a higher involvement, partial ownership of the group for example. But as far as the account system goes the disctinction is easy. Sponsors can approve new users and make people into sponsors. They cannot, however, downgrade or remove other sponsors. They also cannot change administrators in any way. Administrators can do anything to anyone in the group.''')}
+
+
diff --git a/fas/build/lib/fas/templates/cla/__init__.py b/fas/build/lib/fas/templates/cla/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/fas/build/lib/fas/templates/cla/cla.html b/fas/build/lib/fas/templates/cla/cla.html
new file mode 100644
index 0000000..34643a3
--- /dev/null
+++ b/fas/build/lib/fas/templates/cla/cla.html
@@ -0,0 +1,82 @@
+
+
The Fedora Project
+ Individual Contributor License Agreement (CLA)
+
+ Thank you for your interest in The Fedora Project (the "Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Red hat, Inc. ("Red Hat"), as maintainer of the Project, must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for Your protection as a Contributor as well as the protection of the Project and its users; it does not change your rights to use your own Contributions for any other purpose.
+
+
+ If you have not already done so, please complete an original signed Agreement. Use black ink, and hand-print or type the items other than the signature. Send the completed Agreement to
+
+
+ Fedora Project, c/o Red Hat, Inc.,
+ Attn: Legal Affairs
+ 1801 Varsity Drive
+ Raleigh, North Carolina, 27606 U.S.A.
+
+
+ If necessary, you may send it by facsimile to the Project at +1-919-754-3704 or e-mail a signed pdf copy of the document to fedora-legal@redhat.com. Please read this document carefully before signing and keep a copy for your records.
+
+ You and the Project hereby accept and agree to the following terms and conditions:
+
+
+
+ Contributors and Contributions.
+
+
+ The Project and any individual or legal entity that voluntarily submits to the Project a Contribution are collectively addressed herein as "Contributors". For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+
+ A "Contribution" is any original work, including any modification or addition to an existing work, that has been submitted for inclusion in, or documentation of, any of the products owned or managed by the Project, where such work originates from that particular Contributor or from some entity acting on behalf of that Contributor.
+
+
+ A Contribution is "submitted" when any form of electronic, verbal, or written communication is sent to the Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing or improving software or documentation of the Project, but excluding communication that is conspicuously marked or otherwise designated in writing by you as "Not a Contribution."
+
+
+ Any Contribution submitted by you to the Project shall be under the terms and conditions of this License, without any additional terms or conditions, unless you explicitly state otherwise in the submission.
+
+
+
+
+ Contributor Grant of License. You hereby grant to Red Hat, Inc., on behalf of the Project, and to recipients of software distributed by the Project:
+
+
+ a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your Contribution and such derivative works; and,
+
+
+ a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable (subject to Section 3) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contribution and derivative works thereof, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contribution alone or by combination of your Contribution with the work to which you submitted the Contribution. Except for the license granted in this section, you reserve all right, title and interest in and to your Contributions.
+
+
+
+
+ Reciprocity. As of the date any such litigation is filed, your patent grant shall immediately terminate with respect to any party that institutes patent litigation against you (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the work to which you have contributed, constitutes direct or contributory patent infringement.
+
+
+ You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Project, or that your employer has executed a separate Corporate CLA with the Project.
+
+
+ You represent that each of your Contributions is your original creation (see section 7 for submissions on behalf of others). You represent that your Contribution submission(s) include complete details of any third-party license or other restriction (including, but not limited to, related copyright, atents and trademarks) of which you are personally aware and which are associated with any part of your Contribution.
+
+
+ You are not expected to provide support for your Contributions, except to the extent you desire to provide support. You may provide support for free, for a fee, or not at all. Your Contributions are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+ Should you wish to submit work that is not your original creation, you may submit it to the Project separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
+
+
+ You agree to notify the Project of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
+
+
+ The Project is under no obligations to accept and include every contribution.
+
+
+
diff --git a/fas/build/lib/fas/templates/cla/cla.txt b/fas/build/lib/fas/templates/cla/cla.txt
new file mode 100644
index 0000000..7d6d482
--- /dev/null
+++ b/fas/build/lib/fas/templates/cla/cla.txt
@@ -0,0 +1,145 @@
+ The Fedora Project
+ Individual Contributor License Agreement (CLA)
+ http://fedoraproject.org/wiki/Legal/Licenses/CLA
+
+ Thank you for your interest in The Fedora Project (the
+ "Project"). In order to clarify the intellectual property license
+ granted with Contributions from any person or entity, Red hat,
+ Inc. ("Red Hat"), as maintainer of the Project, must have a
+ Contributor License Agreement (CLA) on file that has been signed
+ by each Contributor, indicating agreement to the license terms
+ below. This license is for Your protection as a Contributor as
+ well as the protection of the Project and its users; it does not
+ change your rights to use your own Contributions for any other
+ purpose.
+
+ If you have not already done so, please complete an original signed
+ Agreement. Use black ink, and hand-print or type the items other than
+ the signature. Send the completed Agreement to
+
+ Fedora Project, c/o Red Hat, Inc.,
+ Attn: Legal Affairs
+ 1801 Varsity Drive
+ Raleigh, North Carolina, 27606 U.S.A.
+
+ If necessary, you may send it by facsimile to the Project at
+ +1-919-754-3704 or e-mail a signed pdf copy of the document to
+ fedora-legal@redhat.com. Please read this document carefully before
+ signing and keep a copy for your records.
+
+ Full name: ${person.human_name} E-Mail: ${person.email}
+
+ Address:
+${person.postal_address}
+
+ Telephone: ${person.telephone}
+
+ Facsimile: ${person.facsimile}
+
+ You and the Project hereby accept and agree to the following terms and conditions:
+
+ 1. Contributors and Contributions.
+
+ A. The Project and any individual or legal entity that
+ voluntarily submits to the Project a Contribution are
+ collectively addressed herein as "Contributors". For legal
+ entities, the entity making a Contribution and all other
+ entities that control, are controlled by, or are under common
+ control with that entity are considered to be a single
+ Contributor. For the purposes of this definition, "control"
+ means (i) the power, direct or indirect, to cause the direction
+ or management of such entity, whether by contract or otherwise,
+ or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such
+ entity.
+
+ B. A "Contribution" is any original work, including any
+ modification or addition to an existing work, that has been
+ submitted for inclusion in, or documentation of, any of the
+ products owned or managed by the Project, where such work
+ originates from that particular Contributor or from some entity
+ acting on behalf of that Contributor.
+
+ C. A Contribution is "submitted" when any form of electronic,
+ verbal, or written communication is sent to the Project,
+ including but not limited to communication on electronic
+ mailing lists, source code control systems, and issue tracking
+ systems that are managed by, or on behalf of, the Project for
+ the purpose of discussing or improving software or
+ documentation of the Project, but excluding communication that
+ is conspicuously marked or otherwise designated in writing by
+ you as "Not a Contribution."
+
+ D. Any Contribution submitted by you to the Project shall be
+ under the terms and conditions of this License, without any
+ additional terms or conditions, unless you explicitly state
+ otherwise in the submission.
+
+ 2. Contributor Grant of License. You hereby grant to Red Hat,
+ Inc., on behalf of the Project, and to recipients of software
+ distributed by the Project:
+
+ (a) a perpetual, non-exclusive, worldwide, fully paid-up,
+ royalty free, irrevocable copyright license to reproduce,
+ prepare derivative works of, publicly display, publicly
+ perform, sublicense, and distribute your Contribution and such
+ derivative works; and,
+
+ (b) a perpetual, non-exclusive, worldwide, fully paid-up,
+ royalty free, irrevocable (subject to Section 3) patent license
+ to make, have made, use, offer to sell, sell, import, and
+ otherwise transfer your Contribution and derivative works
+ thereof, where such license applies only to those patent claims
+ licensable by you that are necessarily infringed by your
+ Contribution alone or by combination of your Contribution with
+ the work to which you submitted the Contribution. Except for
+ the license granted in this section, you reserve all right,
+ title and interest in and to your Contributions.
+
+ 3. Reciprocity. As of the date any such litigation is filed, your
+ patent grant shall immediately terminate with respect to any
+ party that institutes patent litigation against you (including
+ a cross-claim or counterclaim in a lawsuit) alleging that your
+ Contribution, or the work to which you have contributed,
+ constitutes direct or contributory patent infringement.
+
+ 4. You represent that you are legally entitled to grant the above
+ license. If your employer(s) has rights to intellectual
+ property that you create that includes your Contributions, you
+ represent that you have received permission to make
+ Contributions on behalf of that employer, that your employer
+ has waived such rights for your Contributions to the Project,
+ or that your employer has executed a separate Corporate CLA
+ with the Project.
+
+ 5. You represent that each of your Contributions is your original
+ creation (see section 7 for submissions on behalf of others).
+ You represent that your Contribution submission(s) include
+ complete details of any third-party license or other
+ restriction (including, but not limited to, related copyright,
+ atents and trademarks) of which you are personally aware and
+ which are associated with any part of your Contribution.
+
+ 6. You are not expected to provide support for your Contributions,
+ except to the extent you desire to provide support. You may
+ provide support for free, for a fee, or not at all. Your
+ Contributions are provided on an "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or
+ conditions of NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
+ A PARTICULAR PURPOSE.
+
+ 7. Should you wish to submit work that is not your original
+ creation, you may submit it to the Project separately from any
+ Contribution, identifying the complete details of its source
+ and of any license or other restriction (including, but not
+ limited to, related patents, trademarks, and license
+ agreements) of which you are personally aware, and
+ conspicuously marking the work as "Submitted on behalf of a
+ third-party: [named here]".
+
+ 8. You agree to notify the Project of any facts or circumstances
+ of which you become aware that would make these representations
+ inaccurate in any respect.
+
+ 9. The Project is under no obligations to accept and include every contribution.
diff --git a/fas/build/lib/fas/templates/cla/index.html b/fas/build/lib/fas/templates/cla/index.html
new file mode 100644
index 0000000..ff8f9e6
--- /dev/null
+++ b/fas/build/lib/fas/templates/cla/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+ ${_('Fedora Accounts System')}
+
+
+
${Markup(_('CLA not completed. To become a full Fedora Contributor please <a href="%s">complete the CLA</a>.') % tg.url('/cla/'))}
+
${Markup(_('You have not submitted an SSH key, some Fedora resources require an SSH key. Please submit yours by editing <a href="%s">My Account</a>') % tg.url('/user/edit'))}
+ ${Markup(_('Welcome to the Fedora Accounts System 2. Please submit bugs to <a href="https://fedorahosted.org/fas2">https://fedorahosted.org/fas2/</a> or stop by #fedora-admin on irc.freenode.net.'))}
+
IRC Nick is used to identify yourself on irc.freenode.net. Please register your nick on irc.freenode.net first, then fill this in so people can find you online when they need to
'],
- 'user_email' : ['Email (Required)', '
This email address should be your prefered email contact and will be used to send various official emails to. This is also where your @fedoraproject.org email will get forwarded
'],
- 'user_human_name' : ['Full Name (Required)', '
Your Human Name or "real life" name
'],
- 'user_gpg_keyid' : ['GPG Key', '
A GPG key is generally used to prove that a message or email came from you or to encrypt information so that only the recipients can read it. This can be used when a password reset is sent to your email.
'],
- 'user_telephone' : ['Telephone', '
Required in order to complete the CLA. Sometimes during a time of emergency someone from the Fedora Project may need to contact you. For more information see our Privacy Policy
'],
- 'user_postal_address': ['Postal Address', '
Required in order to complete the CLA. This should be a mailing address where you can be contacted. See our Privacy Policy about any concerns.
'],
- 'user_timezone': ['Timezone (Optional)', '
Please specify the time zone you are in.
'],
- 'user_comments': ['Comments (Optional)', '
Misc comments about yourself.
'],
- 'user_account_status': ['Account Status', '
Shows account status, possible values include
Valid
Disabled
Expired
'],
- 'user_cla' : ['CLA', '
In order to become a full Fedora contributor you must complete the Contributor License Agreement. This license is a legal agreement between you and Red Hat. Full status allows people to contribute content and code and is recommended for anyone interested in getting involved in the Fedora Project.
'],
- 'user_ssh_key' : ['Public SSH Key', '
Many resources require public key authentiaction to work. By uploading your public key to us, you can then log in to our servers. Type "man ssh-keygen" for more information on creating your key. Once created you will want to upload ~/.ssh/id_dsa.pub or ~/.ssh/id_rsa.pub
'],
- 'user_locale': ['Locale', '
For non-english speaking peoples this allows individuals to select which locale they are in.
'],
-
- 'group_apply': ['Apply', '
Applying for a group is like applying for a job and it can certainly take a while to get in. Many groups have their own rules about how to actually get approved or sponsored. For more information on how the account system works see the about page.
'],
- 'group_remove': ['Remove', '''
Removing a person from a group will cause that user to no longer be in the group. They will need to re-apply to get in. Admins can remove anyone, Sponsors can remove users, users can't remove anyone.
'''],
- 'group_upgrade': ['Upgrade', '''
Upgrade a persons status in this group.
from user -> to sponsor
From sponsor -> administrator
administrators cannot be upgraded beyond administrator
'''],
- 'group_downgrade': ['Downgrade', '''
Downgrade a persons status in the group.
from administrator -> to sponsor
From sponsor -> user
users cannot be downgraded below user, you may want to remove them
'''],
- 'group_approve': ['Approve', '''
A sponsor or administrator can approve users to be in a group. Once the user has applied for the group, go to the group's page and click approve to approve the user.
'''],
- 'group_sponsor': ['Sponsor', '''
A sponsor or administrator can sponsor users to be in a gruop. Once the user has applied for the group, go to the group's page and click approve to sponsor the user. Sponsorship of a user implies that you are approving a user and may mentor and answer their questions as they come up.
'''],
- 'group_user_add': ['Add User', '''
Manually add a user to a group. Place their username in this field and click 'Add'
'''],
- 'group_name': ['Group Name', '''
The name of the group you'd like to create. It should be alphanumeric though '-'s are allowed
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.
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
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.
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
${_('''FAS is designed around an open architecture. Unlike the traditional account systems where a single admin or group of admins decide who gets to be in what group, FAS is completely designed to be self operating per team. Every group is given at least one administrator who can then approve other people in the group. Also, unlike traditional account systems. FAS allows people to apply for the groups they want to be in. This paridigm is interesting as it allows anyone to find out who is in what groups and contact them. This openness is brought over from the same philosophies that make Open Source popular.''')}
-
${_('Etiquette')}
-
${_("People shouldn't assume that by applying for a group that they're then in that group. Consider it like applying for another job. It often takes time. For best odds of success, learn about the group you're applying for and get to know someone in the group. Find someone with sponsor or admin access and ask them if they'd have time to mentor you. Plan on spending at least a few days learning about the group, doing a mundain task, participating on the mailing list. Sometimes this process can take weeks depending on the group. It's best to know you will get sponsored before you apply.")}
-
${_('Users, Sponsors, Administrators')}
-
${_('''Once you're in the group, you're in the group. Sponsorship and Administrators typically have special access in the group in questions. Some groups consider sponsorship level to be of a higher involvement, partial ownership of the group for example. But as far as the account system goes the disctinction is easy. Sponsors can approve new users and make people into sponsors. They cannot, however, downgrade or remove other sponsors. They also cannot change administrators in any way. Administrators can do anything to anyone in the group.''')}
- Thank you for your interest in The Fedora Project (the "Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, Red hat, Inc. ("Red Hat"), as maintainer of the Project, must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for Your protection as a Contributor as well as the protection of the Project and its users; it does not change your rights to use your own Contributions for any other purpose.
-
-
- If you have not already done so, please complete an original signed Agreement. Use black ink, and hand-print or type the items other than the signature. Send the completed Agreement to
-
-
- Fedora Project, c/o Red Hat, Inc.,
- Attn: Legal Affairs
- 1801 Varsity Drive
- Raleigh, North Carolina, 27606 U.S.A.
-
-
- If necessary, you may send it by facsimile to the Project at +1-919-754-3704 or e-mail a signed pdf copy of the document to fedora-legal@redhat.com. Please read this document carefully before signing and keep a copy for your records.
-
- You and the Project hereby accept and agree to the following terms and conditions:
-
-
-
- Contributors and Contributions.
-
-
- The Project and any individual or legal entity that voluntarily submits to the Project a Contribution are collectively addressed herein as "Contributors". For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-
- A "Contribution" is any original work, including any modification or addition to an existing work, that has been submitted for inclusion in, or documentation of, any of the products owned or managed by the Project, where such work originates from that particular Contributor or from some entity acting on behalf of that Contributor.
-
-
- A Contribution is "submitted" when any form of electronic, verbal, or written communication is sent to the Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing or improving software or documentation of the Project, but excluding communication that is conspicuously marked or otherwise designated in writing by you as "Not a Contribution."
-
-
- Any Contribution submitted by you to the Project shall be under the terms and conditions of this License, without any additional terms or conditions, unless you explicitly state otherwise in the submission.
-
-
-
-
- Contributor Grant of License. You hereby grant to Red Hat, Inc., on behalf of the Project, and to recipients of software distributed by the Project:
-
-
- a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute your Contribution and such derivative works; and,
-
-
- a perpetual, non-exclusive, worldwide, fully paid-up, royalty free, irrevocable (subject to Section 3) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contribution and derivative works thereof, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contribution alone or by combination of your Contribution with the work to which you submitted the Contribution. Except for the license granted in this section, you reserve all right, title and interest in and to your Contributions.
-
-
-
-
- Reciprocity. As of the date any such litigation is filed, your patent grant shall immediately terminate with respect to any party that institutes patent litigation against you (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the work to which you have contributed, constitutes direct or contributory patent infringement.
-
-
- You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the Project, or that your employer has executed a separate Corporate CLA with the Project.
-
-
- You represent that each of your Contributions is your original creation (see section 7 for submissions on behalf of others). You represent that your Contribution submission(s) include complete details of any third-party license or other restriction (including, but not limited to, related copyright, atents and trademarks) of which you are personally aware and which are associated with any part of your Contribution.
-
-
- You are not expected to provide support for your Contributions, except to the extent you desire to provide support. You may provide support for free, for a fee, or not at all. Your Contributions are provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
-
-
- Should you wish to submit work that is not your original creation, you may submit it to the Project separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
-
-
- You agree to notify the Project of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
-
-
- The Project is under no obligations to accept and include every contribution.
-
-
-
diff --git a/fas/build/lib/fas/templates/cla/cla.txt b/fas/build/lib/fas/templates/cla/cla.txt
deleted file mode 100644
index 7d6d482..0000000
--- a/fas/build/lib/fas/templates/cla/cla.txt
+++ /dev/null
@@ -1,145 +0,0 @@
- The Fedora Project
- Individual Contributor License Agreement (CLA)
- http://fedoraproject.org/wiki/Legal/Licenses/CLA
-
- Thank you for your interest in The Fedora Project (the
- "Project"). In order to clarify the intellectual property license
- granted with Contributions from any person or entity, Red hat,
- Inc. ("Red Hat"), as maintainer of the Project, must have a
- Contributor License Agreement (CLA) on file that has been signed
- by each Contributor, indicating agreement to the license terms
- below. This license is for Your protection as a Contributor as
- well as the protection of the Project and its users; it does not
- change your rights to use your own Contributions for any other
- purpose.
-
- If you have not already done so, please complete an original signed
- Agreement. Use black ink, and hand-print or type the items other than
- the signature. Send the completed Agreement to
-
- Fedora Project, c/o Red Hat, Inc.,
- Attn: Legal Affairs
- 1801 Varsity Drive
- Raleigh, North Carolina, 27606 U.S.A.
-
- If necessary, you may send it by facsimile to the Project at
- +1-919-754-3704 or e-mail a signed pdf copy of the document to
- fedora-legal@redhat.com. Please read this document carefully before
- signing and keep a copy for your records.
-
- Full name: ${person.human_name} E-Mail: ${person.email}
-
- Address:
-${person.postal_address}
-
- Telephone: ${person.telephone}
-
- Facsimile: ${person.facsimile}
-
- You and the Project hereby accept and agree to the following terms and conditions:
-
- 1. Contributors and Contributions.
-
- A. The Project and any individual or legal entity that
- voluntarily submits to the Project a Contribution are
- collectively addressed herein as "Contributors". For legal
- entities, the entity making a Contribution and all other
- entities that control, are controlled by, or are under common
- control with that entity are considered to be a single
- Contributor. For the purposes of this definition, "control"
- means (i) the power, direct or indirect, to cause the direction
- or management of such entity, whether by contract or otherwise,
- or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such
- entity.
-
- B. A "Contribution" is any original work, including any
- modification or addition to an existing work, that has been
- submitted for inclusion in, or documentation of, any of the
- products owned or managed by the Project, where such work
- originates from that particular Contributor or from some entity
- acting on behalf of that Contributor.
-
- C. A Contribution is "submitted" when any form of electronic,
- verbal, or written communication is sent to the Project,
- including but not limited to communication on electronic
- mailing lists, source code control systems, and issue tracking
- systems that are managed by, or on behalf of, the Project for
- the purpose of discussing or improving software or
- documentation of the Project, but excluding communication that
- is conspicuously marked or otherwise designated in writing by
- you as "Not a Contribution."
-
- D. Any Contribution submitted by you to the Project shall be
- under the terms and conditions of this License, without any
- additional terms or conditions, unless you explicitly state
- otherwise in the submission.
-
- 2. Contributor Grant of License. You hereby grant to Red Hat,
- Inc., on behalf of the Project, and to recipients of software
- distributed by the Project:
-
- (a) a perpetual, non-exclusive, worldwide, fully paid-up,
- royalty free, irrevocable copyright license to reproduce,
- prepare derivative works of, publicly display, publicly
- perform, sublicense, and distribute your Contribution and such
- derivative works; and,
-
- (b) a perpetual, non-exclusive, worldwide, fully paid-up,
- royalty free, irrevocable (subject to Section 3) patent license
- to make, have made, use, offer to sell, sell, import, and
- otherwise transfer your Contribution and derivative works
- thereof, where such license applies only to those patent claims
- licensable by you that are necessarily infringed by your
- Contribution alone or by combination of your Contribution with
- the work to which you submitted the Contribution. Except for
- the license granted in this section, you reserve all right,
- title and interest in and to your Contributions.
-
- 3. Reciprocity. As of the date any such litigation is filed, your
- patent grant shall immediately terminate with respect to any
- party that institutes patent litigation against you (including
- a cross-claim or counterclaim in a lawsuit) alleging that your
- Contribution, or the work to which you have contributed,
- constitutes direct or contributory patent infringement.
-
- 4. You represent that you are legally entitled to grant the above
- license. If your employer(s) has rights to intellectual
- property that you create that includes your Contributions, you
- represent that you have received permission to make
- Contributions on behalf of that employer, that your employer
- has waived such rights for your Contributions to the Project,
- or that your employer has executed a separate Corporate CLA
- with the Project.
-
- 5. You represent that each of your Contributions is your original
- creation (see section 7 for submissions on behalf of others).
- You represent that your Contribution submission(s) include
- complete details of any third-party license or other
- restriction (including, but not limited to, related copyright,
- atents and trademarks) of which you are personally aware and
- which are associated with any part of your Contribution.
-
- 6. You are not expected to provide support for your Contributions,
- except to the extent you desire to provide support. You may
- provide support for free, for a fee, or not at all. Your
- Contributions are provided on an "AS IS" BASIS, WITHOUT
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or
- conditions of NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
- A PARTICULAR PURPOSE.
-
- 7. Should you wish to submit work that is not your original
- creation, you may submit it to the Project separately from any
- Contribution, identifying the complete details of its source
- and of any license or other restriction (including, but not
- limited to, related patents, trademarks, and license
- agreements) of which you are personally aware, and
- conspicuously marking the work as "Submitted on behalf of a
- third-party: [named here]".
-
- 8. You agree to notify the Project of any facts or circumstances
- of which you become aware that would make these representations
- inaccurate in any respect.
-
- 9. The Project is under no obligations to accept and include every contribution.
diff --git a/fas/build/lib/fas/templates/cla/index.html b/fas/build/lib/fas/templates/cla/index.html
deleted file mode 100644
index ff8f9e6..0000000
--- a/fas/build/lib/fas/templates/cla/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- ${_('Fedora Accounts System')}
-
-
-
${Markup(_('CLA not completed. To become a full Fedora Contributor please <a href="%s">complete the CLA</a>.') % tg.url('/cla/'))}
-
${Markup(_('You have not submitted an SSH key, some Fedora resources require an SSH key. Please submit yours by editing <a href="%s">My Account</a>') % tg.url('/user/edit'))}
- ${Markup(_('Welcome to the Fedora Accounts System 2. Please submit bugs to <a href="https://fedorahosted.org/fas2">https://fedorahosted.org/fas2/</a> or stop by #fedora-admin on irc.freenode.net.'))}
-