Skip to content

Commit 30a0878

Browse files
author
Richard Jones
committed
registration is now a two-step process with confirmation from the
email address supplied in the registration form fixed [SF#687771] too (now handle all cases of @/:)
1 parent 701a50a commit 30a0878

File tree

11 files changed

+254
-119
lines changed

11 files changed

+254
-119
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ are given with the most recent entry first.
5959
- re-worked detectors initialisation - woohoo, no more cross-importing!
6060
- can now configure CC to author only for messages creating issues (sf
6161
feature 625808)
62+
- registration is now a two-step process, with confirmation from the email
63+
address supplied in the registration form
6264

6365

6466
2003-??-?? 0.5.6

TODO.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pending mailgw Use in-reply-to for determining message lineage when subject
2929
line lets us down
3030
pending mailgw Allow different brackets delimiting [issueNNN] in Subject
3131
pending email email sig could use a "remove me from this list"
32+
<URL>/<designator>?:remove:nosy=me
3233
pending project switch to a Roundup instance for Roundup bug/feature tracking
3334
pending security authenticate over a secure connection
3435
pending security optionally auth with Basic HTTP auth instead of cookies

roundup/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: __init__.py,v 1.19 2003-02-20 07:11:39 richard Exp $
18+
# $Id: __init__.py,v 1.20 2003-02-25 10:19:31 richard Exp $
1919

2020
''' Roundup - issue tracking for knowledge workers.
2121
@@ -67,6 +67,6 @@
6767
much prettier cake :)
6868
'''
6969

70-
__version__ = '0.6.0'
70+
__version__ = '0.6.0pr1'
7171

7272
# vim: set filetype=python ts=4 sw=4 et si

roundup/admin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.37 2003-02-15 23:19:01 kedder Exp $
19+
# $Id: admin.py,v 1.38 2003-02-25 10:19:31 richard Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -328,7 +328,8 @@ def do_install(self, tracker_home, args):
328328
# XXX perform a unit test based on the user's selections
329329

330330
# install!
331-
init.install(tracker_home, template, backend)
331+
init.install(tracker_home, template)
332+
init.write_select_db(tracker_home, backend)
332333

333334
print _('''
334335
You should now edit the tracker configuration file:

roundup/backends/back_anydbm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.104 2003-02-18 01:57:38 richard Exp $
18+
#$Id: back_anydbm.py,v 1.105 2003-02-25 10:19:31 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -26,7 +26,7 @@
2626
import whichdb, anydbm, os, marshal, re, weakref, string, copy
2727
from roundup import hyperdb, date, password, roundupdb, security
2828
from blobfiles import FileStorage
29-
from sessions import Sessions
29+
from sessions import Sessions, OneTimeKeys
3030
from roundup.indexer import Indexer
3131
from roundup.backends import locking
3232
from roundup.hyperdb import String, Password, Date, Interval, Link, \
@@ -68,6 +68,7 @@ def __init__(self, config, journaltag=None):
6868
self.transactions = []
6969
self.indexer = Indexer(self.dir)
7070
self.sessions = Sessions(self.config)
71+
self.otks = OneTimeKeys(self.config)
7172
self.security = security.Security(self)
7273
# ensure files are group readable and writable
7374
os.umask(0002)

roundup/backends/back_metakit.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
'''
3131
from roundup import hyperdb, date, password, roundupdb, security
3232
import metakit
33-
from sessions import Sessions
33+
from sessions import Sessions, OneTimeKeys
3434
import re, marshal, os, sys, weakref, time, calendar
3535
from roundup import indexer
3636
import locking
@@ -60,6 +60,7 @@ def __init__(self, config, journaltag=None):
6060
self._db = self.__open()
6161
self.indexer = Indexer(self.config.DATABASE, self._db)
6262
self.sessions = Sessions(self.config)
63+
self.otks = OneTimeKeys(self.config)
6364
self.security = security.Security(self)
6465

6566
os.umask(0002)

roundup/backends/rdbms_common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.34 2003-02-18 01:57:39 richard Exp $
1+
# $Id: rdbms_common.py,v 1.35 2003-02-25 10:19:32 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -33,7 +33,7 @@
3333
# support
3434
from blobfiles import FileStorage
3535
from roundup.indexer import Indexer
36-
from sessions import Sessions
36+
from sessions import Sessions, OneTimeKeys
3737

3838
# number of rows to keep in memory
3939
ROW_CACHE_SIZE = 100
@@ -53,6 +53,7 @@ def __init__(self, config, journaltag=None):
5353
self.classes = {}
5454
self.indexer = Indexer(self.dir)
5555
self.sessions = Sessions(self.config)
56+
self.otks = OneTimeKeys(self.config)
5657
self.security = security.Security(self)
5758

5859
# additional transaction support for external files and the like

roundup/backends/sessions.py

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
#$Id: sessions.py,v 1.3 2002-09-10 00:11:50 richard Exp $
1+
#$Id: sessions.py,v 1.4 2003-02-25 10:19:32 richard Exp $
22
'''
33
This module defines a very basic store that's used by the CGI interface
4-
to store session information.
4+
to store session and one-time-key information.
5+
6+
Yes, it's called "sessions" - because originally it only defined a session
7+
class. It's now also used for One Time Key handling too.
8+
59
'''
610

711
import anydbm, whichdb, os, marshal
812

9-
class Sessions:
10-
''' Back onto an anydbm store.
13+
class BasicDatabase:
14+
''' Provide a nice encapsulation of an anydbm store.
1115
12-
Keys are session id strings, values are marshalled data.
16+
Keys are id strings, values are automatically marshalled data.
1317
'''
1418
def __init__(self, config):
1519
self.config = config
@@ -18,7 +22,7 @@ def __init__(self, config):
1822
os.umask(0002)
1923

2024
def clear(self):
21-
path = os.path.join(self.dir, 'sessions')
25+
path = os.path.join(self.dir, self.name)
2226
if os.path.exists(path):
2327
os.remove(path)
2428
elif os.path.exists(path+'.db'): # dbm appends .db
@@ -38,26 +42,33 @@ def determine_db_type(self, path):
3842
db_type = 'dbm'
3943
return db_type
4044

41-
def get(self, sessionid, value):
45+
def get(self, infoid, value):
4246
db = self.opendb('c')
4347
try:
44-
if db.has_key(sessionid):
45-
values = marshal.loads(db[sessionid])
48+
if db.has_key(infoid):
49+
values = marshal.loads(db[infoid])
4650
else:
4751
return None
4852
return values.get(value, None)
4953
finally:
5054
db.close()
5155

52-
def set(self, sessionid, **newvalues):
56+
def getall(self, infoid):
57+
db = self.opendb('c')
58+
try:
59+
return marshal.loads(db[infoid])
60+
finally:
61+
db.close()
62+
63+
def set(self, infoid, **newvalues):
5364
db = self.opendb('c')
5465
try:
55-
if db.has_key(sessionid):
56-
values = marshal.loads(db[sessionid])
66+
if db.has_key(infoid):
67+
values = marshal.loads(db[infoid])
5768
else:
5869
values = {}
5970
values.update(newvalues)
60-
db[sessionid] = marshal.dumps(values)
71+
db[infoid] = marshal.dumps(values)
6172
finally:
6273
db.close()
6374

@@ -68,11 +79,11 @@ def list(self):
6879
finally:
6980
db.close()
7081

71-
def destroy(self, sessionid):
82+
def destroy(self, infoid):
7283
db = self.opendb('c')
7384
try:
74-
if db.has_key(sessionid):
75-
del db[sessionid]
85+
if db.has_key(infoid):
86+
del db[infoid]
7687
finally:
7788
db.close()
7889

@@ -81,7 +92,7 @@ def opendb(self, mode):
8192
eccentricities.
8293
'''
8394
# figure the class db type
84-
path = os.path.join(os.getcwd(), self.dir, 'sessions')
95+
path = os.path.join(os.getcwd(), self.dir, self.name)
8596
db_type = self.determine_db_type(path)
8697

8798
# new database? let anydbm pick the best dbm
@@ -94,3 +105,10 @@ def opendb(self, mode):
94105

95106
def commit(self):
96107
pass
108+
109+
class Sessions(BasicDatabase):
110+
name = 'sessions'
111+
112+
class OneTimeKeys(BasicDatabase):
113+
name = 'otks'
114+

0 commit comments

Comments
 (0)