fedora-accounts export-aliases.py, 1.9, 1.10 export-shell-accounts.sh, 1.8, 1.9 reset-password.cgi, 1.8, 1.9 run-make-components.sh, 1.3, 1.4 userbox.cgi, 1.38, 1.39

Toshio Ernie Kuratomi (toshio) fedora-extras-commits at redhat.com
Wed Jun 13 03:53:41 UTC 2007


Author: toshio

Update of /cvs/fedora/fedora-accounts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32088

Modified Files:
	export-aliases.py export-shell-accounts.sh reset-password.cgi 
	run-make-components.sh userbox.cgi 
Log Message:
* Assorted fixes that have accumulated over time.
  - export-alias.py: Rewritten parsing of email addresses.
  - export-shell-accounts.sh: Added torrent and bastion.
  - reset-password.cgi: Better language to describe the resetting of passwords.
  - run-make-components.sh: Don't analyze owners.epel.list as well as
    owners.list.
  - userbox.cgi: Fix indentation of many lines.



Index: export-aliases.py
===================================================================
RCS file: /cvs/fedora/fedora-accounts/export-aliases.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- export-aliases.py	8 Oct 2006 20:26:39 -0000	1.9
+++ export-aliases.py	13 Jun 2007 03:53:39 -0000	1.10
@@ -3,7 +3,6 @@
 import sys, os, errno
 import website
 import getopt
-import re
 
 opts, args = getopt.getopt(sys.argv[1:], '', ('usage', 'help'))
 if len(args) != 3 or ('--usage','') in opts or ('--help','') in opts:
@@ -36,7 +35,8 @@
 while 1:
     arow = dbc.fetchone()
     if not arow: break
-    if re.compile("^[A-Z0-9._-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$", re.IGNORECASE).match(arow[1]):
+    x = arow[1].find('@')
+    if x >= 0 and arow[1][x:] != ('@' + local_domain):
 	fh_aliases_new.write('%s: %s\n' % (arow[0], arow[1]))
 	fh_aliases_new.write('%s: %s\n' % (arow[2].replace(' ', '.').lower(), arow[0]))
 


Index: export-shell-accounts.sh
===================================================================
RCS file: /cvs/fedora/fedora-accounts/export-shell-accounts.sh,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- export-shell-accounts.sh	2 Mar 2007 20:55:51 -0000	1.8
+++ export-shell-accounts.sh	13 Jun 2007 03:53:39 -0000	1.9
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-for I in buildsign build cvs main web fpserv all; do
+for I in buildsign build cvs main web fpserv torrent all bastion; do
 	mkdir -p /var/www/html/admin/accounts/shell-accounts-$I
 done
 ESA=/var/www/html/admin/accounts/export-shell-accounts.py
@@ -11,8 +11,10 @@
 $ESA /var/www/html/admin/accounts/shell-accounts-all sysadmin-build sysadmin-cvs sysadmin-main sysadmin-web
 $ESA /var/www/html/admin/accounts/shell-accounts-buildsign sysadmin-build sysadmin-main extras_signers
 $ESA /var/www/html/admin/accounts/shell-accounts-fpserv sysadmin-web sysadmin-main extras_signers
+$ESA /var/www/html/admin/accounts/shell-accounts-bastion sysadmin-web sysadmin-main sysadmin-general sysadmin-build sysadmin-cvs
+$ESA /var/www/html/admin/accounts/shell-accounts-torrent sysadmin-web sysadmin-main torrentadmin
 
-for I in buildsign build cvs main web fpserv all; do
+for I in buildsign build cvs main web fpserv torrent all bastion; do
 	pushd /var/www/html/admin/accounts/shell-accounts-$I &> /dev/null || exit 1
 		tar -czf /var/www/html/admin/accounts/shell-accounts-$I.tar.gz.new .
 	popd &> /dev/null


Index: reset-password.cgi
===================================================================
RCS file: /cvs/fedora/fedora-accounts/reset-password.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- reset-password.cgi	11 Jul 2006 09:13:08 -0000	1.8
+++ reset-password.cgi	13 Jun 2007 03:53:39 -0000	1.9
@@ -59,24 +59,17 @@
 		fhr, fh = popen2.popen2("/usr/sbin/sendmail -t")
 		fhr.close()
 		fh.write("""To: %s <%s>
-Subject: Fedora Account System Password Reset Request
+Subject: Fedora password reset
 From: Fedora Account System <%s>
 
-You or someone posing as you has requested that your password in the
-Fedora Account System be reset.
+Please go to %sreset-password.cgi?username=%s&magic=%s&timeout=%s
+to retrieve a temporary password. This link is valid for the next 72 hours.
 
-To reset your password, enter the following URL in your browser:
-
-%sreset-password.cgi?username=%s&magic=%s&timeout=%s
-
-This will issue you a temporary password.  This URL is valid for 72 hours.
-
-If you did not request a password reset, do nothing and your password will
-not be changed.
+-- The Fedora administrators
 """ % (arow['human_name'], arow['email'], website.accounts_email, 
        website.accounts_url, arow['username'], gen_magic(arow['username'], the_timeout), the_timeout))
 		fh.close()
-		print "A URL has been emailed to you. Please use it to retrieve a temporary password."
+		print "A URL has been e-mailed to you. Please click on it to retrieve a temporary password."
 		website.print_footer("Reset password")
 		sys.exit(0)
 	else:
@@ -88,12 +81,10 @@
 else:
 	website.print_header("Reset password")
 print """
-<p>Enter your account information to reset your password.</p>
-<form method="post" action="reset-password.cgi">
-<p>Username (or E-mail):</p>
-<input type="text" name="username" maxlength="80" size="24" value="%s">
-<p>Select &quot;Reset&quot; to have a URL emailed to you that will allow you to reset your password.</p>
-<input type="submit" value="Reset">
+Enter your account information to reset your password
+<form method=post action=reset-password.cgi>
+Username (or E-mail): <input type=text name=username maxlength=80 size=24 value="%s"><br>
+<input type=submit value="Reset">
 </form>
 """ % (username, )
 


Index: run-make-components.sh
===================================================================
RCS file: /cvs/fedora/fedora-accounts/run-make-components.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- run-make-components.sh	26 Feb 2007 11:52:16 -0000	1.3
+++ run-make-components.sh	13 Jun 2007 03:53:39 -0000	1.4
@@ -9,8 +9,7 @@
 
 for I in $REPOS; do
 	cvs -d :pserver:anonymous at cvs.fedora.redhat.com:/cvs/$I co -p owners/owners.list > $I.list 2>/dev/null
-	cvs -d :pserver:anonymous at cvs.fedora.redhat.com:/cvs/$I co -p owners/owners.epel.list > $I.epel.list 2>/dev/null
-	FILES="$FILES ${I}.list ${I}.epel.list"
+	FILES="$FILES ${I}.list"
 done
 
 $BINDIR/bz-make-components.py $FILES


Index: userbox.cgi
===================================================================
RCS file: /cvs/fedora/fedora-accounts/userbox.cgi,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- userbox.cgi	27 Apr 2007 15:03:15 -0000	1.38
+++ userbox.cgi	13 Jun 2007 03:53:39 -0000	1.39
@@ -25,10 +25,10 @@
     if not value or not value.strip():
         return "Must be filled in"
     if len(value) < 8 or len(value) > 16:
-    return "Wrong length - must be 8-16 hex chars"
+	return "Wrong length - must be 8-16 hex chars"
     m = re.match('[0-9a-f]+', value.lower())
     if not m or m.end() < len(value):
-    return "Invalid GPG KeyID"
+	return "Invalid GPG KeyID"
 
 def check_notempty_onnew(form, field_info, value, action):
     if action != 'create':
@@ -41,7 +41,7 @@
     if action != 'create' and not value:
         return
     if not value or not value.strip():
-        return 
+        return "Must be filled in"
     value = value.strip()
     keylines = value.split('\n')
     for keyline in keylines:
@@ -91,7 +91,7 @@
     {'desc':'Facsimile', 'name':'facsimile', 'maxlen':128},
     {'desc':'Affiliation', 'name':'affiliation', 'maxlen':64},
     {'desc':'<a href="http://fedoraproject.org/wiki/DocsProject/UsingGpg/CreatingKeys">GPG KeyID</a>', 
-    'name':'gpg_keyid', 'maxlen':16, 'check':check_gpg_keyid},
+	'name':'gpg_keyid', 'maxlen':16, 'check':check_gpg_keyid},
     {'desc':'SSHv2 Public Key (attach your ~/.ssh/id_dsa.pub file here)', 'name':'ssh_key', 'maxlen':2048, 'type':'file', 'check':check_sshkey, 'strip':1},
     {'desc':'Password', 'name':'password', 'maxlen':20, 'check':check_notempty, 'type':'password',
      'check':check_notempty_onnew, 'edit_reuse':0},
@@ -121,16 +121,16 @@
             curval = fs.value
         elif I.get('edit_reuse', 1):
             curval = field_values.get(I['name'], '')
-    if curval is None:
+	if curval is None:
             curval = ''
         if I.get('strip', 0):
-        curval = curval.strip()
+	    curval = curval.strip()
         if got_submit:
             cfunc = I.get('check')
             if cfunc:
                 objection = cfunc(form, I, curval, action)
         print "<tr><td align=left valign=top>"
-    the_desc = I['desc']
+	the_desc = I['desc']
         if not I.has_key('check'):
             the_desc += ' (optional)'
         if objection is not None and can_edit:
@@ -141,16 +141,16 @@
             print "%s: " % the_desc
         print "</td><td align=left>"
         if not can_edit:
-        print '<input type=hidden name="%s" value="%s">%s' % (I['name'], curval, curval)
-    else:
-        if I.get('type', 'text') != 'text':
+	    print '<input type=hidden name="%s" value="%s">%s' % (I['name'], curval, curval)
+	else:
+	    if I.get('type', 'text') != 'text':
                 print '<input type="%s" name="%s" value="%s">' % (I['type'], I['name'], curval)
-        elif I['maxlen'] >= 1024:
-        print '<textarea name="%s" rows=4 cols=60>%s</textarea>' % (I['name'], curval)
-        else:
-        print '<input type="text" name="%s" value="%s" maxlength=%s size=%s>' % (I['name'], curval,
-                                               I['maxlen'],
-                                               min(I['maxlen'], 60))
+	    elif I['maxlen'] >= 1024:
+		print '<textarea name="%s" rows=4 cols=60>%s</textarea>' % (I['name'], curval)
+	    else:
+		print '<input type="text" name="%s" value="%s" maxlength=%s size=%s>' % (I['name'], curval,
+										       I['maxlen'],
+										       min(I['maxlen'], 60))
         if I.has_key('notes'):
             print "</td></tr><tr><td colspan=2><i>%s</i>" % I['notes']
         print "<br><br></td></tr>"
@@ -168,13 +168,13 @@
             if not I.get('skip_empty', 1):
                 val = ''
             if form.has_key(I['name']):
-        fs = form[I['name']]
+		fs = form[I['name']]
                 val = fs.value
-        if I.get('strip', 0):
-        val = val.strip()
+	    if I.get('strip', 0):
+		val = val.strip()
             field_values[I['name']] = val
-    field_values['approval_status'] = 'approved'
-    field_values['username'] = field_values['username'].lower()
+	field_values['approval_status'] = 'approved'
+	field_values['username'] = field_values['username'].lower()
         try:
             dbc.execute("INSERT INTO person (username, human_name, email, gpg_keyid, ssh_key, password, comments, postal_address, affiliation, telephone, facsimile, approval_status) VALUES (%(username)s, %(human_name)s, %(email)s, %(gpg_keyid)s, %(ssh_key)s, %(password)s, %(comments)s, %(postal_address)s, %(affiliation)s, %(telephone)s, %(facsimile)s, %(approval_status)s)",
                         field_values)
@@ -196,10 +196,10 @@
             if not form.has_key(Iname):
                 value = ''
             else:
-        fs = form[Iname]
+		fs = form[Iname]
                 value = fs.value
-        if I.get('strip', 0):
-        value = value.strip()
+	    if I.get('strip', 0):
+		value = value.strip()
             if value != arow[Iname] and (not I.get('skip_empty', 1) or value):
                 changes.append((Iname, value))
         if not len(changes):
@@ -247,17 +247,17 @@
 
 username = None
 if action == 'edit' and (not form.has_key('username') or not form['username'].value):
-    username = auth_username
+	username = auth_username
 
 if form.has_key('username') and action != 'create':
     username = form['username'].value
     if username != auth_username and not website.have_group(dbh, auth_username, 'accounts'):
-    print "Here are some of the main details about this user:"
+	print "Here are some of the main details about this user:"
 
-    uinfo = website.get_user_info(dbh, username)
-    grlist = website.get_user_groups(dbh, uinfo['id'], role_status=('unapproved', 'approved'))
-    uinfo['grouplist'] = ' '.join(map(lambda x: '%s(%s/%s)' % (x[1], x[2], x[3]), grlist))
-    print """
+	uinfo = website.get_user_info(dbh, username)
+	grlist = website.get_user_groups(dbh, uinfo['id'], role_status=('unapproved', 'approved'))
+	uinfo['grouplist'] = ' '.join(map(lambda x: '%s(%s/%s)' % (x[1], x[2], x[3]), grlist))
+	print """
 %(username)s is %(human_name)s &lt;<a href="mailto:%(email)s">%(email)s</a>&gt;. Their GPG key ID is %(gpg_keyid)s.
 <p>
 Comments: %(comments)s
@@ -265,8 +265,8 @@
 Member of groups: %(grouplist)s
 """ % uinfo
 
-    website.print_footer("Administrative Interface")
-    sys.exit(1)
+	website.print_footer("Administrative Interface")
+	sys.exit(1)
 
 if 0:
     print """
@@ -281,7 +281,7 @@
 
 got_errors = []
 if got_submit:
-    # Check that they can edit
+	# Check that they can edit
     for I in fields:
         if form.has_key(I['name']):
             fs = form[I['name']]
@@ -303,7 +303,7 @@
         print action_error
     do_form(form, fields, action, got_submit)
     if username and action=='edit':
-    website.handle_group_mods(dbh, form, 'userbox.cgi', username,
+	website.handle_group_mods(dbh, form, 'userbox.cgi', username,
                                   None, fixed_item='username', auth_username=auth_username)
 
 website.print_footer("Fedora User")




More information about the scm-commits mailing list