I think most of what would be needed, software wise, is already in wiki systems like Tiki (
http://tw.org). At least to use affiliate codes from existing sales websites. A very small amount of custom code could automatically add a "buy from bookseller x" link to posts, wiki entries, etc. and people could update their profiles with whichever affiliate links they wanted.
Setting up to actually accept and sell the eBooks, though, would require additional SW. Especially to add the "check for plagiarism" step, if desired. There are systems out there that could probably be integrated (e.g.
http://www.zizzoo.com/guides/ebook/) but I know I don't have time to try to figure it out right now. I think managing a system like this would need to be at least a part-time job, possibly a full-time job, and I have two of those already (work and grad school).