Hi WikiNote,
On 18 Feb 2017, at 04:07, WikiNote Org
<thewikinoteorg(a)gmail.com> wrote:
My xwiki is open for registering anyone, as it needs to be.
Lately I have been seeing non-genuine users attaching useless, even illegal
documents and images to their profile pages (some kind of drug trade racket
I suspect).
So, I want to:
1) restrict number of attachments to Profile page to only 1 or 2.
2) have separate inventory of images to be used in whole wiki (like
Wikipedia), thereby disallowing attachments to any other page
So basically a way to control on which pages (taking nested pages into account)
attachments can be added and a way to control the # of attachments for a given page
(taking nested pages into account).
For the inventory idea, the only downside I can see is that you’d need to be careful not
to have too many attachments on a single page since this could lead to memory issues when
loading the page.
Generally speaking this looks like a good idea and I’d suggest that you create a jira
issue for tracking this idea.
Right now the feature you ask doesn’t exist out of the box. But as with everything in
XWiki, with a bit of coding it’s possible :)
Technically speaking, this means modifying the UploadAction.java class and checking for
config parameters in there. The nice thing (but not mandatory) would be to reimplement
UploadAction which is coded using some old technology with a newer EnityResourceAction
(see
http://extensions.xwiki.org/xwiki/bin/view/Extension/Resource+API#HAddingan…).
Thanks
-Vincent
Help appreciated..