hmmm.... I'm really against adding new features, in a RC phase!
I'll prefer this to be rolled back to be honest.
However if we want to keep it then we need some tests that'll prove
it's not breaking anything.
We shouldn't add dangerous stuff like this in a RC phase and
especially not without a vote IMO.
Thanks
-Vincent
On Mar 3, 2008, at 10:18 PM, sdumitriu (SVN) wrote:
Author: sdumitriu
Date: 2008-03-03 22:18:54 +0100 (Mon, 03 Mar 2008)
New Revision: 8184
Modified:
xwiki-platform/core/branches/xwiki-core-1.3/xwiki-core/src/main/
java/com/xpn/xwiki/XWiki.java
Log:
XWIKI-2170: Allow inactive users to see specific pages
Done.
Patch submitted by David Ward, applied with minor changes.
Merged from trunk@8181
Modified: xwiki-platform/core/branches/xwiki-core-1.3/xwiki-core/src/
main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki-platform/core/branches/xwiki-core-1.3/xwiki-core/src/main/
java/com/xpn/xwiki/XWiki.java 2008-03-03 21:18:14 UTC (rev 8183)
+++ xwiki-platform/core/branches/xwiki-core-1.3/xwiki-core/src/main/
java/com/xpn/xwiki/XWiki.java 2008-03-03 21:18:54 UTC (rev 8184)
@@ -4211,13 +4211,26 @@
null,
args);
} else if (checkActive(context) == 0) {
- Object[] args = {context.getUser()};
- setPhonyDocument(docName, context, vcontext);
- throw new
XWikiException(XWikiException.MODULE_XWIKI_USER,
- XWikiException.ERROR_XWIKI_USER_INACTIVE,
- "User {0} account is inactive",
- null,
- args);
+ boolean allow = false;
+ String allowed =
Param("xwiki.inactiveuser.allowedpages", "");
+ if (context.getAction().equals("view") && !
allowed.equals("")) {
+ String[] allowedList = StringUtils.split(allowed,
" ,");
+ for (int i=0; i < allowedList.length; i++) {
+ if (allowedList[i].equals(doc.getFullName())) {
+ allow = true;
+ break;
+ }
+ }
+ }
+ if (!allow) {
+ Object[] args = {context.getUser()};
+ setPhonyDocument(docName, context, vcontext);
+ throw new
XWikiException(XWikiException.MODULE_XWIKI_USER,
+ XWikiException.ERROR_XWIKI_USER_INACTIVE,
+ "User {0} account is inactive",
+ null,
+ args);
+ }
}
context.put("doc", doc);