summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 27e2c6e)
raw | patch | inline | side by side (parent: 27e2c6e)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 5 Nov 2001 23:45:40 +0000 (23:45 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 5 Nov 2001 23:45:40 +0000 (23:45 +0000) |
Also made it present nicer error messages (not tracebacks).
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@365 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@365 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup-admin | patch | blob | history | |
roundup/cgi_client.py | patch | blob | history |
diff --git a/roundup-admin b/roundup-admin
index 88849aa68fe3204714f740eba9ad94b9ac18f5f5..8ea917329913e3c944b989b9f62ca58c1c6ebe61 100755 (executable)
--- a/roundup-admin
+++ b/roundup-admin
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundup-admin,v 1.37 2001-10-23 01:00:18 richard Exp $
+# $Id: roundup-admin,v 1.38 2001-11-05 23:45:40 richard Exp $
import sys
if int(sys.version[0]) < 2:
if template not in templates:
print 'Templates:', ', '.join(templates)
while template not in templates:
- template = raw_input('Select template [extended]: ').strip()
+ template = raw_input('Select template [classic]: ').strip()
if not template:
- template = 'extended'
+ template = 'classic'
import roundup.backends
backends = roundup.backends.__all__
#
# $Log: not supported by cvs2svn $
+# Revision 1.37 2001/10/23 01:00:18 richard
+# Re-enabled login and registration access after lopping them off via
+# disabling access for anonymous users.
+# Major re-org of the htmltemplate code, cleaning it up significantly. Fixed
+# a couple of bugs while I was there. Probably introduced a couple, but
+# things seem to work OK at the moment.
+#
# Revision 1.36 2001/10/21 00:45:15 richard
# Added author identification to e-mail messages from roundup.
#
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index c565c546d0823757bb23b5fe952cee1ad106c61b..8bf1b378d3d6c3c936e04075434c6676574d07c7 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: cgi_client.py,v 1.49 2001-11-04 03:07:12 richard Exp $
+# $Id: cgi_client.py,v 1.50 2001-11-05 23:45:40 richard Exp $
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
import binascii, Cookie, time
else:
raise Unauthorised
- def login(self, message=None):
+ def login(self, message=None, newuser_form=None):
self.pagehead('Login to roundup', message)
self.write('''
<table>
self.write('</table>')
self.pagefoot()
return
+ values = {'realname': '', 'organisation': '', 'address': '',
+ 'phone': '', 'username': '', 'password': '', 'confirm': ''}
+ if newuser_form is not None:
+ for key in newuser_form.keys():
+ values[key] = newuser_form[key].value
self.write('''
<p>
<tr><td colspan=2 class="strong-header">New User Registration</td></tr>
<tr><td colspan=2><em>marked items</em> are optional...</td></tr>
<form action="newuser_action" method=POST>
<tr><td align=right><em>Name: </em></td>
- <td><input name="realname"></td></tr>
+ <td><input name="realname" value="%(realname)s"></td></tr>
<tr><td align=right><em>Organisation: </em></td>
- <td><input name="organisation"></td></tr>
+ <td><input name="organisation" value="%(organisation)s"></td></tr>
<tr><td align=right>E-Mail Address: </td>
- <td><input name="address"></td></tr>
+ <td><input name="address" value="%(address)s"></td></tr>
<tr><td align=right><em>Phone: </em></td>
- <td><input name="phone"></td></tr>
+ <td><input name="phone" value="%(phone)s"></td></tr>
<tr><td align=right>Preferred Login name: </td>
- <td><input name="username"></td></tr>
+ <td><input name="username" value="%(username)s"></td></tr>
<tr><td align=right>Password: </td>
- <td><input type="password" name="password"></td></tr>
+ <td><input type="password" name="password" value="%(password)s"></td></tr>
<tr><td align=right>Password Again: </td>
- <td><input type="password" name="confirm"></td></tr>
+ <td><input type="password" name="confirm" value="%(confirm)s"></td></tr>
<tr><td></td>
<td><input type="submit" value="Register"></td></tr>
</form>
</table>
-''')
+'''%values)
self.pagefoot()
def login_action(self, message=None):
self.db = self.instance.open('admin')
# TODO: pre-check the required fields and username key property
- cl = self.db.classes['user']
- props, dummy = parsePropsFromForm(self.db, cl, self.form)
- uid = cl.create(**props)
- self.user = self.db.user.get(uid, 'username')
- password = self.db.user.get(uid, 'password')
- self.set_cookie(self.user, password)
+ cl = self.db.user
+ try:
+ props, dummy = parsePropsFromForm(self.db, cl, self.form)
+ uid = cl.create(**props)
+ except ValueError, message:
+ return self.login(message, newuser_form=self.form)
+ self.user = cl.get(uid, 'username')
+ password = cl.get(uid, 'password')
+ self.set_cookie(self.user, self.form['password'].value)
return self.index()
def main(self, dre=re.compile(r'([^\d]+)(\d+)'),
#
# $Log: not supported by cvs2svn $
+# Revision 1.49 2001/11/04 03:07:12 richard
+# Fixed various cookie-related bugs:
+# . bug #477685 ] base64.decodestring breaks
+# . bug #477837 ] lynx does not like the cookie
+# . bug #477892 ] Password edit doesn't fix login cookie
+# Also closed a security hole - a logged-in user could edit another user's
+# details.
+#
# Revision 1.48 2001/11/03 01:30:18 richard
# Oops. uses pagefoot now.
#