PluginProbe
User Access Manager / 2.3.8
User Access Manager v2.3.8
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / src / View / UserGroups / UserGroupEditForm.php

UserGroupEditForm.php in User Access Manager 2.3.8, at src/View/UserGroups/UserGroupEditForm.php

155 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @var UserGroupController $controller
4 */
5
6 use UserAccessManager\Controller\Backend\UserGroupController;
7 use UserAccessManager\Object\ObjectHandler;
8
9 $userGroup = $controller->getUserGroup();
10 ?>
11 <form method="post" action="<?php echo $controller->getRequestUrl(); ?>">
12 <input type="hidden" value="insert_update_user_group" name="uam_action"/>
13 <?php
14 $controller->createNonceField($controller::INSERT_UPDATE_GROUP_NONCE);
15
16 if ($userGroup->getId() !== null) {
17 ?>
18 <input type="hidden" value="<?php echo $userGroup->getId(); ?>" name="userGroupId"/>
19 <?php
20 }
21 ?>
22 <table class="form-table">
23 <tbody>
24 <tr class="form-field form-required">
25 <th valign="top"><label for="userGroupName"><?php echo TXT_UAM_GROUP_NAME; ?></label></th>
26 <td>
27 <input size="40" value="<?php echo htmlentities($userGroup->getName() ?? ''); ?>"
28 id="userGroupName" name="userGroupName"/><br/>
29 <?php echo TXT_UAM_GROUP_NAME_DESC; ?>
30 </td>
31 </tr>
32 <tr class="form-field form-required">
33 <th valign="top"><label for="userGroupDescription"><?php echo TXT_UAM_GROUP_DESC; ?></label>
34 </th>
35 <td>
36 <input size="40" value="<?php echo htmlentities($userGroup->getDescription() ?? ''); ?>"
37 id="userGroupDescription" name="userGroupDescription"/><br/>
38 <?php echo TXT_UAM_GROUP_DESC_DESC; ?>
39 </td>
40 </tr>
41 <tr class="form-field form-required">
42 <th valign="top"><label for="ipRange"><?php echo TXT_UAM_GROUP_IP_RANGE; ?></label></th>
43 <td><input size="40" value="<?php echo htmlentities($userGroup->getIpRange() ?? ''); ?>"
44 id="ipRange" name="ipRange"/><br/>
45 <?php echo TXT_UAM_GROUP_IP_RANGE_DESC; ?>
46 </td>
47 </tr>
48 <tr class="form-field form-required">
49 <th valign="top"><label for="readAccess"><?php echo TXT_UAM_GROUP_READ_ACCESS; ?></label>
50 </th>
51 <td>
52 <select id="readAccess" name="readAccess">
53 <option value="group"
54 <?php
55 if ($userGroup->getReadAccess() === 'group') {
56 echo 'selected="selected"';
57 }
58 ?>
59 >
60 <?php echo TXT_UAM_ONLY_GROUP_USERS ?>
61 </option>
62 <option value="all"
63 <?php
64 if ($userGroup->getReadAccess() === 'all') {
65 echo 'selected="selected"';
66 }
67 ?>
68 >
69 <?php echo TXT_UAM_ALL_USERS ?>
70 </option>
71 </select><br/>
72 <?php echo TXT_UAM_GROUP_READ_ACCESS_DESC; ?>
73 </td>
74 </tr>
75 <tr class="form-field form-required">
76 <th valign="top"><label for="writeAccess"><?php echo TXT_UAM_GROUP_WRITE_ACCESS; ?></label>
77 </th>
78 <td>
79 <select id="writeAccess" name="writeAccess">
80 <option value="none"
81 <?php
82 if ($userGroup->getWriteAccess() === 'none') {
83 echo 'selected="selected"';
84 }
85 ?>
86 >
87 <?php echo TXT_UAM_NONE ?>
88 </option>
89 <option value="group"
90 <?php
91 if ($userGroup->getWriteAccess() === 'group') {
92 echo 'selected="selected"';
93 }
94 ?>
95 >
96 <?php echo TXT_UAM_ONLY_GROUP_USERS ?>
97 </option>
98 <option value="all"
99 <?php
100 if ($userGroup->getWriteAccess() === 'all') {
101 echo 'selected="selected"';
102 }
103 ?>
104 >
105 <?php echo TXT_UAM_ALL_USERS ?>
106 </option>
107 </select><br/>
108 <?php echo TXT_UAM_GROUP_WRITE_ACCESS_DESC; ?>
109 </td>
110 </tr>
111 <tr>
112 <th valign="top"><?php echo TXT_UAM_GROUP_ROLE; ?></th>
113 <td>
114 <ul class='uam_role'>
115 <?php
116 $groupRoles = $userGroup->getAssignedObjectsByType(
117 ObjectHandler::GENERAL_ROLE_OBJECT_TYPE
118 );
119 $roleNames = $controller->getRoleNames();
120
121 foreach ($roleNames as $role => $name) {
122 if ($role !== 'administrator') {
123 ?>
124 <li class="selectit">
125 <input id="role-<?php echo $role; ?>" type="checkbox"
126 <?php
127 if (isset($groupRoles[$role]) === true) {
128 echo 'checked="checked"';
129 }
130 ?>
131 value="<?php echo $role; ?>" name="roles[]"/>
132 <label for="role-<?php echo $role; ?>">
133 <?php echo $name; ?>
134 </label>
135 </li>
136 <?php
137 }
138 }
139 ?>
140 </ul>
141 </td>
142 </tr>
143 </tbody>
144 </table>
145 <p class="submit">
146 <input type="submit" value="<?php
147 if ($userGroup->getId() !== null) {
148 echo TXT_UAM_UPDATE_GROUP;
149 } else {
150 echo TXT_UAM_ADD_GROUP;
151 }
152 ?>" name="submit" class="button"/>
153 </p>
154 </form>
155