Default new users to Contributor and Member?

11 messages Options
Embed this post
Permalink
I, Valdes () Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
How does one make a new Member automatically be a Contributor as well
on registration? Thanks! -- IV

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
ajung () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
On 01.07.09 17:18, Ignacio Valdes wrote:
> How does one make a new Member automatically be a Contributor as well
> on registration? Thanks! -- IV

Customize the script called during the registration phase the addMember()
API of the registration tool. The API provides a 'roles' parameter.

-aj

[lists.vcf]

begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[hidden email]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard



------------------------------------------------------------------------------

_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
I, Valdes () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
In reply to this post by I, Valdes
Thanks! Where does that routine live? ZMI, file system? What path? -- IV

On Wed, Jul 1, 2009 at 10:35 AM, Andreas Jung<[hidden email]> wrote:
> On 01.07.09 17:18, Ignacio Valdes wrote:
>> How does one make a new Member automatically be a Contributor as well
>> on registration? Thanks! -- IV
>
> Customize the script called during the registration phase the addMember()
> API of the registration tool. The API provides a 'roles' parameter.
>
> -aj
>

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
I, Valdes () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
Me no see which file? Looks like a bunch of testing code to me:

[root@server1 Plone-3.1]# grep -H -r "AddMember" .
grep: ./zeocluster/var/zeo.zdsock: No such device or address
grep: ./zeocluster/var/client2/zopectlsock: No such device or address
grep: ./zeocluster/var/client1/zopectlsock: No such device or address
Binary file ./zeocluster/var/filestorage/Data.fs matches
Binary file ./zeocluster/var/filestorage/Data.fs.old matches
./zeocluster/parts/plone/GroupUserFolder/tests/testPloneTools.py:
def testAnonAddMember(self):
./zeocluster/parts/plone/GroupUserFolder/tests/testPloneTools.py:
def testMemberAddMember(self):
./zeocluster/parts/plone/GroupUserFolder/tests/testPloneTools.py:
def testManagerAddMember(self):
./zeocluster/parts/plone/PlonePAS/tests/test_groups_tool.py:    def
testAnonAddMember(self):
./zeocluster/parts/plone/PlonePAS/tests/test_groups_tool.py:    def
testMemberAddMember(self):
./zeocluster/parts/plone/PlonePAS/tests/test_groups_tool.py:    def
testManagerAddMember(self):
./zeocluster/parts/plone/PloneTestCase/testMembershipTool.py:    def
testAddMember(self):
./zeocluster/parts/plone/PloneTestCase/testMembershipTool.py:    def
testAddMemberIfMemberExists(self):
Binary file ./zeocluster/parts/plone/PloneTestCase/testMembershipTool.pyc
matches
./zeocluster/parts/plone/CMFPlone/tests/testGroupDataTool.py:    def
testAddMember(self):
./zeocluster/parts/plone/CMFPlone/tests/testGroupDataTool.py:    def
testAnonAddMember(self):
./zeocluster/parts/plone/CMFPlone/tests/testGroupDataTool.py:    def
testMemberAddMember(self):
./zeocluster/parts/plone/CMFPlone/tests/testGroupDataTool.py:    def
testManagerAddMember(self):
./zeocluster/parts/plone/CMFTestCase/testMembershipTool.py:    def
testAddMember(self):
./zeocluster/parts/plone/CMFTestCase/testMembershipTool.py:    def
testAddMemberIfMemberExists(self):
Binary file ./zeocluster/parts/plone/CMFTestCase/testMembershipTool.pyc matches
./zeocluster/parts/plone/CMFDefault/help/TODO.stx:
folder":AddMemberToUserFolder
./zeocluster/parts/plone/CMFDefault/help/Actor_MembershipManager.stx:
     standard user folder":AddMemberToUserFolder
[root@server1 Plone-3.1]#


On Wed, Jul 1, 2009 at 11:14 AM, Andreas Jung<[hidden email]> wrote:

> grep is your friend
>
> -aj
>
> On 01.07.09 18:12, Ignacio Valdes wrote:
>> Thanks! Where does that routine live? ZMI, file system? What path? -- IV
>>
>> On Wed, Jul 1, 2009 at 10:35 AM, Andreas Jung<[hidden email]> wrote:
>>
>>> On 01.07.09 17:18, Ignacio Valdes wrote:
>>>
>>>> How does one make a new Member automatically be a Contributor as well
>>>> on registration? Thanks! -- IV
>>>>
>>> Customize the script called during the registration phase the addMember()
>>> API of the registration tool. The API provides a 'roles' parameter.
>>>
>>> -aj
>>>
>>>
>
>
> --
> ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
> Web: www.zopyx.com - Email: [hidden email] - Phone +49 - 7071 - 793376
> Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
> Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
> ------------------------------------------------------------------------
> E-Publishing, Python, Zope & Plone development, Consulting
>
>
>

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
ajung () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
On 02.07.09 05:25, Ignacio Valdes wrote:
> Me no see which file? Looks like a bunch of testing code to me:
>
> [root@server1 Plone-3.1]# grep -H -r "AddMember"

Reading helps. AddMember != addMember

-aj

[lists.vcf]

begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[hidden email]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard



------------------------------------------------------------------------------

_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
I, Valdes () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
In reply to this post by I, Valdes
Hope this works:

 vim ./zeocluster/parts/plone/CMFCore/interfaces/_tools.py

Changed line 1109 to:

   def addMember(id, password, roles=('Member','Contributor',), domains='',
                  properties=None):


On Wed, Jul 1, 2009 at 10:34 PM, Andreas Jung<[hidden email]> wrote:
> On 02.07.09 05:25, Ignacio Valdes wrote:
>> Me no see which file? Looks like a bunch of testing code to me:
>>
>> [root@server1 Plone-3.1]# grep -H -r "AddMember"
>
> Reading helps. AddMember != addMember
>
> -aj
>

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
ajung () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
On 02.07.09 05:44, Ignacio Valdes wrote:
> Hope this works:
>
>  vim ./zeocluster/parts/plone/CMFCore/interfaces/_tools.py
>
> Changed line 1109 to:
>
>    def addMember(id, password, roles=('Member','Contributor',), domains='',
>                   properties=None):
>  

Once again, reading helps. I asked you to customize the *registration
script*
used by Plone. Grepping through the Plone sources clearly gives you this
obvious hit:

skins/plone_login/register.cpy:  
portal_registration.addMember(username, password, properties=REQUEST,
REQUEST=context.REQUEST)


You will find the *same* script by using the 'Find' functionality in
portal_skins.

And do not modify touch code of underlying frameworks if you don't know
about the impacts.

-aj

[lists.vcf]

begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[hidden email]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard



------------------------------------------------------------------------------

_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
I, Valdes () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
In reply to this post by I, Valdes
Found it, do not know how/what to modify. I see the parameter list and
the call. -- IV

On Wed, Jul 1, 2009 at 10:48 PM, Andreas Jung<[hidden email]> wrote:

> On 02.07.09 05:44, Ignacio Valdes wrote:
>> Hope this works:
>>
>>  vim ./zeocluster/parts/plone/CMFCore/interfaces/_tools.py
>>
>> Changed line 1109 to:
>>
>>    def addMember(id, password, roles=('Member','Contributor',), domains='',
>>                   properties=None):
>>
>
> Once again, reading helps. I asked you to customize the *registration
> script*
> used by Plone. Grepping through the Plone sources clearly gives you this
> obvious hit:
>
> skins/plone_login/register.cpy:
> portal_registration.addMember(username, password, properties=REQUEST,
> REQUEST=context.REQUEST)
>
>
> You will find the *same* script by using the 'Find' functionality in
> portal_skins.
>
> And do not modify touch code of underlying frameworks if you don't know
> about the impacts.
>
> -aj
>

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
I, Valdes () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
On Wed, Jul 1, 2009 at 11:06 PM, Andreas Jung<[hidden email]> wrote:

> On 02.07.09 05:59, Ignacio Valdes wrote:
>> Found it, do not know how/what to modify. I see the parameter list and
>> the call. -- IV
>>
>
> Adding additional parameters to a method call is basic skill you should
> know about when using Python. If you don't know Python, either read
> the tutorial or don't try to customize anything.
>
> Andreas
>
Can you please tell me what the modification is? This is the last
piece I have to do of a migration from an old Plone. -- IV

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Ignacio Valdes-3 () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
On Wed, Jul 1, 2009 at 11:12 PM, Andreas Jung<[hidden email]> wrote:

>
>
> On Thu, Jul 2, 2009 at 06:09, Ignacio Valdes <[hidden email]> wrote:
>>
>> On Wed, Jul 1, 2009 at 11:06 PM, Andreas Jung<[hidden email]> wrote:
>> > On 02.07.09 05:59, Ignacio Valdes wrote:
>> >> Found it, do not know how/what to modify. I see the parameter list and
>> >> the call. -- IV
>> >>
>> >
>> > Adding additional parameters to a method call is basic skill you should
>> > know about when using Python. If you don't know Python, either read
>> > the tutorial or don't try to customize anything.
>> >
>> > Andreas
>> >
>> Can you please tell me what the modification is? This is the last
>> piece I have to do of a migration from an old Plone. -- IV
>
> Sorry but I refuse being your idiot teaching you *basic skills*
> like adding a keyword parameter to a function call.  Please
> use your brain. I strongly disapprove such an attitude for changing
> things without thinking what you are doing and expecting
> everthing being presented on the golden tray.
>
> And if you don't get: you figured out yourself that the API method provides
> a roles
> parameter. If you can the same parameter to the code calling this method,
> you should not try to program - not even the simplest things...
>
> Andreas
>

As you wish, your sadistic lordship.

-- IV

------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users
Raphael Ritz () Re: Default new users to Contributor and Member?
Reply Threaded More More options
Print post
Permalink
In reply to this post by I, Valdes
Ignacio Valdes wrote:

> On Wed, Jul 1, 2009 at 11:06 PM, Andreas Jung<[hidden email]> wrote:
>> On 02.07.09 05:59, Ignacio Valdes wrote:
>>> Found it, do not know how/what to modify. I see the parameter list and
>>> the call. -- IV
>>>
>> Adding additional parameters to a method call is basic skill you should
>> know about when using Python. If you don't know Python, either read
>> the tutorial or don't try to customize anything.
>>
>> Andreas
>>
> Can you please tell me what the modification is? This is the last
> piece I have to do of a migration from an old Plone. -- IV
>
> ------------------------------------------------------------------------------


Is this really that hard?

The skin script 'register' calls

   portal_registration.addMember(username, password, properties=REQUEST,
REQUEST=REQUEST)

The registration tool's addMember method  has the following signature:

   self, id, password, roles=[], domains=[], properties=[], REQUEST=[]

That gives?

Customize the skin script (TTW in ZMI or in a skin layer of
one of your own products) to call

   portal_registration.addMember(username, password,
roles=['Member','Contributor'], properties=REQUEST, REQUEST=REQUEST)

instead.

I'm trying not to come across as arrogant but really, all this
info was available in this thread already.
If you have a hard time figuring that out nevertheless you
would certainly benefit from reading up a bit on the essentials
of Python, sorry.

Raphael


------------------------------------------------------------------------------
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users