1 <h1 tal:replace="structure here/manage_page_header">Header</h1>
2 <h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
3 tal:replace="structure here/manage_tabs">Tabs</h2>
4 <tal:block tal:define="
5 global user python:here.getUser(request.username);
6 kind python:test(user.isGroup(), 'Group', 'User');
7 icon python:test(user.isGroup(), 'img_group', 'img_user');
8 color python:test(user.isGroup(), here.acl_users.group_color, here.acl_users.user_color);
13 <div class="std-text">
14 <img src="" alt="kind" tal:attributes="src icon; alt kind" align="middle">
15 <strong tal:condition="user/isGroup" tal:content="structure string:${user/asHTML} (Group)">toto group management</strong>
16 <strong tal:condition="not: user/isGroup" tal:content="structure string:${user/asHTML} (User)">toto user management</strong>
22 <form action="" method="POST" tal:attributes="action here/absolute_url">
23 <tal:block tal:define="
24 label_groups python:user.getGroups();
25 label_groups_no_recurse python:user.getImmediateGroups();
26 label_groups_recurse python:filter(lambda x: x not in label_groups_no_recurse, label_groups);
27 groups_no_recurse python:map(lambda x: here.getUser(x), label_groups_no_recurse);
28 groups_recurse python:map(lambda x: here.getUser(x), label_groups_recurse);
29 roles python:filter(lambda x: x not in ('Authenticated', 'Shared'), user.getRoles());
30 roles_no_recurse python:filter(lambda x: x not in ('Authenticated', 'Shared'), user.getUserRoles());
31 roles_recurse python:filter(lambda x: x not in roles_no_recurse, roles)
34 <table cellspacing="10">
37 <input type="hidden" name="user" value="" tal:attributes="value user/getUserName">
39 <table bgcolor="#EEEEEE">
41 <th class="list-header"><span tal:replace="kind" /> name</th>
42 <td class="list-item">
43 <strong tal:content="structure user/asHTML">
48 <th class="list-header">Member of groups</th>
49 <td class="list-item">
50 <span tal:repeat="group groups_no_recurse" >
51 <span tal:replace="structure group/asHTML"></span><span tal:condition="not:repeat/group/end">, </span>
56 <th class="list-header">Implicitly member of groups</th>
57 <td class="list-item">
58 <span tal:repeat="group groups_recurse" >
59 <span tal:replace="structure python:group.asHTML(implicit=1)"></span><span tal:condition="not:repeat/group/end">, </span>
64 <th class="list-header">Has roles</th>
65 <td class="list-item">
66 <div class="list-item">
67 <span tal:repeat="role roles_no_recurse" >
69 tal:attributes="color here/role_color">
70 <span tal:replace="role"></span><span tal:condition="not:repeat/role/end">, </span>
77 <th class="list-header">Implicitly has roles (from groups)</th>
78 <td class="list-item">
79 <div class="list-item">
80 <span tal:repeat="role roles_recurse" >
82 tal:attributes="color here/role_color">
83 <i><span tal:replace="role"></span></i><span tal:condition="not:repeat/role/end">, </span>
90 <td colspan="4" align="center"><br>
91 <input type="submit" name="changeUser:method" value="Change" />
92 <tal:block tal:replace="nothing">
93 XXX have to make this work again
95 <input type="submit" name="deleteUser:method" value="Delete" />
108 <table bgcolor="#EEEEEE">
111 <!-- Groups selection -->
113 <tr class="list-header">
114 <th colspan="2">Set groups</th>
117 <tr tal:repeat="group here/getGroups">
119 <input type="checkbox" name="groups:list" value="" checked=""
120 tal:condition="python: group.getUserName() != user.getUserName()"
122 value group/getUserName;
123 checked python:test(group.getId() in user.getGroupIds(), '1', '')">
126 <div class="list-item" tal:content="structure group/asHTML"></div>
133 <!-- Roles selection -->
135 <tr class="list-header">
136 <th colspan="2">Set roles</th>
139 <tr tal:repeat="role here/valid_roles">
140 <td tal:condition="python:role not in ('Authenticated', 'Anonymous', 'Shared')">
141 <input type="checkbox" name="roles:list" value="" checked=""
142 tal:attributes="value role; checked python:test(role in user.getUserRoles(), '1', '')">
144 <td tal:condition="python:role not in ('Authenticated', 'Anonymous', 'Shared')">
145 <div class="list-item"><font color="" tal:attributes="color here/role_color" tal:content="role">Role</font></div>
158 <tal:block tal:condition="nothing|user/isGroup">
160 <h4>Group contents</h4>
162 <table bgcolor="#EEEEEE" tal:define="content python:list(user.getImmediateGroups())">
163 <tr class="list-header">
165 <th class="list-header">Member <br>of groups</th>
166 <th class="list-header">Implicitly <br>member <br>of groups</th>
167 <th class="list-header">Has roles</th>
168 <th class="list-header">Implicitly <br>has roles <br>(from groups)</th>
172 tal:repeat="user python:content" class="" tal:attributes="class python:test(path('repeat/user/odd'), 'row-hilite', 'row-normal')"
175 label_groups python:user.getGroups();
176 label_groups_no_recurse python:user.getImmediateGroups();
177 label_groups_recurse python:filter(lambda x: x not in label_groups_no_recurse, label_groups);
178 groups_no_recurse python:map(lambda x: here.getUser(x), label_groups_no_recurse);
179 groups_recurse python:map(lambda x: here.getUser(x), label_groups_recurse);
180 roles python:filter(lambda x: x not in ('Authenticated', 'Shared'), user.getRoles());
181 roles_no_recurse python:filter(lambda x: x not in ('Authenticated', 'Shared'), user.getUserRoles());
182 roles_recurse python:filter(lambda x: x not in roles_no_recurse, roles);"
184 <td class="list-item">
185 <span tal:repeat="group groups_no_recurse" >
186 <span tal:replace="structure group/asHTML"></span><span tal:condition="not:repeat/group/end">, </span>
189 <td class="list-item">
190 <span tal:repeat="group groups_recurse" >
191 <span tal:replace="structure python:user.asHTML(implicit=1)"></span><span tal:condition="not:repeat/group/end">, </span>
194 <td class="list-item">
195 <div class="list-item">
196 <span tal:repeat="role roles_no_recurse" >
198 tal:attributes="color here/role_color">
199 <span tal:replace="role"></span><span tal:condition="not:repeat/role/end">, </span>
204 <td class="list-item">
205 <div class="list-item">
206 <span tal:repeat="role roles_recurse" >
208 tal:attributes="color here/role_color">
209 <i><span tal:replace="role"></span></i><span tal:condition="not:repeat/role/end">, </span>
221 <h4>Instructions</h4>
223 <p class="form-help">
224 To change roles for a <span tal:replace="kind" />,
225 select the roles you want to give it and the groups it belongs to in the forms on the right and click "Change".<br />
229 <h4>Important notice / disclaimer</h4>
232 <p class="form-help">
233 This form uses the regular Zope Security API from the underlying user folders. However, you may experience problems with some
234 of them, especially if they are not tuned to allow user adding. For example, an LDAPUserFolder can be configured to disable
235 users management. In case this form doesn't work, you'll have to do things by hand within the 'Users' and 'Groups' GRUF folders.
238 <p class="form-help">
239 This is not a GRUF limitation ! :-)
245 <h1 tal:replace="structure here/manage_page_footer">Footer</h1>