Author: ajaquith
Date: Thu May 22 21:14:42 2008
New Revision: 659411
URL: http://svn.apache.org/viewvc?rev=659411&view=rev
Log:
Checked in three new features for UserProfile and the UserDatabase classes.
First, profiles can now store arbitrary Serializable objects via a new method
in UserProfile, getAttributes, that returns a Map<Serializable,Serializable>
that can be directly manipulated. Arbitrary attributes such as user preferences
can be added to the profile and be guaranteed to be persisted on save. Second,
the UserProfile now has two methods setLockExpiry(Date)/getLockExpiry that
allow callers to disable user profiles. These are NOT enforced in
AuthenticationManager yet. Third, user profile now have a 'uid' field that
stores a long value for uniquely identifying users. Existing profiles without
UIDs are automatically upgraded when they are loaded by a findBy___() method.
The default XML/JDBC UserDatabase implementations have been enhanced to support
all of these new features. If you have custom UserDatabase implementations, you
should take a look at the new code.
Modified:
incubator/jspwiki/trunk/tests/etc/jspwiki.properties.tmpl
incubator/jspwiki/trunk/tests/etc/jspwiki_rcs.properties.tmpl
incubator/jspwiki/trunk/tests/etc/jspwiki_vers.properties.tmpl
incubator/jspwiki/trunk/tests/etc/userdatabase.xml.tmpl
Modified: incubator/jspwiki/trunk/tests/etc/jspwiki.properties.tmpl
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/jspwiki.properties.tmpl?rev=659411&r1=659410&r2=659411&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/jspwiki.properties.tmpl (original)
+++ incubator/jspwiki/trunk/tests/etc/jspwiki.properties.tmpl Thu May 22
21:14:42 2008
@@ -28,9 +28,6 @@
jspwiki.encoding = ISO-8859-1
-jspwiki.authenticator = FileAuthenticator
-jspwiki.fileAuthenticator.fileName = @tests.auth.filename@
-
jspwiki.filterConfig = @tests.filter@
jspwiki.baseURL = http://localhost/
@@ -84,6 +81,7 @@
jspwiki.userdatabase.datasource=jdbc/UserDatabase
jspwiki.userdatabase.table=users
+jspwiki.userdatabase.uid=uid
jspwiki.userdatabase.email=email
jspwiki.userdatabase.fullName=full_name
jspwiki.userdatabase.loginName=login_name
@@ -91,6 +89,8 @@
jspwiki.userdatabase.wikiName=wiki_name
jspwiki.userdatabase.created=created
jspwiki.userdatabase.modified=modified
+jspwiki.userdatabase.lockExpiry=lock_expiry
+jspwiki.userdatabase.attributes=attributes
jspwiki.userdatabase.roleTable=roles
jspwiki.userdatabase.role=role
jspwiki.groupdatabase.datasource=jdbc/GroupDatabase
Modified: incubator/jspwiki/trunk/tests/etc/jspwiki_rcs.properties.tmpl
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/jspwiki_rcs.properties.tmpl?rev=659411&r1=659410&r2=659411&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/jspwiki_rcs.properties.tmpl (original)
+++ incubator/jspwiki/trunk/tests/etc/jspwiki_rcs.properties.tmpl Thu May 22
21:14:42 2008
@@ -59,6 +59,7 @@
jspwiki.userdatabase.datasource=jdbc/UserDatabase
jspwiki.userdatabase.table=users
+jspwiki.userdatabase.uid=uid
jspwiki.userdatabase.email=email
jspwiki.userdatabase.fullName=full_name
jspwiki.userdatabase.loginName=login_name
@@ -66,6 +67,8 @@
jspwiki.userdatabase.wikiName=wiki_name
jspwiki.userdatabase.created=created
jspwiki.userdatabase.modified=modified
+jspwiki.userdatabase.lockExpiry=lock_expiry
+jspwiki.userdatabase.attributes=attributes
jspwiki.userdatabase.roleTable=roles
jspwiki.userdatabase.role=role
jspwiki.groupdatabase.datasource=jdbc/GroupDatabase
Modified: incubator/jspwiki/trunk/tests/etc/jspwiki_vers.properties.tmpl
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/jspwiki_vers.properties.tmpl?rev=659411&r1=659410&r2=659411&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/jspwiki_vers.properties.tmpl (original)
+++ incubator/jspwiki/trunk/tests/etc/jspwiki_vers.properties.tmpl Thu May 22
21:14:42 2008
@@ -61,6 +61,7 @@
jspwiki.userdatabase.datasource=jdbc/UserDatabase
jspwiki.userdatabase.table=users
+jspwiki.userdatabase.uid=uid
jspwiki.userdatabase.email=email
jspwiki.userdatabase.fullName=full_name
jspwiki.userdatabase.loginName=login_name
@@ -68,6 +69,8 @@
jspwiki.userdatabase.wikiName=wiki_name
jspwiki.userdatabase.created=created
jspwiki.userdatabase.modified=modified
+jspwiki.userdatabase.lockExpiry=lock_expiry
+jspwiki.userdatabase.attributes=attributes
jspwiki.userdatabase.roleTable=roles
jspwiki.userdatabase.role=role
jspwiki.groupdatabase.datasource=jdbc/GroupDatabase
Modified: incubator/jspwiki/trunk/tests/etc/userdatabase.xml.tmpl
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/etc/userdatabase.xml.tmpl?rev=659411&r1=659410&r2=659411&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/etc/userdatabase.xml.tmpl (original)
+++ incubator/jspwiki/trunk/tests/etc/userdatabase.xml.tmpl Thu May 22 21:14:42
2008
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><users>
- <user email="[EMAIL PROTECTED]" fullName="Janne Jalkanen" loginName="janne"
password="{SSHA}1WFv9OV11pD5IySgVH3sFa2VlCyYjbLrcVT/qw=="
wikiName="JanneJalkanen" created="2006.06.25 at 14:50:54:000 EDT"
lastModified="2006.01.26 at 14:50:54:000 EST"/>
- <user email="[EMAIL PROTECTED]" loginName="user"
password="{SSHA}iQWmcKE8PyO965jh4+VNLYbxagaDdS0nC9GmuQ==" created="2006.06.25
at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
+ <user uid="-7739839977499061014" email="[EMAIL PROTECTED]" fullName="Janne
Jalkanen" loginName="janne"
password="{SSHA}1WFv9OV11pD5IySgVH3sFa2VlCyYjbLrcVT/qw=="
wikiName="JanneJalkanen" created="2006.06.25 at 14:50:54:000 EDT"
lastModified="2006.01.26 at 14:50:54:000 EST">
+
<attributes>rO0ABXNyABFqYXZhLnV0aWwuSGFzaE1hcAUH2sHDFmDRAwACRgAKbG9hZEZhY3RvckkACXRocmVzaG9sZHhwP0AAAAAAAAx3CAAAABAAAAACdAAKYXR0cmlidXRlMXQAEXNvbWUgcmFuZG9tIHZhbHVldAAKYXR0cmlidXRlMnQADWFub3RoZXIgdmFsdWV4</attributes>
+ </user>
+ <user uid="-8629747547991531672" email="[EMAIL PROTECTED]" loginName="user"
password="{SSHA}iQWmcKE8PyO965jh4+VNLYbxagaDdS0nC9GmuQ==" created="2006.06.25
at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
<user loginName="admin" wikiName="Administrator" fullName="Administrator"
email="[EMAIL PROTECTED]"
password="{SSHA}6YNKYMwXICUf5pMvYUZumgbFCxZMT2njtUQtJw==" created="2006.06.25
at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
<user loginName="Alice" wikiName="Alice" fullName="Alice" email="[EMAIL
PROTECTED]" password="{SSHA}3V4zI5W6mT+x5NIHKI2KFQIYBdnAYKNOE9Aj+Q=="
created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at
14:50:54:000 EST"/>
<user loginName="Bob" wikiName="Bob" fullName="Bob" email="[EMAIL
PROTECTED]" password="{SSHA}NP3aAmiwK0gHywTe4qbY6klKDqnZ+F9ym9YiLg=="
created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at
14:50:54:000 EST"/>
<user loginName="Charlie" wikiName="Charlie" fullName="Charlie"
email="[EMAIL PROTECTED]"
password="{SSHA}wn81B14F9axtTVYsipQKC2OWQHlc6EcpMSe58Q==" created="2006.06.25
at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
<user loginName="Fred" wikiName="FredFlintstone" fullName="Fred Flintstone"
email="[EMAIL PROTECTED]"
password="{SSHA}iDeE9dysPUE28SWd6yeIqiIj9sIVyiMM7VnMKQ==" created="2006.06.25
at 14:50:54:000 EDT" lastModified="2006.01.26 at 14:50:54:000 EST"/>
<user loginName="Biff" wikiName="Biff" fullName="Biff" email="[EMAIL
PROTECTED]" password="{SSHA}xKAIienaZZHhKTGCNv5Li6lzeemaSs6ZYXTHFQ=="
created="2006.06.25 at 14:50:54:000 EDT" lastModified="2006.01.26 at
14:50:54:000 EST"/>
-</users>
\ No newline at end of file
+</users>