Merge branch 'master' of git://bzr.fedoraproject.org/hosted/fedora-infrastructure

This commit is contained in:
Toshio Kuratomi 2008-02-14 20:07:15 -08:00
commit c5078b9ce9
47 changed files with 685 additions and 501 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
architecture/Services.odg Normal file

Binary file not shown.

BIN
architecture/buildsys.flw Normal file

Binary file not shown.

BIN
architecture/buildsys.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Before After
Before After

View file

@ -7,8 +7,9 @@
#mail.server = 'bastion.fedora.phx.redhat.com'
#base_url_filter.base_url = "http://192.168.2.101:8080"
mail.on = False
mail.on = True
mail.server = 'bastion.fedora.phx.redhat.com'
mail.testmode = True
mail.debug = False
mail.encoding = 'utf-8'
@ -53,7 +54,7 @@ tg.strict_parameters = True
server.webpath='/fas'
base_url_filter.on=True
base_url = "http://publictest1.fedoraproject.org"
base_url_filter.base_url = "https://publictest1.fedoraproject.org/fas"
# Make the session cookie only return to the host over an SSL link
# Disabled for testing.

View file

@ -124,7 +124,7 @@ def canApplyGroup(userName, groupName, applyUserName, g=None):
try:
g[req].cn
except KeyError:
return False
return { 'status': False, 'requires': req }
# A user can apply themselves, and FAS admins can apply other people.
if (userName == applyUserName) or \
isAdmin(userName, g):

View file

@ -4,7 +4,7 @@ from turbogears import controllers, expose, paginate, identity, redirect, widget
import ldap
import cherrypy
import mx.DateTime
from datetime import datetime
import re
import gpgme
import StringIO
@ -69,7 +69,7 @@ class CLA(controllers.Controller):
return dict()
userName = turbogears.identity.current.user_name
user = Person.byUserName(userName)
return dict(type=type, user=user, date=str(mx.DateTime.now()))
return dict(type=type, user=user, date=datetime.utcnow().ctime())
@identity.require(turbogears.identity.not_anonymous())
@error_handler(error)
@ -78,7 +78,7 @@ class CLA(controllers.Controller):
'''Download CLA'''
userName = turbogears.identity.current.user_name
user = Person.byUserName(userName)
return dict(user=user, date=str(mx.DateTime.now()))
return dict(user=user, date=datetime.utcnow().ctime())
@identity.require(turbogears.identity.not_anonymous())
@error_handler(error)

View file

@ -24,6 +24,11 @@ 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)
# from fas import json
# import logging
# log = logging.getLogger("fas.controllers")
@ -49,9 +54,7 @@ class Root(controllers.RootController):
@expose(template="fas.templates.home")
@identity.require(identity.not_anonymous())
def home(self):
from feeds import Koji
builds = Koji(turbogears.identity.current.user_name)
return dict(builds=builds)
return dict()
@expose(template="fas.templates.login")
def login(self, forward_url=None, previous_url=None, *args, **kw):
@ -60,6 +63,8 @@ class Root(controllers.RootController):
and identity.was_login_attempted() \
and not identity.get_identity_errors():
turbogears.flash(_('Welcome, %s') % Person.byUserName(turbogears.identity.current.user_name).givenName)
if not forward_url:
forward_url = config.get('base_url_filter.base_url') + '/'
raise redirect(forward_url)
forward_url=None
@ -84,50 +89,4 @@ class Root(controllers.RootController):
def logout(self):
identity.current.logout()
turbogears.flash(_('You have successfully logged out.'))
raise redirect("/")
## TODO: Invitation cleanup- move out and validate!
@expose(template='fas.templates.inviteMember')
@identity.require(identity.not_anonymous())
def inviteMember(self, name=None, email=None, skills=None):
if name and email:
turbogears.flash(_('Invitation Sent to: "%(name)s" <%(email)s>') % {'name': name, 'email': email})
if name or email:#FIXME
turbogears.flash(_('Please provide both an email address and the persons name.'))
return dict()
@expose(format="json")
def search(self, userName=None, groupName=None):
people = Person.users('%s*' % userName)
return dict(people=
filter(lambda item: userName in item.lower(), people))
@expose(template='fas.templates.invite')
@identity.require(identity.not_anonymous())
def invite(self, target=None):
import turbomail
user = Person.byUserName(turbogears.identity.current.user_name)
if target:
message = turbomail.Message(user.mail, 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/wiki/Join 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': user.givenName, 'email': user.mail}
turbomail.enqueue(message)
turbogears.flash(_('Message sent to: %s') % target)
return dict(target=target, user=user)
def relativeUser(realUser, sudoUser):
''' Takes user and sees if they are allow to sudo for remote group'''
p = Person.byUserName('realUser')
raise redirect(request.headers.get("Referer", "/"))

View file

@ -26,31 +26,81 @@ python-fedora, python module to interact with Fedora Infrastructure Services
import ldap
from ldap import modlist
import datetime
import time
from random import Random
import sha
from base64 import b64encode
import sys
import os
dbName = 'fastest'
class AuthError(Exception):
pass
def retrieve_db_info(dbKey):
'''Retrieve information to connect to the db from the filesystem.
Arguments:
:dbKey: The string identifying the database entry in the config file.
Returns: A dictionary containing the values to use in connecting to the
database.
Exceptions:
:IOError: Returned if the config file is not on the system.
:AuthError: Returned if there is no record found for dbKey in the
config file.
'''
# Open a filehandle to the config file
if os.environ.has_key('HOME') and os.path.isfile(
os.path.join(os.environ.get('HOME'), '.fedora-db-access')):
fh = file(os.path.join(
os.environ.get('HOME'), '.fedora-db-access'), 'r')
elif os.path.isfile('/etc/sysconfig/fedora-db-access'):
fh = file('/etc/sysconfig/fedora-db-access', 'r')
else:
raise IOError, 'fedora-db-access file does not exist.'
# Read the file until we get the information for the requested db
dbInfo = None
for line in fh.readlines():
if not line:
break
line = line.strip()
if not line or line[0] == '#':
continue
pieces = line.split(None, 1)
if len(pieces) < 2:
continue
if pieces[0] == dbKey:
dbInfo = eval(pieces[1])
break
if fh:
fh.close()
if not dbInfo:
raise AuthError, 'Authentication source "%s" not configured' % (dbKey,)
return dbInfo
class Server(object):
def __init__(self, server=None, who=None, password=None):
### FIXME: Before deploy, get the default server, user, and password
# from the fedora-db-access file.
server = server or 'localhost'
who = who or 'cn=directory manager'
password = password or 'test'
try:
dbInfo = retrieve_db_info(dbName)
except IOError:
raise AuthError, 'Authentication config file fedora-db-access is' \
' not available'
server = server or dbInfo['host'] or 'localhost'
who = 'cn=%s' % (who or dbInfo['user'])
# Some db connections have no password
password = password or dbInfo.get('password')
self.ldapConn = ldap.open(server)
self.ldapConn.simple_bind_s(who, password)
def add(self, base, attributes):
''' Add a new group record to LDAP instance '''
attributes=[ (k, v) for k,v in attributes.items() ]
self.ldapConn.add_s(base, attributes)
self.ldapConn.add_s(base, attributes.items())
def delete(self, base):
''' Delete target base '''
@ -60,7 +110,7 @@ class Server(object):
''' Modify an attribute, requires write access '''
if new is None:
return None
new = str(new)
new = unicode(new).encode('utf-8')
if new == old:
return None
@ -130,17 +180,17 @@ class Group(object):
}
@classmethod
def newGroup(self, cn, fedoraGroupDesc, fedoraGroupOwner, fedoraGroupNeedsSponsor, fedoraGroupUserCanRemove, fedoraGroupRequires, fedoraGroupJoinMsg):
def newGroup(self, cn, fedoraGroupDesc, fedoraGroupOwner, fedoraGroupType, fedoraGroupNeedsSponsor, fedoraGroupUserCanRemove, fedoraGroupRequires, fedoraGroupJoinMsg):
''' Create a new group '''
attributes = { 'cn' : cn,
attributes = { 'cn' : cn.encode('utf-8'),
'objectClass' : ('fedoraGroup'),
'fedoraGroupDesc' : fedoraGroupDesc,
'fedoraGroupOwner' : fedoraGroupOwner,
'fedoraGroupType' : '1',
'fedoraGroupNeedsSponsor' : fedoraGroupNeedsSponsor,
'fedoraGroupUserCanRemove' : fedoraGroupUserCanRemove,
'fedoraGroupRequires' : fedoraGroupRequires,
'fedoraGroupJoinMsg' : fedoraGroupJoinMsg,
'fedoraGroupDesc' : fedoraGroupDesc.encode('utf-8'),
'fedoraGroupOwner' : fedoraGroupOwner.encode('utf-8'),
'fedoraGroupType' : fedoraGroupType.encode('utf-8'),
'fedoraGroupNeedsSponsor' : fedoraGroupNeedsSponsor.encode('utf-8'),
'fedoraGroupUserCanRemove' : fedoraGroupUserCanRemove.encode('utf-8'),
'fedoraGroupRequires' : fedoraGroupRequires.encode('utf-8'),
'fedoraGroupJoinMsg' : fedoraGroupJoinMsg.encode('utf-8'),
}
self.__server.add('cn=%s,%s' % (cn, self.__base), attributes)
@ -271,17 +321,10 @@ class Groups(object):
except TypeError:
raise TypeError, 'Group "%s" does not exist' % groupName
dt = datetime.datetime.now()
now = '%.2i-%.2i-%.2i %.2i:%.2i:%.2i.%.2i' % (dt.year,
dt.month,
dt.day,
dt.hour,
dt.minute,
dt.second,
dt.microsecond)
now = time.time()
attributes = { 'cn' : groupName,
'fedoraRoleApprovaldate' : 'NotApproved',
attributes = { 'cn' : groupName.encode('utf-8'),
'fedoraRoleApprovaldate' : 'None',
'fedoraRoleCreationDate' : str(now),
'fedoraRoleDomain' : 'None',
'fedoraRoleSponsor' : 'None',
@ -335,33 +378,27 @@ class Person(object):
@classmethod
def newPerson(self, cn, givenName, mail, telephoneNumber, postalAddress):
''' Create a new user '''
dt = datetime.datetime.now()
now = '%.2i-%.2i-%.2i %.2i:%.2i:%.2i.%.2i' % (dt.year,
dt.month,
dt.day,
dt.hour,
dt.minute,
dt.second,
dt.microsecond)
attributes = { 'cn' : cn,
now = time.time()
attributes = { 'cn' : cn.encode('utf-8'),
'objectClass' : ('fedoraPerson', 'inetOrgPerson', 'organizationalPerson', 'person', 'top'),
'displayName' : cn,
'sn' : cn,
'cn' : cn,
'displayName' : cn.encode('utf-8'),
'sn' : cn.encode('utf-8'),
'cn' : cn.encode('utf-8'),
'fedoraPersonSshKey' : '',
'facsimileTelephoneNumber' : '',
'fedoraPersonApprovalStatus' : 'approved',
'givenName' : givenName,
'mail' : mail,
'givenName' : givenName.encode('utf-8'),
'mail' : mail.encode('utf-8'),
'fedoraPersonKeyId' : '',
'fedoraPersonCertSerial' : -1,
'fedoraPersonCertSerial' : '-1',
'description' : '',
'fedoraPersonCreationDate' : str(now),
'telephoneNumber' : telephoneNumber,
'fedoraPersonBugzillaMail' : mail,
'postalAddress' : postalAddress,
'telephoneNumber' : telephoneNumber.encode('utf-8'),
'fedoraPersonBugzillaMail' : mail.encode('utf-8'),
'postalAddress' : postalAddress.encode('utf-8'),
'fedoraPersonIrcNick' : '',
'userPassword' : 'Disabled'
'userPassword' : 'Disabled',
'fedoraPersonTimeZone' : 'UTC',
}
self.__server.add('cn=%s,%s' % (cn, self.__base), attributes)
attributes = {
@ -475,14 +512,7 @@ class Person(object):
base = 'cn=%s,ou=Roles,cn=%s,ou=People,dc=fedoraproject,dc=org' % (groupName, self.cn)
g = Groups.byGroupName(groupName, includeUnapproved=True)[self.cn]
group = Groups.groups(groupName)[groupName]
dt = datetime.datetime.now()
now = '%.2i-%.2i-%.2i %.2i:%.2i:%.2i.%.2i' % (dt.year,
dt.month,
dt.day,
dt.hour,
dt.minute,
dt.second,
dt.microsecond)
now = time.time()
self.__server.modify(base, 'fedoraRoleApprovalDate', now)
if group.fedoraGroupNeedsSponsor.lower() == 'true':
self.__server.modify(base, 'fedoraRoleSponsor', sponsor)

View file

@ -64,6 +64,10 @@ class userNameGroupNameExists(validators.Schema):
class groupNameExists(validators.Schema):
groupName = validators.All(knownGroup(not_empty=True, max=10), validators.String(max=32, min=3))
class groupInvite(validators.Schema):
groupName = validators.All(knownGroup(not_empty=True, max=10), validators.String(max=32, min=3))
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))
@ -92,6 +96,22 @@ class Group(controllers.Controller):
turbogears.redirect('/')
return dict(tg_errors=tg_errors)
@expose(format="json")
def exportShellAccounts(self):
''' Replaces old "exportShellAccounts.py" '''
userList = Groups.byGroupName('sysadmin-main')
user = Person.byUserName('mmcgrath').givenName
users = {}
for user in userList.keys():
u = Person.byUserName(user)
users[user] = {
'userName' : u.cn,
'password' : u.userPassword,
'sshKey' : u.fedoraPersonSshKey,
}
groups = Groups.groups('*')
return dict(users=users, groups=groups)
@identity.require(turbogears.identity.not_anonymous())
@validate(validators=groupNameExists())
@error_handler(error)
@ -118,7 +138,8 @@ class Group(controllers.Controller):
me = groups[userName]
except:
me = UserGroup()
return dict(userName=userName, groups=groups, group=group, me=me)
u = Person.byUserName(userName)
return dict(userName=userName, u=u, groups=groups, group=group, me=me)
@identity.require(turbogears.identity.not_anonymous())
@expose(template="fas.templates.group.new")
@ -134,7 +155,7 @@ class Group(controllers.Controller):
@validate(validators=createGroup())
@error_handler(error)
@expose(template="fas.templates.group.new")
def create(self, groupName, fedoraGroupDesc, fedoraGroupOwner, fedoraGroupNeedsSponsor='FALSE', fedoraGroupUserCanRemove='FALSE', fedoraGroupRequires='', fedoraGroupJoinMsg=''):
def create(self, groupName, fedoraGroupDesc, fedoraGroupOwner, fedoraGroupType, fedoraGroupNeedsSponsor='FALSE', fedoraGroupUserCanRemove='FALSE', fedoraGroupRequires='', fedoraGroupJoinMsg=''):
'''Create a group'''
userName = turbogears.identity.current.user_name
if not canCreateGroup(userName):
@ -144,6 +165,7 @@ class Group(controllers.Controller):
fas.fasLDAP.Group.newGroup(groupName,
fedoraGroupDesc,
fedoraGroupOwner,
fedoraGroupType,
fedoraGroupNeedsSponsor,
fedoraGroupUserCanRemove,
fedoraGroupRequires,
@ -182,7 +204,7 @@ class Group(controllers.Controller):
@validate(validators=editGroup())
@error_handler(error)
@expose()
def save(self, groupName, fedoraGroupDesc, fedoraGroupOwner, fedoraGroupType=1, fedoraGroupNeedsSponsor="FALSE", fedoraGroupUserCanRemove="FALSE", fedoraGroupRequires="", fedoraGroupJoinMsg=""):
def save(self, groupName, fedoraGroupDesc, fedoraGroupOwner, fedoraGroupType, fedoraGroupNeedsSponsor="FALSE", fedoraGroupUserCanRemove="FALSE", fedoraGroupRequires="", fedoraGroupJoinMsg=""):
'''Edit a group'''
userName = turbogears.identity.current.user_name
if fedoraGroupRequires is None:
@ -233,9 +255,9 @@ class Group(controllers.Controller):
applicant = turbogears.identity.current.user_name
if not userName:
userName = applicant
if not canApplyGroup(applicant, groupName, userName):
turbogears.flash(_('%(user)s could not apply to %(group)s!') % \
{'user': userName, 'group': groupName})
if not canApplyGroup(applicant, groupName, userName)['status']:
turbogears.flash(_('%(user)s could not apply to %(group)s! This group requires membership in %(requires)s') % \
{'user': userName, 'group': groupName, 'requires': canApplyGroup(applicant, groupName, userName)['requires']})
turbogears.redirect('/group/view/%s' % groupName)
return dict()
else:
@ -287,16 +309,13 @@ class Group(controllers.Controller):
group = Groups.groups(groupName)[groupName]
import turbomail
message = turbomail.Message(config.get('accounts_mail'), p.mail, "Your Fedora '%s' membership has been sponsored" % groupName)
user = Person.byUserName(userName)
name = user.givenName
email = user.mail
message.plain = dedent('''
%(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': groupName, 'name': name, 'email': email, 'joinmsg': group.fedoraGroupJoinMsg}
''') % {'group': groupName, 'name': user.givenName, 'email': user.mail, 'joinmsg': group.fedoraGroupJoinMsg}
turbomail.enqueue(message)
turbogears.flash(_("'%s' has been sponsored!") % p.cn)
turbogears.redirect('/group/view/%s' % groupName)
@ -322,18 +341,16 @@ class Group(controllers.Controller):
{'name': userName, 'group': groupName})
turbogears.redirect('/group/view/%s' % groupName)
else:
user = Person.byUserName(sponsor)
import turbomail
message = turbomail.Message(config.get('accounts_mail'), p.mail, "Your Fedora '%s' membership has been removed" % groupName)
sponsor = Person.byUserName(sponsor)
user = Person.byUserName(userName)
name = user.givenName
email = user.mail
message = turbomail.Message(config.get('accounts_mail'), user.mail, "Your Fedora '%s' membership has been removed" % groupName)
message.plain = dedent('''
%(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': groupName, 'name': name, 'email': email}
''') % {'group': groupName, 'name': sponsor.name, 'email': sponsor.mail}
turbomail.enqueue(message)
turbogears.flash(_('%(name)s has been removed from %(group)s!') % \
{'name': userName, 'group': groupName})
@ -367,8 +384,6 @@ class Group(controllers.Controller):
import turbomail
message = turbomail.Message(config.get('accounts_mail'), p.mail, "Your Fedora '%s' membership has been upgraded" % groupName)
user = Person.byUserName(userName)
name = user.givenName
email = user.mail
g = Groups.byUserName(userName)
status = g[groupName].fedoraRoleType.lower()
message.plain = dedent('''
@ -376,7 +391,7 @@ class Group(controllers.Controller):
'%(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': groupName, 'name': name, 'email': email, 'status': status}
''') % {'group': groupName, 'name': user.givenName, 'email': user.mail, 'status': status}
turbomail.enqueue(message)
turbogears.flash(_('%s has been upgraded!') % userName)
turbogears.redirect('/group/view/%s' % groupName)
@ -438,3 +453,45 @@ class Group(controllers.Controller):
groups = Groups.byGroupName(groupName)
return dict(groups=groups, Person=Person)
@identity.require(identity.not_anonymous())
@validate(validators=groupNameExists())
@error_handler(error)
@expose(template='fas.templates.group.invite')
def invite(self, groupName):
userName = turbogears.identity.current.user_name
user = Person.byUserName(userName)
return dict(user=user, group=groupName)
@identity.require(identity.not_anonymous())
@validate(validators=groupNameExists())
@error_handler(error)
@expose(template='fas.templates.group.invite')
def sendinvite(self, groupName, target=None):
import turbomail
userName = turbogears.identity.current.user_name
user = Person.byUserName(userName)
if isApproved(userName, groupName):
message = turbomail.Message(user.mail, target, _('Come join The Fedora Project!'))
message.plain = _(dedent('''
%(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': user.givenName, 'email': user.mail}
turbomail.enqueue(message)
turbogears.flash(_('Message sent to: %s') % target)
turbogears.redirect('/group/view/%s' % groupName)
else:
turbogears.flash(_("You are not in the '%s' group.") % groupName)
return dict(target=target, user=user)

View file

@ -225,7 +225,7 @@ a
.userbox dd
{
margin-left: 22ex;
margin-left: 24ex;
}
.account
@ -324,6 +324,11 @@ a
background: url(/fas/static/images/queue.png) 0 50% no-repeat;
}
#rolespanel .queue strong
{
color: #222222;
}
#footer
{
font-size: 1.6ex;

View file

@ -4,19 +4,19 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<!-- Click-through CLA -->
<h2>Contributor License Agreement</h2>
<h2>${_('Contributor License Agreement')}</h2>
<xi:include href="cla.html" />
<form action="${tg.url('/cla/click/%s' % userName)}" method="post">
<div>
If you agree to these terms and conditions, type "I agree" here: <input type="text" id="agree" name="agree" /><br />
Full Name: ${user.givenName}<br />
E-mail: ${user.mail}<br />
Date: ${date}<br />
<input type="submit" value="Submit CLA" />
${_('If you agree to these terms and conditions, type "I agree" here:')} <input type="text" id="agree" name="agree" /><br />
${_('Full Name:')} ${user.givenName}<br />
${_('E-mail:')} ${user.mail}<br />
${_('Date:')} ${date}<br />
<input type="submit" value="${_('Submit CLA')}" />
</div>
</form>
</body>

View file

@ -4,19 +4,19 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<h2>Fedora Contributor License Agreement</h2>
<h2>${_('Fedora Contributor License Agreement')}</h2>
<p>
There are two ways to sign the CLA... <a href="http://fedoraproject.org/wiki/Legal/CLAAcceptanceHierarchies">CLA Acceptance Hierarchies</a>
${Markup(_('There are two ways to sign the CLA. Most users will want to do a signed CLA as it will promote them to a full contributor in Fedora. The click-through CLA only grants partial access but may be preferred for those with special legal considerations. See: &lt;a href="http://fedoraproject.org/wiki/Legal/CLAAcceptanceHierarchies"&gt;CLA Acceptance Hierarchies&lt;/a&gt; for more information.'))}
</p>
<ul py:if="not signedCLA">
<li><a href="${tg.url('/cla/view/sign')}">Signed CLA</a></li>
<li py:if="not clickedCLA"><a href="${tg.url('/cla/view/click')}">Click-through CLA</a></li>
<li><a href="${tg.url('/cla/view/sign')}">${_('Signed CLA')}</a></li>
<li py:if="not clickedCLA"><a href="${tg.url('/cla/view/click')}">${_('Click-through CLA')}</a></li>
</ul>
<p py:if="signedCLA">
Congratulations, you have already sucessfully signed the <a href="${tg.url('/cla/view')}">CLA</a>.
${Markup(_('You have already sucessfully signed the &lt;a href="%s"&gt;CLA&lt;/a&gt;.') % tg.url('/cla/view'))}
</p>
</body>
</html>

View file

@ -4,20 +4,20 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<!-- Signed CLA -->
<h2>Contributor License Agreement</h2>
<h2>${_('Contributor License Agreement')}</h2>
<p>
Use the below link to download/save the CLA as fedora-icla-${tg.identity.user.user_name}.txt, run gpg -as fedora-icla-${tg.identity.user.user_name}.txt, and upload fedora-icla-${tg.identity.user.user_name}.txt.asc in the form below.
${_('Use the below link to download/save the CLA as fedora-icla-%(user)s.txt, run gpg -as fedora-icla-${tg.identity.user.user_name}.txt, and upload fedora-icla-%(user)s.txt.asc in the form below.') % {'user': tg.identity.user.user_name}}
</p>
<a href="${tg.url('/cla/download')}">Download the CLA text file here!</a>
<a href="${tg.url('/cla/download')}">${_('Download the CLA text file here!')}</a>
<form action="${tg.url('/cla/sign')}" method="post" enctype="multipart/form-data">
<div>
<label for="signature">Signed CLA:</label> <input type="file" id="signature" name="signature" /><br />
<input type="submit" value="Submit CLA" />
<label for="signature">${_('Signed CLA:')}</label> <input type="file" id="signature" name="signature" /><br />
<input type="submit" value="${_('Submit CLA')}" />
</div>
</form>
</body>

View file

@ -4,11 +4,11 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<!-- Click-through CLA -->
<h2>Contributor License Agreement</h2>
<h2>${_('Contributor License Agreement')}</h2>
<div py:if="type is None" py:strip=''>
<xi:include href="cla.html" />
</div>
@ -17,28 +17,28 @@
<xi:include href="cla.html" />
<form action="${tg.url('/cla/click')}" method="post">
<div>
If you agree to these terms and conditions, type "I agree" here: <input type="text" id="agree" name="agree" /><br />
Full Name: ${user.givenName}<br />
E-mail: ${user.mail}<br />
Date: ${date}<br />
<input type="submit" value="Submit CLA" />
${_('If you agree to these terms and conditions, type "I agree" here:')} <input type="text" id="agree" name="agree" /><br />
${_('Full Name:')} ${user.givenName}<br />
${_('E-mail:')} ${user.mail}<br />
${_('Date:')} ${date}<br />
<input type="submit" value="${_('Submit CLA')}" />
</div>
</form>
</div>
<div py:if="type == 'sign'" py:strip=''>
<p>
Use the below link to download/save the CLA as fedora-icla-${user.cn}.txt, and run:
<pre>gpg -as fedora-icla-${user.cn}.txt</pre>
After, upload fedora-icla-${user.cn}.txt.asc in the form below.
${_('Use the below link to download/save the CLA as fedora-icla-${user.cn}.txt, and run:
&lt;pre&gt;gpg -as fedora-icla-${user.cn}.txt&lt;/pre&gt;
After, upload fedora-icla-${user.cn}.txt.asc in the form below.')}
</p>
<p>
<a href="${tg.url('/cla/download')}">Download the CLA text file here!</a>
<a href="${tg.url('/cla/download')}">${_('Download the CLA text file here!')}</a>
</p>
<form action="${tg.url('/cla/sign')}" method="post" enctype="multipart/form-data">
<div>
<label for="signature">Signed CLA:</label> <input type="file" id="signature" name="signature" /><br />
<input type="submit" value="Submit CLA" />
<label for="signature">${_('Signed CLA:')}</label> <input type="file" id="signature" name="signature" /><br />
<input type="submit" value="${_('Submit CLA')}" />
</div>
</form>
</div>

View file

@ -4,7 +4,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
<style type="text/css">
#content ul
{
@ -14,8 +14,8 @@
</style>
</head>
<body>
<h2>Error!</h2>
<p>The following error(s) have occured with your request:</p>
<h2>${_('Error!')}</h2>
<p>${_('The following error(s) have occured with your request:')}</p>
<ul>
<li py:for="field, error in tg_errors.items()">
${field}: ${str(error)}

View file

@ -4,39 +4,39 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Edit Group</title>
<title>${_('Edit Group')}</title>
</head>
<body>
<h2>Edit Group: ${group.cn}</h2>
<h2>${_('Edit Group: %s') % group.cn}</h2>
<form action="${tg.url('/group/save/%s' % group.cn)}" method="post">
<div class="field">
<label for="fedoraGroupDesc">Description:</label>
<label for="fedoraGroupDesc"${_('Description:')}/label>
<input type="text" id="fedoraGroupDesc" name="fedoraGroupDesc" value="${group.fedoraGroupDesc}" />
</div>
<div class="field">
<label for="fedoraGroupOwner">Group Owner:</label>
<label for="fedoraGroupOwner"${_('Group Owner:')}/label>
<input type="text" id="fedoraGroupOwner" name="fedoraGroupOwner" value="${group.fedoraGroupOwner}" />
</div>
<div class="field">
<label for="fedoraGroupNeedsSponsor">Needs Sponsor:</label>
<label for="fedoraGroupNeedsSponsor"${_('Needs Sponsor:')}/label>
<input py:if="group.fedoraGroupNeedsSponsor" type="checkbox" id="fedoraGroupNeedsSponsor" name="fedoraGroupNeedsSponsor" value="TRUE" checked="checked" />
<input py:if="not group.fedoraGroupNeedsSponsor" type="checkbox" id="fedoraGroupNeedsSponsor" name="fedoraGroupNeedsSponsor" value="TRUE" />
</div>
<div class="field">
<label for="fedoraGroupUserCanRemove">Self Removal:</label>
<label for="fedoraGroupUserCanRemove"${_('Self Removal:')}/label>
<input py:if="group.fedoraGroupUserCanRemove" type="checkbox" id="fedoraGroupUserCanRemove" name="fedoraGroupUserCanRemove" value="TRUE" checked="checked" />
<input py:if="not group.fedoraGroupUserCanRemove" type="checkbox" id="fedoraGroupUserCanRemove" name="fedoraGroupUserCanRemove" value="TRUE" />
</div>
<div class="field">
<label for="fedoraGroupRequires">Must Belong To:</label>
<label for="fedoraGroupRequires"${_('Must Belong To:')}/label>
<input type="text" id="fedoraGroupRequires" name="fedoraGroupRequires" value="${group.fedoraGroupRequires}" />
</div>
<div class="field">
<label for="fedoraGroupJoinMsg">Group Join Message:</label>
<input type="text" id="fedoraGroupJoinMsg" name="fedoraGroupJoinMsg" value="${group.fedoraGroupJoinMsg}" />
<label for="fedoraGroupJoinMsg"${_('Group Join Message:')}/label>
<textarea id="fedoraGroupJoinMsg" name="fedoraGroupJoinMsg">${group.fedoraGroupJoinMsg}</textarea>
</div>
<div class="field">
<input type="submit" value="Save!" />
<input type="submit" value="${_('Save!')}" />
</div>
</form>
</body>

View file

@ -2,18 +2,19 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<xi:include href="../master.html" />
<head>
<title>Invite a new community member!</title>
<title>${_('Invite a new community member!')}</title>
</head>
<body>
<h2>Invite a new community member!</h2>
<form method="post">
<h2>${_('Invite a new community member!')}</h2>
<form method="post" action="${tg.url('/group/sendinvite/%s') % group}">
<div>
To email: <input type="text" value="" name="target" /><br />
From: ${user.mail}<br />
Subject: Invitation to join the Fedora Team!<br />
Message:
<!--TODO: Make the email translatable -->
${_('To email:')} <input type="text" value="" name="target" /><br />
${_('From:)} ${user.mail}<br />
${_('Subject:')} Invitation to join the Fedora Team!<br />
${_('Message:')}
<div class="message">
<p>
${user.givenName} &lt;<a href="mailto: ${user.mail}">${user.mail}</a>&gt; has invited you to join the Fedora
@ -25,7 +26,7 @@
</p>
<p>
How could you team up with the Fedora community to use and develop your
skills? Check out http://fedoraproject.org/wiki/Join for some ideas.
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
@ -35,7 +36,7 @@
Fedora and FOSS are changing the world -- come be a part of it!
</p>
</div>
<input type="submit" value="Send" />
<input type="submit" value="${_('Send!')}" />
</div>
</form>
</body>

View file

@ -4,28 +4,28 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Groups List</title>
<title>${_('Groups List')}</title>
</head>
<body>
<?python from fas import auth ?>
<h2>List (${search})</h2>
<h3>Search Groups</h3>
<h2>${_('List (%s)') % search}</h2>
<h3>${_('Search Groups')}</h3>
<form method="get" action="${tg.url('/group/list')}">
<p>"*" is a wildcard (Ex: "cvs*")</p>
<p>${_('"*" is a wildcard (Ex: "cvs*")')}</p>
<div>
<input type="text" value="${search}" name="search" size="15 "/>
<input type="submit" value="Search" />
<input type="submit" value="${_('Search')}" />
</div>
</form>
<h3>Results</h3>
<h3>${_('Results')}</h3>
<ul class="letters">
<li py:for="letter in 'abcdefghijklmnopqrstuvwxyz'.upper()"><a href="${tg.url('/group/list/%s*' % letter)}">${letter}</a></li>
<li><a href="${tg.url('/group/list/*')}">All</a></li>
<li><a href="${tg.url('/group/list/*')}">${_('All')}</a></li>
</ul>
<table py:if="groups">
<thead>
<tr><th>Group</th><th>Description</th><th>Status</th></tr>
<tr><th>${_('Group')}</th><th>${_('Description')}</th><th>${_('Status')}</th></tr>
</thead>
<tbody>
<tr py:for="group in sorted(groups.keys())">
@ -34,10 +34,10 @@
<td>${groups[group].fedoraGroupDesc}</td>
<td>
<a py:if="group in myGroups" href="${tg.url('/group/view/%s' % group)}">
<span class="approved" py:if="myGroups[group].fedoraRoleStatus.lower() == 'approved'">Approved</span>
<span class="unapproved" py:if="myGroups[group].fedoraRoleStatus.lower() == 'unapproved'">Unapproved</span>
<span class="approved" py:if="myGroups[group].fedoraRoleStatus.lower() == 'approved'">${_('Approved')}</span>
<span class="unapproved" py:if="myGroups[group].fedoraRoleStatus.lower() == 'unapproved'">${_('Unapproved')}</span>
</a>
<a py:if="group not in myGroups" href="${tg.url('/group/apply/%s/%s' % (group, tg.identity.user.user_name))}"><span>Apply</span></a>
<a py:if="group not in myGroups" href="${tg.url('/group/apply/%s/%s' % (group, tg.identity.user.user_name))}"><span>${_('Apply')}</span></a>
</td>
</div>
</tr>

View file

@ -4,41 +4,45 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Create a new FAS Group</title>
<title>${_('Create a new FAS Group')}</title>
</head>
<body>
<h2>Create a new FAS Group</h2>
<h2>${_('Create a new FAS Group')}</h2>
<form action="${tg.url('/group/create')}" method="post">
<div class="field">
<label for="groupName">Group Name:</label>
<label for="groupName"${_('Group Name:')}/label>
<input type="text" id="groupName" name="groupName" />
</div>
<div class="field">
<label for="fedoraGroupDesc">Description:</label>
<label for="fedoraGroupDesc"${_('Description:')}/label>
<input type="text" id="fedoraGroupDesc" name="fedoraGroupDesc" />
</div>
<div class="field">
<label for="fedoraGroupOwner">Group Owner:</label>
<label for="fedoraGroupOwner"${_('Group Owner:')}/label>
<input type="text" id="fedoraGroupOwner" name="fedoraGroupOwner" />
</div>
<div class="field">
<label for="fedoraGroupNeedsSponsor">Needs Sponsor:</label>
<label for="fedoraGroupType"${_('Group Type:')}/label>
<input type="text" id="fedoraGroupType" name="fedoraGroupType" value="tracking" />
</div>
<div class="field">
<label for="fedoraGroupNeedsSponsor"${_('Needs Sponsor:')}/label>
<input type="checkbox" id="fedoraGroupNeedsSponsor" name="fedoraGroupNeedsSponsor" value="TRUE" checked="checked" />
</div>
<div class="field">
<label for="fedoraGroupUserCanRemove">Self Removal:</label>
<label for="fedoraGroupUserCanRemove"${_('Self Removal:')}/label>
<input type="checkbox" id="fedoraGroupUserCanRemove" name="fedoraGroupUserCanRemove" value="TRUE" checked="checked" />
</div>
<div class="field">
<label for="fedoraGroupRequires">Must Belong To:</label>
<label for="fedoraGroupRequires"${_('Must Belong To:')}/label>
<input type="text" id="fedoraGroupRequires" name="fedoraGroupRequires" value="cla_done" />
</div>
<div class="field">
<label for="fedoraGroupJoinMsg">Join Message:</label>
<input type="text" id="fedoraGroupJoinMsg" name="fedoraGroupJoinMsg" />
<label for="fedoraGroupJoinMsg"${_('Join Message:')}/label>
<textarea id="fedoraGroupJoinMsg" name="fedoraGroupJoinMsg"></textarea>
</div>
<div class="field">
<input type="submit" value="Create!" />
<input type="submit" value="${_('Create!')}" />
</div>
</form>
</body>

View file

@ -4,66 +4,71 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Edit Group</title>
<title>${_('Edit Group')}</title>
</head>
<body>
<?python from fas import auth ?>
<h2>${group.fedoraGroupDesc} (${group.cn})</h2>
<h3>
My Status:
<span py:if="auth.isApproved(userName, group.cn)" class="approved">Approved</span>
<span py:if="not auth.isApproved(userName, group.cn)" class="unapproved">Unapproved</span>
<span py:if="'Not a Member' in me.fedoraRoleStatus">Not a Member</span>
${_('My Status:')}
<span py:if="auth.isApproved(userName, group.cn)" class="approved">${_('Approved')}</span>
<span py:if="not auth.isApproved(userName, group.cn)" class="unapproved">${_('Unapprove')}d</span>
<span py:if="'Not a Member' in me.fedoraRoleStatus">${_('Not a Member')}</span>
</h3>
<form py:if="'Not a Member' in me.fedoraRoleStatus" action="${tg.url('/group/apply/%s/%s' % (group.cn, userName))}">
<div>
<!--<input type="text" name="requestField" value="Please let me join..." />-->
<input type="submit" value="Join!" />
<!--<input type="text" name="requestField" value="${_('Please let me join...')}" />-->
<input type="submit" value="${('Apply!')}" />
</div>
</form>
<a py:if="'Not a Member' not in me.fedoraRoleStatus" href="${tg.url('/group/remove/%s/%s' % (group.cn, userName))}">Remove me</a>
<h3>Group Details <a href="${tg.url('/group/edit/%s' % group.cn)}">(edit)</a></h3>
<a py:if="'Not a Member' not in me.fedoraRoleStatus" href="${tg.url('/group/remove/%s/%s' % (group.cn, userName))}">${_('Remove me')}</a>
<h3>Group Details <a href="${tg.url('/group/edit/%s' % group.cn)}">${_('(edit)')}</a></h3>
<div class="userbox">
<dl>
<dt>Name:</dt><dd>${group.cn}</dd>
<dt>Description:</dt><dd>${group.fedoraGroupDesc}</dd>
<dt>Owner:</dt><dd>${group.fedoraGroupOwner}</dd>
<dt>Type:</dt><dd>${group.fedoraGroupType}</dd>
<dt>Needs Sponsor:</dt><dd>
<span py:if="group.fedoraGroupNeedsSponsor == 'TRUE'" py:strip="">Yes</span>
<span py:if="group.fedoraGroupNeedsSponsor == 'FALSE'" py:strip="">No</span>
<dt>${_('Name:')}</dt><dd>${group.cn}</dd>
<dt>${_('Description:')}</dt><dd>${group.fedoraGroupDesc}</dd>
<dt>${_('Owner:')}</dt><dd>${group.fedoraGroupOwner}</dd>
<dt>${_('Type:')}</dt><dd>${group.fedoraGroupType}</dd>
<dt>${_('Needs Sponsor:')}</dt><dd>
<span py:if="group.fedoraGroupNeedsSponsor == 'TRUE'" py:strip="">${_('Yes')}</span>
<span py:if="group.fedoraGroupNeedsSponsor == 'FALSE'" py:strip="">${_('No')}</span>
</dd>
<dt>Self Removal</dt><dd>
<span py:if="group.fedoraGroupUserCanRemove == 'TRUE'" py:strip="">Yes</span>
<span py:if="group.fedoraGroupUserCanRemove == 'FALSE'" py:strip="">No</span>
<dt>${_('Self Removal:')}</dt><dd>
<span py:if="group.fedoraGroupUserCanRemove == 'TRUE'" py:strip="">${_('Yes')}</span>
<span py:if="group.fedoraGroupUserCanRemove == 'FALSE'" py:strip="">${_('No')}</span>
</dd>
<dt>Join Message:</dt><dd>${group.fedoraGroupJoinMsg}</dd>
<dt>${_('Join Message:')}</dt><dd>${group.fedoraGroupJoinMsg}</dd>
</dl>
</div>
<!--
TODO: Implement this :)
<h3 py:if='me.fedoraRoleStatus == "approved"'>Invite</h3>
<h3 py:if='me.fedoraRoleStatus == "approved"'>${_('Invite')}</h3>
<span py:if='me.fedoraRoleStatus == "approved"'>${form(action='modifyGroup', value=value, method='get')}</span>
-->
<h3>Members</h3>
<h3>${_('Members')}</h3>
<table>
<thead>
<tr>
<th>Username</th>
<th>Sponsor</th>
<th>Date Added</th>
<th>Date Approved</th>
<th>Approval</th>
<th>Role Type</th>
<th py:if="auth.canSponsorGroup(userName, group.cn)">Action</th>
<th>${_('Username')}</th>
<th>${_('Sponsor')}</th>
<th>${_('Date Added')}</th>
<th>${_('Date Approved')}</th>
<th>${_('Approval')}</th>
<th>${_('Role Type')}</th>
<th py:if="auth.canSponsorGroup(userName, group.cn)">${_('Action')}</th>
</tr>
</thead>
<tr py:for="user in sorted(groups.keys())">
<td><a href="${tg.url('/user/view/%s' % user)}">${user}</a></td>
<td py:if='not(groups[user].fedoraRoleSponsor == "None")'><a href="${tg.url('/user/view/%s' % groups[user].fedoraRoleSponsor)}">${groups[user].fedoraRoleSponsor}</a></td>
<td py:if='groups[user].fedoraRoleSponsor == "None"'>None</td>
<td>${groups[user].fedoraRoleCreationDate}</td>
<td>${groups[user].fedoraRoleApprovalDate}</td>
<td py:if='groups[user].fedoraRoleSponsor == "None"'>${_('None')}</td>
<?python
from datetime import datetime
from pytz import timezone
?>
<td>${datetime.fromtimestamp(float(groups[user].fedoraRoleCreationDate), timezone(u.fedoraPersonTimeZone)).strftime('%F %R %Z')}</td>
<td py:if="groups[user].fedoraRoleApprovalDate.lower() == 'none'">${groups[user].fedoraRoleApprovalDate}</td>
<td py:if="groups[user].fedoraRoleApprovalDate.lower() != 'none'">${datetime.fromtimestamp(float(groups[user].fedoraRoleApprovalDate), timezone(u.fedoraPersonTimeZone)).strftime('%F %R %Z')}</td>
<td>${groups[user].fedoraRoleStatus}</td>
<td>${groups[user].fedoraRoleType}</td>
<!--<td>${groups[user].fedoraRoleDomain}</td>-->
@ -72,18 +77,18 @@
<ul>
<li py:if="groups[user].fedoraRoleStatus.lower() != 'approved'">
<a py:if="group.fedoraGroupNeedsSponsor.upper() == 'TRUE'"
href="${tg.url('/group/sponsor/%s/%s' % (groups[user].cn, user))}">Sponsor</a>
href="${tg.url('/group/sponsor/%s/%s' % (groups[user].cn, user))}">${_('Sponsor')}</a>
<a py:if="not group.fedoraGroupNeedsSponsor.upper() == 'TRUE'"
href="${tg.url('/group/sponsor/%s/%s' % (groups[user].cn, user))}">Approve</a>
href="${tg.url('/group/sponsor/%s/%s' % (groups[user].cn, user))}">${_('Approve')}</a>
</li>
<li py:if="auth.canRemoveUser(tg.identity.user.user_name, group.cn, userName)">
<a href="${tg.url('/group/remove/%s/%s' % (groups[user].cn, user))}">Remove</a>
<a href="${tg.url('/group/remove/%s/%s' % (groups[user].cn, user))}">${_('Remove')}</a>
</li>
<li py:if="auth.canUpgradeUser(tg.identity.user.user_name, group.cn, userName)">
<a href="${tg.url('/group/upgrade/%s/%s' % (groups[user].cn, user))}">Upgrade</a>
<a href="${tg.url('/group/upgrade/%s/%s' % (groups[user].cn, user))}">${_('Upgrade')}</a>
</li>
<li py:if="auth.canDowngradeUser(tg.identity.user.user_name, group.cn, userName)">
<a href="${tg.url('/group/downgrade/%s/%s' % (groups[user].cn, user))}">Downgrade</a>
<a href="${tg.url('/group/downgrade/%s/%s' % (groups[user].cn, user))}">${_('Downgrade')}</a>
</li>
</ul>
</td>

View file

@ -4,22 +4,8 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<h2 py:if="'userID' in builds.userLink" class="accounts">Recent Builds <a href="${builds.userLink}">(Koji)</a></h2>
<table py:if="'userID' in builds.userLink">
<thead>
<tr><th>Build</th><th>Build Date</th></tr>
</thead>
<!--<tr><td>Koji</td><td><a href="${builds.userLink}">Build Info</a></td></tr>-->
<tr py:for="build in builds.builds">
<td>
<span py:if="'complete' in builds.builds[build]['title']" class="approved"><a href="${build}">${builds.builds[build]['title']}</a></span>
<span py:if="'failed' in builds.builds[build]['title']" class="unapproved"><a href="${build}">${builds.builds[build]['title']}</a></span>
</td>
<td>${builds.builds[build]['pubDate']}</td>
</tr>
</table>
</body>
</html>

View file

@ -4,7 +4,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
<title>Login to the Fedora Accounts System</title>
<title>${_('Login to the Fedora Accounts System')}</title>
<style type="text/css">
#content ul
{
@ -14,20 +14,20 @@
</style>
</head>
<body>
<h2>Login</h2>
<h2>${_('Login')}</h2>
<p>${message}</p>
<form action="${previous_url}" method="post">
<div class="field"><label for="user_name">User Name:</label> <input type="text" id="user_name" name="user_name" /></div>
<div class="field"><label for="password">Password:</label> <input type="password" id="password" name="password" /></div>
<div class="field"><label for="user_name">${_('User Name:')}</label> <input type="text" id="user_name" name="user_name" /></div>
<div class="field"><label for="password">${_('Password:')}</label> <input type="password" id="password" name="password" /></div>
<div class="field">
<input type="submit" name="login" value="Login" />
<input type="submit" name="login" value="${_('Login')}" />
<input py:if="forward_url" type="hidden" name="forward_url" value="${tg.url(forward_url)}" />
<input py:for="name,value in original_parameters.items()" type="hidden" name="${name}" value="${value}" />
</div>
</form>
<ul>
<li><a href="${tg.url('/user/resetpass')}">Forgot Password?</a></li>
<li><a href="${tg.url('/user/new')}">Sign Up</a></li>
<li><a href="${tg.url('/user/resetpass')}">${_('Forgot Password?')}</a></li>
<li><a href="${tg.url('/user/new')}">${_('Sign Up')}</a></li>
</ul>
</body>
</html>

View file

@ -3,57 +3,60 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:py="http://genshi.edgewall.org/"
py:strip="">
<?python
_ = lambda text: tg.gettext(text)
?>
<head py:match="head" py:attrs="select('@*')">
<!--<link href="${tg.url('/static/css/style.css')}" rel="stylesheet" type="text/css" />-->
<link href="${tg.url('/static/css/style.css')}" rel="stylesheet" type="text/css" />
<meta py:replace="select('*|text()')" />
</head>
<body py:match="body" py:attrs="select('@*')">
<div id="wrapper">
<div id="head">
<h1><a href="http://fedoraproject.org/">Fedora</a></h1>
<h1><a href="http://fedoraproject.org/">${_('Fedora')}</a></h1>
<div id="searchbox">
<form action="" method="get">
<label for="q">Search:</label>
<label for="q">${_('Search:')}</label>
<input type="text" name="q" id="q" />
<input type="submit" value="Search" />
<input type="submit" value="${_('Search')}" />
</form>
</div>
</div>
<div id="topnav">
<ul>
<li class="first"><a href="http://fedoraproject.org/">Learn about Fedora</a></li>
<li><a href="http://fedoraproject.org/get-fedora.html">Download Fedora</a></li>
<li><a href="http://fedoraproject.org/wiki/">Projects</a></li>
<li><a href="http://fedoraproject.org/join-fedora.html">Join Fedora</a></li>
<li><a href="http://fedoraproject.org/wiki/Communicate">Communicate</a></li>
<li><a href="http://docs.fedoraproject.org/">Help/Documentation</a></li>
<li class="first"><a href="http://fedoraproject.org/">${_('Learn about Fedora')}</a></li>
<li><a href="http://fedoraproject.org/get-fedora.html">${_('Download Fedora')}</a></li>
<li><a href="http://fedoraproject.org/wiki/">${_('Projects')}</a></li>
<li><a href="http://fedoraproject.org/join-fedora.html">${_('Join Fedora')}</a></li>
<li><a href="http://fedoraproject.org/wiki/Communicate">${_('Communicate')}</a></li>
<li><a href="http://docs.fedoraproject.org/">${_('Help/Documentation')}</a></li>
</ul>
</div>
<div id="infobar">
<div id="authstatus">
<span py:if="not tg.identity.anonymous">
<strong>Logged in:</strong> ${tg.identity.user.user_name}
<strong>${_('Logged in:')}</strong> ${tg.identity.user.user_name}
</span>
</div>
<div id="control">
<ul>
<li py:if="not tg.identity.anonymous"><a href="${tg.url('/user/view/%s' % tg.identity.user.user_name)}">My Account</a></li>
<li py:if="not tg.identity.anonymous"><a href="${tg.url('/logout')}">Log Out</a></li>
<li py:if="tg.identity.anonymous"><a href="${tg.url('/login')}">Log In</a></li>
<li py:if="not tg.identity.anonymous"><a href="${tg.url('/user/view/%s' % tg.identity.user.user_name)}">${_('My Account')}</a></li>
<li py:if="not tg.identity.anonymous"><a href="${tg.url('/logout')}">${_('Log Out')}</a></li>
<li py:if="tg.identity.anonymous"><a href="${tg.url('/login')}">${_('Log In')}</a></li>
</ul>
</div>
</div>
<div id="main">
<div id="sidebar">
<ul>
<li class="first"><a href="${tg.url('/group/list')}">Group List</a></li>
<li class="first"><a href="${tg.url('/group/list')}">${_('Group List')}</a></li>
<div py:if="'accounts' in tg.identity.groups" py:strip=''>
<!-- TODO: Make these use auth.py -->
<li><a href="${tg.url('/user/list')}">User List</a></li>
<li><a href="${tg.url('/group/new')}">New Group</a></li>
<li><a href="${tg.url('/user/list')}">${_('User List')}</a></li>
<li><a href="${tg.url('/group/new')}">${_('New Group')}</a></li>
</div>
<li><a href="${tg.url('/group/list/A*')}">Apply For a new Group</a></li>
<li><a href="http://fedoraproject.org/wiki/FWN/LatestIssue">News</a></li>
<li><a href="${tg.url('/group/list/A*')}">${_('Apply For a new Group')}</a></li>
<li><a href="http://fedoraproject.org/wiki/FWN/LatestIssue">${_('News')}</a></li>
</ul>
</div>
<div id="content">
@ -64,18 +67,17 @@
</div>
<div id="footer">
<ul id="footlinks">
<li class="first"><a href="/">About</a></li>
<li><a href="http://fedoraproject.org/wiki/Communicate">Contact Us</a></li>
<li><a href="http://fedoraproject.org/wiki/Legal">Legal &amp; Privacy</a></li>
<li class="first"><a href="/">${_('About')}</a></li>
<li><a href="http://fedoraproject.org/wiki/Communicate">${_('Contact Us')}</a></li>
<li><a href="http://fedoraproject.org/wiki/Legal">${_('Legal &amp; Privacy')}</a></li>
<!--<li><a href="/">Site Map</a></li>-->
<li><a href="${tg.url('/logout')}">Log Out</a></li>
<li><a href="${tg.url('/logout')}">${_('Log Out')}</a></li>
</ul>
<p class="copy">
Copyright &copy; 2007 Red Hat, Inc. and others. All Rights Reserved.
Please send any comments or corrections to the <a href="mailto:webmaster@fedoraproject.org">websites team</a>.
${Markup(_('Copyright &copy; 2007 Red Hat, Inc. and others. All Rights Reserved. Please send any comments or corrections to the &lt;a href="mailto:webmaster@fedoraproject.org"&gt;websites team&lt;/a&gt;.'))}
</p>
<p class="disclaimer">
The Fedora Project is maintained and driven by the community and sponsored by Red Hat. This is a community maintained site. Red Hat is not responsible for content.
${_('The Fedora Project is maintained and driven by the community and sponsored by Red Hat. This is a community maintained site. Red Hat is not responsible for content.')}
</p>
</div>
</div>

View file

@ -4,12 +4,12 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<h2>Fedora Project OpenID Provider</h2>
<h2>${_{'Fedora Project OpenID Provider')}</h2>
<p>
Description goes here, <a href="http://username.fedorapeople.org/">username.fedorapeople.org</a>
${Markup_('Description goes here, &lt;a href="http://username.fedorapeople.org/"&gt;username.fedorapeople.org&lt;/a&gt;'))}
</p>
</body>
</html>

View file

@ -4,16 +4,16 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
<link rel="openid.server" href="${server}" />
</head>
<body>
<h2>User ${user.cn}</h2>
<h2>${_('User %s') % user.cn}</h2>
<div class="userbox">
<dl>
<dt>Username:</dt>
<dd> ${user.cn}</dd>
<dt>Name:</dt>
<dt>${_('Username:')}</dt>
<dd>${user.cn}</dd>
<dt>${_('Name:')}</dt>
<dd>${user.givenName}</dd>
</dl>
</div>

View file

@ -4,15 +4,16 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Fedora Accounts System</title>
<title>${_('Fedora Accounts System')}</title>
</head>
<body>
<h2>Fedora Project OpenID Provider</h2>
<h2>${_('Fedora Project OpenID Provider')}</h2>
<form action="${tg.url('/openid/server')}">
<div>
<input type="hidden" id="url" name="url" value="${url}" />
<input type="checkbox" id="trusted" name="trusted" value="allow" /> <label for="trusted">Allow <strong>${url}</strong> to authenticate to your OpenID identity?</label><br />
<input type="submit" value="Submit" />
<input type="checkbox" id="trusted" name="trusted" value="allow" />
<label for="trusted">${Markup(_('Allow &lt;strong&gt;%s&lt;/strong&gt; to authenticate to your OpenID identity?') % url)}</label><br />
<input type="submit" value="${_('Submit'}" />
</div>
</form>
</body>

View file

@ -4,16 +4,16 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Change Password</title>
<title>${_('Change Password')}</title>
</head>
<body>
<h2>Change Password</h2>
<h2>${_('Change Password')}</h2>
<form action="${tg.url('/user/setpass')}" method="post">
<ul>
<div class="field"><label for="currentPassword">Current Password:</label> <input type="password" id="currentPassword" name="currentPassword" /></div>
<div class="field"><label for="password">New Password:</label> <input type="password" id="password" name="password" /></div>
<div class="field"><label for="passwordCheck">Confirm Password:</label> <input type="password" id="passwordCheck" name="passwordCheck" /></div>
<div class="field"><input type="submit" value="Change Password" /></div>
<div class="field"><label for="currentPassword">${_('Current Password:')}</label> <input type="password" id="currentPassword" name="currentPassword" /></div>
<div class="field"><label for="password">${_('New Password:')}</label> <input type="password" id="password" name="password" /></div>
<div class="field"><label for="passwordCheck">${_('Confirm Password:')}</label> <input type="password" id="passwordCheck" name="passwordCheck" /></div>
<div class="field"><input type="submit" value="${_('Change Password')}" /></div>
</ul>
</form>
</body>

View file

@ -4,47 +4,55 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Edit Account</title>
<title>${_('Edit Account')}</title>
</head>
<body>
<h2>Edit Account</h2>
<h2>${_('Edit Account (%s)') % userName}</h2>
<form action="${tg.url('/user/save/%s' % userName)}" method="post">
<div class="field">
<label for="givenName">Full Name:</label>
<label for="givenName">${_('Full Name'):}</label>
<input type="text" id="givenName" name="givenName" value="${user.givenName}" />
</div>
<div class="field">
<label for="mail">Email:</label>
<label for="mail">${_('Email'):}</label>
<input type="text" id="mail" name="mail" value="${user.mail}" />
</div>
<div class="field">
<label for="fedoraPersonBugzillaMail">Bugzilla Email:</label>
<label for="fedoraPersonBugzillaMail">${_('Bugzilla Email'):}</label>
<input type="text" id="fedoraPersonBugzillaMail" name="fedoraPersonBugzillaMail" value="${user.fedoraPersonBugzillaMail}" />
</div>
<div class="field">
<label for="fedoraPersonIrcNick">IRC Nick:</label>
<label for="fedoraPersonIrcNick">${_('IRC Nick'):}</label>
<input type="text" id="fedoraPersonIrcNick" name="fedoraPersonIrcNick" value="${user.fedoraPersonIrcNick}" />
</div>
<div class="field">
<label for="fedoraPersonKeyId">PGP Key:</label>
<label for="fedoraPersonKeyId">${_('PGP Key'):}</label>
<input type="text" id="fedoraPersonKeyId" name="fedoraPersonKeyId" value="${user.fedoraPersonKeyId}" />
</div>
<div class="field">
<label for="telephoneNumber">Telephone Number:</label>
<label for="telephoneNumber">${_('Telephone Number'):}</label>
<input type="text" id="telephoneNumber" name="telephoneNumber" value="${user.telephoneNumber}" />
</div>
<div class="field">
<label for="postalAddress">Postal Address:</label>
<input type="text" id="postalAddress" name="postalAddress" value="${user.postalAddress}" />
<label for="postalAddress">${_('Postal Address'):}</label>
<textarea id="postalAddress" name="postalAddress">${user.postalAddress}</textarea>
</div>
<div class="field">
<label for="description ">Description:</label>
<textarea id="description" name="description">
${user.description}
</textarea>
<label for="fedoraPersonTimeZone">${_('Time Zone'):}</label>
<select id="fedoraPersonTimeZone" name="fedoraPersonTimeZone">
<?python
from pytz import common_timezones
?>
<option py:for="tz in common_timezones" value="${tz}" py:attrs="{'selected': user.fedoraPersonTimeZone == tz and 'selected' or None}">${tz}</option>
</select>
</div>
<div class="field">
<input type="submit" value="Save!" />
<label for="description ">${_('Description'):}</label>
<textarea id="description" name="description">${user.description}</textarea>
</div>
<div class="field">
<input type="submit" value="${_('Save!')}" />
<a href="${tg.url('/user/view/%s' % userName)}">${_('Cancel')}</a>
</div>
</form>
</body>

View file

@ -4,35 +4,35 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Users List</title>
<title>${_('Users List')}</title>
</head>
<body>
<h2>List (${search})</h2>
<h2>${_('List (%s)') % search}</h2>
<form method="get" action="${tg.url('/user/list')}">
<p>"*" is a wildcard (Ex: "cvs*")</p>
<p>${_('"*" is a wildcard (Ex: "ric*")')}</p>
<div>
<input type="text" value="${search}" name="search" size="15 "/>
<input type="submit" value="Search" />
</div>
</form>
<h3>Results</h3>
<h3>${_('Results')}</h3>
<ul class="letters">
<li py:for="letter in 'abcdefghijklmnopqrstuvwxyz'.upper()"><a href="${tg.url('/user/list/%s*' % letter)}">${letter}</a></li>
<li><a href="${tg.url('/user/list/*')}">All</a></li>
<li><a href="${tg.url('/user/list/*')}">${_('All')}</a></li>
</ul>
<table>
<thead>
<tr>
<th>Username</th>
<th>Account Status</th>
<th>${_('Username')}</th>
<th>${_('Account Status')}</th>
</tr>
</thead>
<tbody>
<tr py:for="user in sorted(users)">
<td><a href="${tg.url('/user/view/%s' % user)}">${user}</a></td>
<td>
<span py:if="claDone[user]" class="approved"> CLA Done</span>
<span py:if="not claDone[user]" class="unapproved"> CLA Not Done</span>
<span py:if="claDone[user]" class="approved">${_('CLA Done')}</span>
<span py:if="not claDone[user]" class="unapproved">${_('CLA Not Done')}</span>
</td>
</tr>
</tbody>

View file

@ -4,37 +4,37 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Sign up for a Fedora account</title>
<title>${_('Sign up for a Fedora account')}</title>
</head>
<body>
<h2>Sign up for a Fedora account</h2>
<h2>${_('Sign up for a Fedora account')}</h2>
<form action="${tg.url('/user/create')}" method="post">
<div class="field">
<label for="cn">Username:</label>
<label for="cn">${_('Username:')}</label>
<input type="text" id="cn" name="cn" />
</div>
<div class="field">
<label for="givenName">Full Name:</label>
<label for="givenName">${_('Full Name:')}</label>
<input type="text" id="givenName" name="givenName" />
</div>
<div class="field">
<label for="mail">Email</label>
<label for="mail">${_('Email:')}</label>
<input type="text" id="mail" name="mail" />
</div>
<!-- <div class="field">
<label for="fedoraPersonBugzillaMail">Bugzilla Email</label>
<label for="fedoraPersonBugzillaMail">${_('Bugzilla Email:')}</label>
<input type="text" id="mail" name="fedoraPersonBugzillaMail" />
</div>-->
<div class="field">
<label for="telephoneNumber">Telephone Number</label>
<label for="telephoneNumber">${_('Telephone Number:')}</label>
<input type="text" id="telephoneNumber" name="telephoneNumber" />
</div>
<div class="field">
<label for="postalAddress">Postal Address</label>
<label for="postalAddress">${_('Postal Address:')}</label>
<textarea id="postalAddress" name="postalAddress"></textarea>
</div>
<div class="field">
<input type="submit" value="Sign up!" />
<input type="submit" value="${_('Sign up!')}" />
</div>
</form>
</body>

View file

@ -4,16 +4,16 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>Reset Password</title>
<title>${_('Reset Password')}</title>
</head>
<body>
<h2>Reset Password</h2>
<h2>${_('Reset Password')}</h2>
<form action="${tg.url('/user/sendpass')}" method="post">
<ul>
<div class="field"><label for="userName">Username:</label> <input type="text" id="userName" name="userName" /></div>
<div class="field"><label for="mail">Primary Email:</label> <input type="text" id="mail" name="mail" /></div>
<div class="field"><input type="checkbox" id="encrypted" name="encrypted" /> <label style="width: auto; float: none; margin-left: 1ex;" for="encrypted">Encrypt/Sign password reset email</label></div>
<div class="field"><input type="submit" value="Reset Password" /></div>
<div class="field"><label for="userName">${_('Username:')}</label> <input type="text" id="userName" name="userName" /></div>
<div class="field"><label for="mail">${_('Primary Email:')}</label> <input type="text" id="mail" name="mail" /></div>
<div class="field"><input type="checkbox" id="encrypted" name="encrypted" /> <label style="width: auto; float: none; margin-left: 1ex;" for="encrypted">${_('Encrypt/Sign password reset email')}</label></div>
<div class="field"><input type="submit" value="${_('Reset Password')}" /></div>
</ul>
</form>
</body>

View file

@ -4,73 +4,72 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" />
<head>
<title>View Account</title>
<title>${_('View Account')}</title>
</head>
<body>
<?python from fas import auth ?>
<h2 class="account" py:if="personal">Your Fedora Account</h2>
<h2 class="account" py:if="not personal">${user.givenName}'s Fedora Account</h2>
<h3>Account Details <a href="${tg.url('/user/edit/%s' % user.cn)}" py:if="personal or admin">(edit)</a></h3>
<h2 class="account" py:if="personal">${_('Your Fedora Account')}</h2>
<h2 class="account" py:if="not personal">${_('%s\'s Fedora Account') % user.givenName}</h2>
<h3>${_('Account Details')} <a href="${tg.url('/user/edit/%s' % user.cn)}" py:if="personal or admin">${_('(edit)')}</a></h3>
<div class="userbox">
<dl>
<dt>Account Name</dt><dd>${user.cn}&nbsp;</dd>
<dt>Real Name</dt><dd>${user.givenName}&nbsp;</dd>
<dt>Email</dt><dd>${user.mail}&nbsp;</dd>
<dt>Bugzilla Email</dt><dd>${user.fedoraPersonBugzillaMail}&nbsp;</dd>
<dt>IRC Nick</dt><dd>${user.fedoraPersonIrcNick}&nbsp;</dd>
<dt>PGP Key</dt><dd>${user.fedoraPersonKeyId}&nbsp;</dd>
<dt>Telephone Number</dt><dd>${user.telephoneNumber}&nbsp;</dd>
<dt>Postal Address</dt><dd>${user.postalAddress}&nbsp;</dd>
<dt>Description</dt><dd>${user.description}&nbsp;</dd>
<dt>Password</dt><dd><span class="approved">Valid</span> <a href="${tg.url('/user/changepass')}" py:if="personal">(change)</a></dd>
<dt>Account Status</dt><dd><span class="approved">Approved</span>, Active</dd>
<dt>CLA</dt><dd><span py:if="claDone" class="approved">Done</span><span py:if="not claDone" class="unapproved"> Not Done</span></dd>
<dt>${_('Account Name:')}</dt><dd>${user.cn}</dd>
<dt>${_('Real Name:')}</dt><dd>${user.givenName}</dd>
<dt>${_('Email:')}</dt><dd>${user.mail}</dd>
<dt>${_('Bugzilla Email:')}</dt><dd>${user.fedoraPersonBugzillaMail}</dd>
<dt>${_('IRC Nick:')}</dt><dd>${user.fedoraPersonIrcNick}&nbsp;</dd>
<dt>${_('PGP Key:')}</dt><dd>${user.fedoraPersonKeyId}&nbsp;</dd>
<dt>${_('Telephone Number:')}</dt><dd>${user.telephoneNumber}</dd>
<dt>${_('Postal Address:')}</dt><dd>${user.postalAddress}</dd>
<dt>${_('Description:')}</dt><dd>${user.description}&nbsp;</dd>
<dt>${_('Password:')}</dt><dd><span class="approved">${_('Valid')}</span> <a href="${tg.url('/user/changepass')}" py:if="personal">(change)</a></dd>
<dt>${_('Account Status:')}</dt><dd><span class="approved">${_('Approved')}</span></dd>
<dt>${_('CLA:')}</dt><dd><span py:if="claDone" class="approved">${_('Done')}</span><span py:if="not claDone" class="unapproved">${_('Not Done (&lt;a href="%s"&gt;Sign it&lt;/a&gt;!)') % tg.url('/cla')}</span></dd>
</dl>
</div>
<h3 py:if="personal">Your Roles</h3>
<h3 py:if="not personal">${user.givenName}'s Roles</h3>
<h3 py:if="personal">${_('Your Roles')}</h3>
<h3 py:if="not personal">${_('%s\'s Roles') % user.givenName}</h3>
<ul class="roleslist">
<li py:for="group in sorted(groups.keys())"><span class="team approved">${groupdata[group].fedoraGroupDesc} (${group})</span></li>
<li py:for="group in sorted(groupsPending.keys())"><span class="team unapproved">${groupdata[group].fedoraGroupDesc} (${group})</span></li>
</ul>
<!--
<ul class="actions" py:if="personal">
<li><a href="${tg.url('/group/list/A*')}">(Join another project)</a></li>
<li><a href="/">(Create a new project)</a></li>
<li><a href="${tg.url('/group/list/A*')}">${_('(Join another project)')}</a></li>
<li><a href="/">${_('(Create a new project)')}</a></li>
</ul>
-->
<ul id="rolespanel" py:if="personal">
<li py:for="group in sorted(groups.keys())" class="role">
<div py:if="auth.canViewGroup(user.cn, group)" py:strip="">
<h4>${groupdata[group].fedoraGroupDesc}</h4>, ${groups[group].fedoraRoleType}
<div py:for="group in sorted(groups.keys())" py:strip="">
<li py:if="auth.canViewGroup(user.cn, group)" class="role">
<h4>${groupdata[group].fedoraGroupDesc}</h4> (${groups[group].fedoraRoleType})
<dl>
<dt>Status:</dt>
<dt>${_('Status:')}</dt>
<dd>
<span class="approved">Approved</span>, Active
<span class="approved">${_('Approved')}</span>
</dd>
<dt>Tools:</dt>
<dt>${_('Tools:')}</dt>
<dd>
<ul class="tools">
<li><a href="/">Invite a New Member...</a></li>
<li py:if="auth.canSponsorGroup(user.cn, group)"><a href="${tg.url('/group/view/%s' % group)}">View All Pending Group Membership Requests...</a></li>
<li><a href="${tg.url('/group/view/%s' % group)}">Manage Group Membership...</a></li>
<li py:if="auth.canEditGroup(user.cn, group)"><a href="${tg.url('/group/edit/%s' % group)}">Manage Group Details...</a></li>
<li><a href="${tg.url('/group/view/%s' % group)}">${_('View Group')}</a></li>
<li><a href="${tg.url('/group/invite/%s' % group)}">${_('Invite a New Member...')}</a></li>
<li py:if="auth.canSponsorGroup(user.cn, group)"><a href="${tg.url('/group/view/%s' % group)}">${_('Manage Group Membership...')}</a></li>
<li py:if="auth.canEditGroup(user.cn, group)"><a href="${tg.url('/group/edit/%s' % group)}">${_('Manage Group Details...')}</a></li>
</ul>
</dd>
<div py:if="auth.canSponsorGroup(user.cn, group) and groupUnapproved[group] != []" py:strip="">
<dt>Queue (last five):</dt>
<dt>${_('Queue:')}</dt>
<dd>
<ul class="queue">
<li py:for="user in groupUnapproved[group][:5]">${user[0]} requests approval to join ${group}</li>
<!--
<li><a href="/">Chewbacca D. Wookiee requests approval to join project as a <strong>user</strong></a></li>
<li><a href="/">Gaius Baltar requests approval to upgrade from <strong>user</strong> to <strong>sponsor</strong></a></li>
<li><a href="/">Leia Organa requests approval to upgrade from <strong>user</strong> to <strong>administrator</strong></a></li>
-->
<li py:for="user in groupUnapproved[group][:5]">
${Markup(_('&lt;strong&gt;%(user)s&lt;/strong&gt; requests approval to join &lt;strong&gt;%(group)s&lt;/strong&gt;.') % {'user': user[0], 'group': group})}
</li>
</ul>
</dd>
</div>
</dl>
</div>
</li>
</div>
</ul>
</body>
</html>

View file

@ -4,7 +4,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html" />
<head>
<title>Welcome to FAS2</title>
<title>${_('Welcome to FAS2')}</title>
<style type="text/css">
#content ul
{
@ -15,12 +15,12 @@
</head>
<body>
<p>
Welcome to the Fedora Accounts System 2. This system is not yet live so feel free to play around. Just don't expect it to work.
${_('Welcome to the Fedora Accounts System 2. This system is not yet live so feel free to play around. Just don\'t expect it to work.')}
</p>
<ul>
<li><a href="${tg.url('/login')}">Log In</a></li>
<li><a href="${tg.url('/user/new')}">New Account</a></li>
<li><a href="http://fedoraproject.org/wiki/Join">Why Join?</a></li>
<li><a href="${tg.url('/login')}">${_('Log In')}</a></li>
<li><a href="${tg.url('/user/new')}">${_('New Account')}</a></li>
<li><a href="http://fedoraproject.org/wiki/Join">${_('Why Join?')}</a></li>
</ul>
</body>
</html>

View file

@ -143,7 +143,7 @@ class User(controllers.Controller):
unapproved = [(v,k) for k,v in unapproved.items()]
unapproved.sort(date_compare)
unapproved.reverse()
groupUnapproved[g] = [(k,v) for v,k in unapproved]
groupUnapproved[g] = [(Person.byUserName(k).givenName,v) for v,k in unapproved]
for g in groupsPending:
groupdata[g] = Groups.groups(g)[g]
try:
@ -172,12 +172,13 @@ class User(controllers.Controller):
@validate(validators=editUser())
@error_handler(error)
@expose(template='fas.templates.user.edit')
def save(self, userName, givenName, mail, fedoraPersonBugzillaMail, telephoneNumber, postalAddress, fedoraPersonIrcNick='', fedoraPersonKeyId='', description=''):
def save(self, userName, givenName, mail, fedoraPersonBugzillaMail, telephoneNumber, postalAddress, fedoraPersonIrcNick='', fedoraPersonKeyId='', description='', fedoraPersonTimeZone='UTC'):
if not canEditUser(turbogears.identity.current.user_name, userName):
turbogears.flash(_("You do not have permission to edit '%s'" % userName))
turbogears.redirect('/user/edit/%s', turbogears.identity.current.user_name)
return dict()
user = Person.byUserName(userName)
try:
user = Person.byUserName(userName)
user.givenName = givenName
user.mail = mail
user.fedoraPersonBugzillaMail = fedoraPersonBugzillaMail
@ -186,21 +187,13 @@ class User(controllers.Controller):
user.telephoneNumber = telephoneNumber
user.postalAddress = postalAddress
user.description = description
user.fedoraPersonTimeZone = fedoraPersonTimeZone
except:
turbogears.flash(_('Your account details could not be saved.'))
else:
turbogears.flash(_('Your account details have been saved.'))
turbogears.redirect("/user/view/%s" % userName)
value = {'userName': userName,
'givenName': givenName,
'mail': mail,
'fedoraPersonBugzillaMail': fedoraPersonBugzillaMail,
'fedoraPersonIrcNick': fedoraPersonIrcNick,
'fedoraPersonKeyId': fedoraPersonKeyId,
'telephoneNumber': telephoneNumber,
'postalAddress': postalAddress,
'description': description, }
return dict(value=value)
return dict(userName=userName, user=user)
@identity.require(turbogears.identity.in_group("accounts")) #TODO: Use auth.py
@expose(template="fas.templates.user.list")
@ -379,6 +372,12 @@ class User(controllers.Controller):
keydump = crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey)
return dict(cert=certdump, key=keydump)
@expose(format="json")
def search(self, userName=None, groupName=None):
people = Person.users('%s*' % userName)
return dict(people=
filter(lambda item: userName in item.lower(), people))
def date_compare(x, y):
if x[0].fedoraRoleCreationDate > y[0].fedoraRoleCreationDate:
return 1

View file

@ -11,8 +11,12 @@ attributetypes: ( 2.5.444.17 NAME 'fedoraPersonCreationDate' DESC 'date entry wa
attributeTypes: ( 2.5.444.18 NAME 'fedoraPersonApprovalStatus' DESC 'users approval status' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
attributeTypes: ( 2.5.444.19 NAME 'fedoraPersonKeyId' DESC 'users GPG key ID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
attributeTypes: ( 2.5.444.22 NAME 'fedoraPersonCertSerial' DESC 'users SSL cert serial' EQUALITY IntegerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributeTypes: ( 2.5.444.23 NAME 'fedoraPersonTimeZone' DESC 'time zone of the user' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
attributeTypes: ( 2.5.444.24 NAME 'fedoraPersonEmailConfirm' DESC 'user email confirmation' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
attributeTypes: ( 2.5.444.25 NAME 'fedoraPersonEmailCode' DESC 'user email code' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{50} )
# fedoraPerson
# The fedoraPerson represents people who are a member of the fedora project
# in some way. It is a structural class and inherits
# from the inetOrgPerson class
objectClasses: ( 2.5.555.1 NAME 'fedoraPerson' DESC 'A member of the fedoraproject group' SUP inetOrgPerson STRUCTURAL MUST ( fedoraPersonSshKey $ mail $ fedoraPersonCreationDate ) MAY (fedoraPersonIrcNick $ fedoraPersonApprovalStatus $ fedoraPersonBugzillaMail $ fedoraPersonKeyId $ fedoraPersonCertSerial ) )
objectClasses: ( 2.5.555.1 NAME 'fedoraPerson' DESC 'A member of the fedoraproject group' SUP inetOrgPerson STRUCTURAL MUST ( fedoraPersonSshKey $ mail $ fedoraPersonCreationDate $ fedoraPersonTimeZone ) MAY (fedoraPersonIrcNick $ fedoraPersonApprovalStatus $ fedoraPersonBugzillaMail $ fedoraPersonKeyId $ fedoraPersonCertSerial ) )

View file

@ -119,18 +119,18 @@ def openLdifFile(filename):
print "Opening output file %s" % filename
try:
#ldifWriter = ldif.LDIFWriter(ldap.initialize('ldap://localhost:1390'),filename)
fileHandel = open (filename,'w')
fileHandel = open (filename,'w')
# | __init__(self, output_file, base64_attrs=None, cols=76, line_sep='\n')
# | output_file
# | file object for output
# | base64_attrs
# | list of attribute types to be base64-encoded in any case
# | cols
# | Specifies how many columns a line may have before it's
# | __init__(self, output_file, base64_attrs=None, cols=76, line_sep='\n')
# | output_file
# | file object for output
# | base64_attrs
# | list of attribute types to be base64-encoded in any case
# | cols
# | Specifies how many columns a line may have before it's
# | folded into many lines.
# | line_sep
# | String used as line separator
# | line_sep
# | String used as line separator
@ -215,7 +215,7 @@ def main():
userCursor = dbConn.cursor()
userCursor.execute ("SELECT * FROM person")
#id, username, email 2, human_name 3, gpg_keyid 4, ssh_key 5, password 6, comments 7, postal_address 8, telephone 9, facsimile 10, affiliation 11, creation 12, approval_status 13, internal_comments 14, wiki_prefs 15, ircnick 16
#id, username, email 2, human_name 3, gpg_keyid 4, ssh_key 5, password 6, comments 7, postal_address 8, telephone 9, facsimile 10, affiliation 11, creation 12, approval_status 13, internal_comments 14, wiki_prefs 15, ircnick 16
except:
print "Error selecting users from db"
raise
@ -224,55 +224,60 @@ def main():
user = userCursor.fetchone()
if user == None:
break
date = str(user[12]).split('.')[0]
timestamp = time.strftime('%s', time.strptime(date, "%Y-%m-%d %H:%M:%S"))
# TODO: Create method createLdapUserEntry(user)
#(dn, entry) = createLdapUserEntry(user)
if options.outType == "ldif":
ldifWriter.unparse(dn, entry)
else:
print "Adding ldif info for " + user[3] + "."
#userLdif = [["objectClass",["fedoraPerson","organizationalUnit"]] , [ "displayName",[ user[1] ] ] ]
userLdif = [["objectClass",["fedoraPerson"]] , [ "displayName",[ user[1] ] ] ]
userLdif.append(["mail",[str(user[2])]])
userLdif.append(["sn",[str(user[1])]])
userLdif.append(["fedoraPersonBugzillaMail",[str(user[2])]])
userLdif.append(["cn",[str(user[1])]])
userLdif.append(["givenName",[str(user[3])]])
userLdif.append(["fedoraPersonKeyId",[str(user[4])]])
userLdif.append(["fedoraPersonCertSerial",'-1'])
userLdif.append(["fedoraPersonSshKey",[str(user[5])]])
userLdif.append(["userPassword",[encode_SSHA_password(str(user[6]))]])
userLdif.append(["postalAddress",[str(user[8])]])
userLdif.append(["telephoneNumber",[str(user[9])]])
userLdif.append(["fax",[str(user[10]) or "None"]])
userLdif.append(["o",[str(user[11]) or "None" ]]) # affiliation is set to the o -- another stretch ??
userLdif.append(["fedoraPersonCreationDate",[str(user[12])]])
userLdif.append(["fedoraPersonApprovalStatus",[str(user[13])]])
userLdif.append(["description",[str(user[14])]]) #this one may be a streach -- original field was internal comments
userLdif.append(["fedoraPersonIrcNick",[str(user[16])]])
#userLdif.append(["ou",["Roles"]]) Adding an OU instead
print userLdif
#for userKey in userLdif.keys():
#print "Key Name -> " + userKey
#print ":::Key Value::: "
#print userLdif[userKey]
#ldifWriter.unparse("dc=fedoraproject,dc=org cn=" + user[3] , { userKey : [str(userLdif[userKey])] } )
#userLdif = [["objectClass",["fedoraPerson","organizationalUnit"]] , [ "displayName",[ user[1] ] ] ]
userLdif = [["objectClass",["fedoraPerson"]] , [ "displayName",[ user[1] ] ] ]
userLdif.append(["mail",[str(user[2])]])
userLdif.append(["sn",[str(user[1])]])
userLdif.append(["fedoraPersonBugzillaMail",[str(user[2])]])
userLdif.append(["cn",[str(user[1])]])
userLdif.append(["givenName",[str(user[3])]])
userLdif.append(["fedoraPersonKeyId",[str(user[4])]])
userLdif.append(["fedoraPersonCertSerial",['-1']])
userLdif.append(["fedoraPersonSshKey",[str(user[5])]])
userLdif.append(["userPassword",[encode_SSHA_password(str(user[6]))]])
userLdif.append(["postalAddress",[str(user[8])]])
userLdif.append(["telephoneNumber",[str(user[9])]])
userLdif.append(["fax",[str(user[10]) or "None"]])
userLdif.append(["o",[str(user[11]) or "None" ]]) # affiliation is set to the o -- another stretch ??
userLdif.append(["fedoraPersonCreationDate",[str(timestamp)]])
userLdif.append(["fedoraPersonApprovalStatus",[str(user[13])]])
userLdif.append(["description",[str(user[14])]]) #this one may be a streach -- original field was internal comments
userLdif.append(["fedoraPersonTimeZone",["UTC"]])
userLdif.append(["fedoraPersonIrcNick",[str(user[16])]])
#userLdif.append(["ou",["Roles"]]) Adding an OU instead
print userLdif
#for userKey in userLdif.keys():
#print "Key Name -> " + userKey
#print ":::Key Value::: "
#print userLdif[userKey]
#ldifWriter.unparse("dc=fedoraproject,dc=org cn=" + user[3] , { userKey : [str(userLdif[userKey])] } )
#print userLdif.keys()
#print userLdif.values()
ldifWriter.unparse("cn=" + str(user[1]) +",ou=People,dc=fedoraproject,dc=org" , userLdif )
#print userLdif.keys()
#print userLdif.values()
ldifWriter.unparse("cn=" + str(user[1]) +",ou=People,dc=fedoraproject,dc=org" , userLdif )
roleOuLdif = [["objectClass",["organizationalUnit"]] , [ "ou",[ "Roles" ] ] ]
ldifWriter.unparse("ou=Roles,cn=" + str(user[1]) +",ou=People,dc=fedoraproject,dc=org" , roleOuLdif )
roleOuLdif = [["objectClass",["organizationalUnit"]] , [ "ou",[ "Roles" ] ] ]
ldifWriter.unparse("ou=Roles,cn=" + str(user[1]) +",ou=People,dc=fedoraproject,dc=org" , roleOuLdif )
#ldifWriter.unparse("dc=fedoraproject,dc=org, cn=" + user[3] , [ ['ano',['domini']],['uances',['od']] ])
#ldifWriter.unparse("dc=fedoraproject,dc=org, cn=" + user[3] , [ ['ano',['domini']],['uances',['od']] ])
#time.sleep (2)
#time.sleep (2)
#ldapConn.add_s(dn, entry)
userCursor.close()
@ -303,7 +308,7 @@ def main():
ldifWriter.unparse(dn, entry)
else:
#ldapConn.add_s(dn, entry)
print "Adding group info for %s." % group[7]
#id0, owner_id1, group_type2, needs_sponsor3, user_can_remove4, prerequisite_id5, joinmsg6, name7
@ -312,43 +317,43 @@ def main():
owner = uidLookupCursor.fetchone()
if str(group[5]) != "None" :
uidLookupCursor.execute ("SELECT name FROM project_group where id =" + str(group[5]) )
prereq = uidLookupCursor.fetchone()
prereq = uidLookupCursor.fetchone()
print prereq
else:
prereq=["None"]
print owner
else:
prereq=["None"]
print owner
#id0, name1, owner_id2, group_type3, needs_sponsor4, user_can_remove5, prerequisite_id6, joinmsg7
userLdif = [["objectClass",["fedoraGroup"]] ]
userLdif.append(["cn",[str(group[7])]])
userLdif.append(["fedoraGroupOwner",owner]) # need to get a cn for this not just the id
#userLdif.append(["groupOwner",[str(group[2])]]) # need to get a cn for this not just the id
userLdif.append(["fedoraGroupType",[str(group[3]) or "None" ]])
userLdif = [["objectClass",["fedoraGroup"]] ]
userLdif.append(["cn",[str(group[7])]])
userLdif.append(["fedoraGroupOwner",owner]) # need to get a cn for this not just the id
#userLdif.append(["groupOwner",[str(group[2])]]) # need to get a cn for this not just the id
userLdif.append(["fedoraGroupType",[str(group[3]) or "None" ]])
#we're using the boolean type for these. This means they need to be converted to the TRUE and FALSE strings
#we're using the boolean type for these. This means they need to be converted to the TRUE and FALSE strings
if str(group[3]) == "0" :
group[3]="FALSE"
else:
group[3]="TRUE"
if str(group[3]) == "0" :
group[3]="FALSE"
else:
group[3]="TRUE"
if str(group[4]) == "0" :
group[4]="FALSE"
else:
group[4]="TRUE"
if str(group[4]) == "0" :
group[4]="FALSE"
else:
group[4]="TRUE"
if group[5] == None:
group[5] = ""
userLdif.append(["fedoraGroupNeedsSponsor",[str(group[3])]]) #need to convert to bool
userLdif.append(["fedoraGroupUserCanRemove",[str(group[4])]]) #need to convert to bool
userLdif.append(["fedoraGroupDesc",[str('Please fill out a Group Description')]]) #need to convert to bool
#userLdif.append(["groupPrerequisite",[str(group[5])]])
userLdif.append(["fedoraGroupRequires",[str(group[5])]]) # <- Hope this is added properly - Ricky
#userLdif.append(["groupPrerequisite",prereq]) not currently in the schema
userLdif.append(["fedoraGroupJoinMsg",[str(group[6]) or "None" ]])
ldifWriter.unparse("cn=" + str(group[7]) +",ou=FedoraGroups,dc=fedoraproject,dc=org" , userLdif )
userLdif.append(["fedoraGroupNeedsSponsor",[str(group[3])]]) #need to convert to bool
userLdif.append(["fedoraGroupUserCanRemove",[str(group[4])]]) #need to convert to bool
userLdif.append(["fedoraGroupDesc",[str('Please fill out a Group Description')]]) #need to convert to bool
#userLdif.append(["groupPrerequisite",[str(group[5])]])
userLdif.append(["fedoraGroupRequires",[str(group[5])]]) # <- Hope this is added properly - Ricky
#userLdif.append(["groupPrerequisite",prereq]) not currently in the schema
userLdif.append(["fedoraGroupJoinMsg",[str(group[6]) or "None" ]])
ldifWriter.unparse("cn=" + str(group[7]) +",ou=FedoraGroups,dc=fedoraproject,dc=org" , userLdif )
groupCursor.close()
@ -360,7 +365,7 @@ def main():
print "Selecting all roles from Postgres Database"
roleCursor = dbConn.cursor()
roleCursor.execute ("SELECT * FROM role")
#person_id, project_group_id, role_type, role_domain, role_status, internal_comments, sponsor_id (Points to a person), creation (TIMESTAMP), approval (TIMESTAMP)
#person_id, project_group_id, role_type, role_domain, role_status, internal_comments, sponsor_id (Points to a person), creation (TIMESTAMP), approval (TIMESTAMP)
except:
print "Error selecting roles from db"
raise
@ -369,6 +374,16 @@ def main():
role = roleCursor.fetchone()
if role == None:
break
date1 = str(role[7]).split('.')[0]
date2 = str(role[8]).split('.')[0]
try:
timestamp1 = time.strftime('%s', time.strptime(date1, "%Y-%m-%d %H:%M:%S"))
except:
timestamp1 = "None"
try:
timestamp2 = time.strftime('%s', time.strptime(date2, "%Y-%m-%d %H:%M:%S"))
except:
timestamp2 = "None"
# TODO: Create method createLdapRoleEntry(group)
#(dn, entry) = createLdapGroupRole(group)
if options.outType == "ldif":
@ -378,7 +393,7 @@ def main():
#person_id0, group_project_id1, role_type2, role_domain3, role_status4, internal_comments5, sponsor_id6, creation7, approval8
uidRoleCursor = dbConn.cursor()
uidRoleCursor = dbConn.cursor()
uidRoleCursor.execute ("SELECT username FROM person where id =" + str(role[0]) )
username = uidRoleCursor.fetchone()
uidRoleCursor.execute ("SELECT name FROM project_group where id =" + str(role[1]) )
@ -386,31 +401,31 @@ def main():
if str(role[6]) != "None" :
uidRoleCursor.execute ("SELECT username FROM person where id =" + str(role[6]) )
sponsor = uidRoleCursor.fetchone()
else:
sponsor = ["None"]
else:
sponsor = ["None"]
print "Adding " + str(role[4]) + " role info for " + group[0] + " for user " + username[0] + "."
#if str(group[6]) != "None" :
# uidLookupCursor.execute ("SELECT name FROM project_group where id =" + str(group[6]) )
# prereq = uidLookupCursor.fetchone()
# prereq = uidLookupCursor.fetchone()
# print prereq
#else:
# prereq=["None"]
#print owner
#else:
# prereq=["None"]
#print owner
#person_id0, group_project_id1, role_type2, role_domain3, role_status4, internal_comments5, sponsor_id6, creation7, approval8
roleLdif = [["objectClass",["fedoraRole"]] ]
#roleLdif.append(["cn",[str(group[0]) + str(role[2])]]) #Fix me
roleLdif.append(["cn",[str(group[0])]]) #Fix me
roleLdif.append(["fedoraRoleType",[str(role[2])]])
roleLdif.append(["fedoraRoleDomain",[str(role[3]) or "None" ]])
roleLdif.append(["fedoraRoleStatus",[str(role[4])]])
roleLdif.append(["fedoraRoleSponsor",sponsor])
roleLdif.append(["fedoraRoleCreationDate",[str(role[7]) or "None" ]])
roleLdif.append(["fedoraRoleApprovalDate",[str(role[8])]])
roleLdif = [["objectClass",["fedoraRole"]] ]
#roleLdif.append(["cn",[str(group[0]) + str(role[2])]]) #Fix me
roleLdif.append(["cn",[str(group[0])]]) #Fix me
roleLdif.append(["fedoraRoleType",[str(role[2])]])
roleLdif.append(["fedoraRoleDomain",[str(role[3]) or "None" ]])
roleLdif.append(["fedoraRoleStatus",[str(role[4])]])
roleLdif.append(["fedoraRoleSponsor",sponsor])
roleLdif.append(["fedoraRoleCreationDate",[str(timestamp1)]])
roleLdif.append(["fedoraRoleApprovalDate",[str(timestamp2)]])
ldifWriter.unparse("cn=" + group[0] + ",ou=Roles,cn=" + username[0] + ",ou=People,dc=fedoraproject,dc=org" , roleLdif )
ldifWriter.unparse("cn=" + group[0] + ",ou=Roles,cn=" + username[0] + ",ou=People,dc=fedoraproject,dc=org" , roleLdif )
roleCursor.close()

View file

@ -0,0 +1,27 @@
#!/usr/bin/python
import os
import commands
dirs = ['/git/',
'/hg/',
'/svn/',
'/bzr/',
'/mtn/',]
for dir in dirs:
projects = os.listdir(dir)
for project in projects:
# strip off the .git
firstLetter = project[0]
secondLetter = project[1]
path = "%s%s" % (dir, project)
releaseName = project.replace('.git', '')
release = "/srv/web/releases/%s/%s/%s" % (firstLetter, secondLetter, releaseName)
if not os.path.islink(path):
stat = os.lstat(path)
if not os.path.isdir(release):
os.makedirs(release)
if os.lstat(release).st_gid != stat.st_gid:
os.chown(release, -1, stat.st_gid)
os.chmod(release, 02775)

View file

@ -1 +1,2 @@
check_ipmi - Checks fan and temperature on a box with ipmi support
check_koji - Check for failed koji builds and warn when in a critical range

5
scripts/run-scm/run-bzr Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
umask 0002
exec /usr/bin/bzr "$@"

61
scripts/run-scm/run-git Executable file
View file

@ -0,0 +1,61 @@
#!/usr/bin/python -tt
import sys, os
commands = {
"git-receive-pack": "/usr/bin/git-receive-pack",
"git-upload-pack": "/usr/bin/git-upload-pack",
"bzr": "/usr/bin/run-bzr",
"hg": "/usr/bin/run-hg",
"mtn": "/usr/bin/run-mtn",
"svnserve": "/usr/bin/run-svnserve",
"scp": "/usr/bin/scp",
}
if __name__ == '__main__':
orig_cmd = os.environ.get('SSH_ORIGINAL_COMMAND')
if not orig_cmd:
print "Need a command"
sys.exit(1)
allargs = orig_cmd.split()
try:
basecmd = os.path.basename(allargs[0])
cmd = commands[basecmd]
except:
sys.stderr.write("Invalid command %s\n" % orig_cmd)
sys.exit(2)
if basecmd in ('git-receive-pack', 'git-upload-pack'):
# git repositories need to be parsed specially
thearg = ' '.join(allargs[1:])
if thearg[0] == "'" and thearg[-1] == "'":
thearg = thearg.replace("'","")
thearg = thearg.replace("\\'", "")
if thearg[:len('/git/')] != '/git/' or not os.path.isdir(thearg):
print "Invalid repository %s" % thearg
sys.exit(3)
allargs = [thearg]
elif basecmd in ('scp'):
thearg = ' '.join(allargs[1:])
firstLetter = allargs[2][0]
secondLetter = allargs[2][1]
uploadTarget = "/srv/web/releases/%s/%s/%s/" % (firstLetter, secondLetter, allargs[2])
if thearg.find('/') != -1:
print "scp yourfile-1.2.tar.gz scm.fedorahosted.org:$YOURPROJECT # No trailing /"
sys.exit(4)
elif not os.path.isdir(uploadTarget):
print "http://fedorahosted.org/releases/%s/%s/%s does not exist!" % (firstLetter, secondLetter, allargs[2])
sys.exit(5)
else:
newargs = []
newargs.append(allargs[0])
newargs.append(allargs[1])
newargs.append(uploadTarget)
os.execv(cmd, [cmd] + newargs[1:])
sys.exit(1)
else:
allargs = allargs[1:]
os.execv(cmd, [cmd] + allargs)
sys.exit(1)

5
scripts/run-scm/run-hg Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
umask 0002
exec /usr/bin/hg "$@"

5
scripts/run-scm/run-mtn Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
umask 0002
exec /usr/bin/mtn "$@"

4
scripts/run-scm/run-svnserve Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
umask 0002
exec /usr/bin/svnserve -t