[Zope-CMF] Re: [dev] createMemberarea: small proposal

Yuppie schubbe@web.de
Mon, 26 May 2003 20:00:19 +0200


Tres Seaver wrote:
> On Mon, 2003-05-26 at 08:16, Yuppie wrote:
>>I think the best solution would be to call createMemberarea() from the 
>>logged_in page. But I'm afraid this would be too big a change.
> Shouldn't be a problem;  you might leave a way for a manager to force
> creation of the member area (e.g., so that they can script modification
> to its "skeleton" content :)
> 'wrapUser' shouldn't be creating the member area at all, ideally.  I
> like the idea of calling 'createMemberArea' from the logged_in page, and
> leaving it possible for managers to call it from scripts.

Is there really a need to call createMemberarea() as manager? If so, we 
still have to care about Ownership and Owner role.

I'd rather add a hook that allows the scripting. The script would be 
executed as soon as the member logs in (and if no member area exists).

So that's what I would do:

- subclass 'MembershipTool' from 'Folder' instead of 'SimpleItem'

- remove the member_id argument from createMemberarea(), using 
getAuthenticatedMember() instead; make createMemberarea() a public method

- add a hook to createMemberarea() that looks for a 
'createMemberContent' script inside the tool; if there is no script, 
create content the old way

- remove the createMemberarea() call from wrapUser()

- add the createMemberarea() call to 'logged_in'

(BTW: I hate PageTemplates like 'logged_in'. It should be split of in a 
script, login_failure.pt, login_success.pt and login_welcome.pt.)

We could also add a default 'createMemberContent' script and default 
skeleton content. 'PortalGenerator' would need a new setup method for this.

I'm still not sure what should go in CMFCore, what in CMFDefault, what 
in CMF-1_4-branch and what in HEAD.

Any thoughts?