[Zope] acl_users dtml access help please...
Martijn Pieters
mj@antraciet.nl
Wed, 08 Sep 1999 12:22:17 +0200
At 11:47 08/09/99 , Stuart Woolford wrote:
>I'm working on a cut-down replacement for control of users in an acl_users
>directory from a dtml document, for example, I can:
>
><dtml-if names>
><dtml-call "REQUEST.set('names',names)">
><dtml-call "manage_users('Delete',REQUEST)">
><dtml-call "RESPONSE.redirect(URL0)">
></dtml-if>
>
>to remove users from a list of users selected for removal, it works well,
>HOWEVER..
>
>I also need to change the roles of users between a defined set I have in
>select
>lists on the form, I cannot work out how to do this, I either need to use
>manage_users('Change',...), for which I have to know their previous password,
>or I need to give them a new password, I cannot work out how to address the
>password a user already has, which is in the __ variable (to make it hard to
>get at, I'm guessing). This is in Zope 2.0.0, BTW.
>
>for example, I can quite happly use (roles and thepass are lists off my form)
><dtml-if roles>
><dtml-in roles>
><dtml-var expr="getUsers()[_['sequence-index']].name>"
><dtml-var expr="roles[_['sequence-index']]">:
><dtml-var expr="thepass[_['sequence-index']]"><p>
></dtml-in>
></dtml-if>
>Bt I cannot work out a line to print a password (ie: the equivalent of the
>following)
><dtml-var expr="getUsers()[_['sequence-index']]".__>:
You will need to use an External Method to be able to call _getPassword on
a user object. External Methods are allowed to call methods starting with
an underscore.
Don't try and read the __ variable, because that is not part of the User
object API. UserDB for example uses _getPassword to return the password
stored in the backend database.
--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------