PluginProbe ʕ •ᴥ•ʔ
Advanced Access Manager – Access Governance for WordPress / trunk
Advanced Access Manager – Access Governance for WordPress vtrunk
6.8.4 6.8.5 6.9.0 6.9.1 6.9.10 6.9.11 6.9.12 6.9.13 6.9.14 6.9.15 6.9.16 6.9.17 6.9.18 6.9.19 6.9.2 6.9.20 6.9.21 6.9.22 6.9.23 6.9.24 6.9.25 6.9.26 6.9.27 6.9.28 6.9.29 6.9.3 6.9.30 6.9.31 6.9.32 6.9.33 6.9.34 6.9.35 6.9.36 6.9.37 6.9.38 6.9.39 6.9.4 6.9.41 6.9.42 6.9.43 6.9.44 6.9.45 6.9.46 6.9.47 6.9.48 6.9.49 6.9.5 6.9.51 6.9.6 6.9.7 6.9.8 6.9.9 7.0.0 7.0.0-alpha.6 7.0.0-alpha.7 7.0.0-beta.1 7.0.0-rc1 7.0.0-rc2 7.0.0-rc3 7.0.1 7.0.10 7.0.11 7.0.2 7.0.3 7.0.4 7.0.5 7.0.6 7.0.7 7.0.8 7.0.9 7.1.0 7.1.1 trunk 3.0 4.0 4.0.1 4.1 4.2 4.3 4.4 4.4.1 4.5 4.6 4.6.1 4.6.2 4.7 4.7.1 4.7.2 4.7.5 4.7.6 4.8 4.8.1 4.9 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.5.1 4.9.5.2 5.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1 5.1.1 5.10 5.11 5.2 5.2.1 5.2.5 5.2.6 5.2.7 5.3 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.4 5.4.1 5.4.2 5.4.3 5.4.3.1 5.4.3.2 5.5 5.5.1 5.5.2 5.6 5.6.1 5.6.1.1 5.7 5.7.1 5.7.2 5.7.3 5.8 5.8.1 5.8.2 5.8.3 5.9 5.9.1 5.9.1.1 5.9.2 5.9.2.1 5.9.3 5.9.4 5.9.5 5.9.6 5.9.6.1 5.9.6.2 5.9.6.3 5.9.7 5.9.7.1 5.9.7.2 5.9.7.3 5.9.8 5.9.8.1 5.9.9 5.9.9.1 6.0.0 6.0.1 6.0.2 6.0.3 6.0.4 6.0.5 6.1.0 6.1.1 6.2.0 6.2.1 6.2.2 6.3.0 6.3.1 6.3.2 6.3.3 6.4.0 6.4.1 6.4.2 6.4.3 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.6.0 6.6.1 6.6.2 6.6.3 6.6.4 6.7.0 6.7.1 6.7.2 6.7.3 6.7.4 6.7.5 6.7.6 6.7.7 6.7.8 6.7.9 6.8.0 6.8.1 6.8.2 6.8.3
advanced-access-manager / application / Backend / tmpl / service / backend-menu.php
advanced-access-manager / application / Backend / tmpl / service Last commit date
access-denied-redirect.php 1 year ago admin-toolbar.php 1 year ago api-route.php 1 year ago backend-menu.php 1 year ago capability.php 1 year ago content.php 1 year ago identity.php 1 year ago jwt.php 5 months ago login-redirect.php 1 year ago logout-redirect.php 1 year ago metabox.php 1 year ago not-found-redirect.php 1 year ago policy.php 1 year ago url.php 1 year ago welcome.php 1 year ago widget.php 1 year ago
backend-menu.php
236 lines
1 <?php /** @version 7.0.0 **/ ?>
2
3 <?php if (defined('AAM_KEY')) { ?>
4 <?php
5 $access_level = AAM_Backend_AccessLevel::get_instance();
6 $service = $access_level->backend_menu();
7 ?>
8 <div class="aam-feature" id="admin_menu-content">
9 <?php if (AAM::api()->config->get('core.settings.ui.tips')) { ?>
10 <div class="row">
11 <div class="col-xs-12">
12 <p class="aam-info">
13 <?php echo sprintf(__('Manage access to the backend menu and its submenu items. With the premium %sadd-on%s, you can also activate "restricted mode," allowing you to whitelist specific menu items. For more details, refer to our official documentation page %shere%s.', 'advanced-access-manager'), '<a href="https://aamportal.com/premium?ref=plugin" target="_blank">', '</a>', '<a href="https://aamportal.com/article/streamlining-wordpress-backend-menu-access?ref=plugin" target="_blank">', '</a>'); ?>
14 </p>
15 </div>
16 </div>
17 <?php } ?>
18
19 <div class="row">
20 <div class="col-xs-12">
21 <div
22 class="aam-overwrite"
23 id="aam-menu-overwrite"
24 style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>"
25 >
26 <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span>
27 <span><a href="#" id="menu-reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span>
28 </div>
29 </div>
30 </div>
31
32 <?php echo apply_filters('aam_ui_backend_menu_mode_panel_filter', '', AAM_Backend_AccessLevel::get_instance()->backend_menu()); ?>
33
34 <div class="panel-group" id="admin-menu" role="tablist" aria-multiselectable="true">
35 <?php
36 $first = false;
37 $menu = AAM::api()->backend_menu(
38 AAM_Backend_AccessLevel::get_instance()->get_access_level()
39 )->get_items();
40
41 if (!empty($menu)) {
42 foreach ($menu as $i => $top_menu_item) {
43 ?>
44 <div
45 class="panel panel-default"
46 style="opacity: <?php echo AAM_Backend_AccessLevel::get_instance()->has_cap($top_menu_item['capability']) ? 1 : '0.5'; ?>"
47 >
48 <div class="panel-heading" role="tab" id="menu-<?php echo $i; ?>-heading">
49 <h4 class="panel-title">
50 <a
51 role="button"
52 data-toggle="collapse"
53 data-parent="#admin-menu"
54 href="#menu-<?php echo $i; ?>"
55 aria-controls="menu-<?php echo $i; ?>"
56 <?php if (!$first) { echo 'aria-expanded="true"'; } ?>
57 >
58 <?php echo esc_js($top_menu_item['name']); ?> <small class="aam-menu-capability"><?php echo esc_js($top_menu_item['capability']); ?></small>
59 </a>
60 <?php if (!empty($top_menu_item['is_restricted'])) { ?>
61 <i class="aam-panel-title-icon icon-lock text-danger"></i>
62 <?php } elseif (isset($top_menu_item['children']) && array_reduce($top_menu_item['children'], function($s, $q){ return $s + $q['is_restricted']; })) { ?>
63 <i class="aam-panel-title-icon icon-attention-circled text-warning"></i>
64 <?php } ?>
65 </h4>
66 </div>
67
68 <div
69 id="menu-<?php echo $i; ?>"
70 class="panel-collapse collapse<?php if (!$first) { echo ' in'; $first = true; } ?>"
71 role="tabpanel"
72 aria-labelledby="menu-<?php echo $i; ?>-heading"
73 >
74 <div class="panel-body">
75 <?php if ($top_menu_item['slug'] != 'index.php') { ?>
76 <div class="row aam-inner-tab">
77 <div class="col-xs-12 text-center">
78 <small class="aam-menu-capability"><?php echo __('Menu URL:', 'advanced-access-manager'); ?> <b><?php echo urldecode($top_menu_item['path']); ?></b></small>
79 </div>
80 </div>
81 <hr class="aam-divider" />
82 <?php } ?>
83
84 <?php if (!empty($top_menu_item['children'])) { ?>
85 <div class="row aam-inner-tab aam-menu-expended-list">
86 <?php foreach ($top_menu_item['children'] as $j => $child) { ?>
87 <?php if ($child['slug'] == 'index.php') { ?>
88 <div class="col-xs-12 col-md-6 aam-submenu-item">
89 <div class="aam-menu-details">
90 <?php echo esc_js($child['name']); ?>
91 </div>
92 <a href="#dashboard-lockout-modal" data-toggle="modal"><i class="icon-help-circled"></i></a>
93 </div>
94 <?php } else { ?>
95 <div class="col-xs-12 col-md-6 aam-submenu-item">
96 <div class="aam-menu-details">
97 <?php echo esc_js($child['name']); ?>
98 <small>
99 <a
100 href="#menu-details-modal"
101 data-toggle="modal"
102 data-path="<?php echo esc_attr($child['path']); ?>"
103 data-cap="<?php echo esc_attr($child['capability']); ?>"
104 data-name="<?php echo esc_attr($child['name']); ?>"
105 data-slug="<?php echo esc_attr($child['slug']); ?>"
106 data-id="<?php echo esc_attr(base64_encode($child['slug'])); ?>"
107 class="aam-menu-item"
108 ><?php echo __('more details', 'advanced-access-manager'); ?></a>
109 </small>
110 </div>
111 <?php if ($child['is_restricted']) { ?>
112 <i
113 class="aam-accordion-action icon-lock text-danger"
114 id="menu-item-<?php echo $i . $j; ?>"
115 data-menu-id="<?php echo esc_attr(base64_encode($child['slug'])); ?>"
116 ></i>
117 <?php } else { ?>
118 <i
119 class="aam-accordion-action icon-lock-open text-success"
120 id="menu-item-<?php echo $i . $j; ?>"
121 data-menu-id="<?php echo esc_attr(base64_encode($child['slug'])); ?>"
122 ></i>
123 <?php } ?>
124 <label
125 data-toggle="tooltip"
126 title="<?php echo ($child['is_restricted'] ? __('Uncheck to allow', 'advanced-access-manager') : __('Check to restrict', 'advanced-access-manager')); ?>"
127 ></label>
128 </div>
129 <?php } ?>
130 <?php } ?>
131 </div>
132
133 <hr class="aam-divider" />
134 <?php } ?>
135
136 <?php if ($top_menu_item['slug'] != 'index.php') { ?>
137 <div class="row<?php echo (!empty($top_menu_item['children']) ? ' aam-margin-top-xs' : ''); ?>">
138 <div class="col-xs-10 col-md-6 col-xs-offset-1 col-md-offset-3">
139 <?php if ($top_menu_item['is_restricted']) { ?>
140 <a
141 href="#"
142 class="btn btn-primary btn-sm btn-block aam-restrict-menu"
143 data-menu-id="<?php echo esc_attr(base64_encode($top_menu_item['slug'])); ?>"
144 data-target="#menu-<?php echo $i; ?>"
145 >
146 <i class="icon-lock-open"></i> <?php echo __('Show Menu', 'advanced-access-manager'); ?>
147 </a>
148 <?php } else { ?>
149 <a
150 href="#"
151 class="btn btn-danger btn-sm btn-block aam-restrict-menu"
152 data-menu-id="<?php echo esc_attr(base64_encode($top_menu_item['slug'])); ?>"
153 data-target="#menu-<?php echo $i; ?>"
154 >
155 <i class="icon-lock"></i> <?php echo __('Restrict Menu', 'advanced-access-manager'); ?>
156 </a>
157 <?php } ?>
158 </div>
159 </div>
160 <?php } else { ?>
161 <p class="aam-info">
162 <?php echo __('The "Dashboard" menu cannot be restricted because it is the default page all users are redirected to after login.', 'advanced-access-manager'); ?>
163 </p>
164 <?php } ?>
165 </div>
166 </div>
167 </div>
168 <?php }
169 } else { ?>
170 <div class="row">
171 <div class="col-xs-12">
172 <p class="aam-notification">
173 <?php echo __('Please try refreshing the page. If the issue persists, the current user might not have the required privileges to access backend menu items. Another common issue could be insufficient database storage on your server, preventing AAM from storing a proper snapshot of your backend menu. If you\'re unable to resolve the problem, feel free to contact us, and we\'ll do our best to assist you.', 'advanced-access-manager'); ?>
174 </p>
175 </div>
176 </div>
177 <?php } ?>
178 </div>
179
180 <div class="modal fade" id="dashboard-lockout-modal" tabindex="-1" role="dialog">
181 <div class="modal-dialog" role="document">
182 <div class="modal-content">
183 <div class="modal-header">
184 <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">&times;</span></button>
185 <h4 class="modal-title"><?php echo __('Dashboard Lockdown', 'advanced-access-manager'); ?></h4>
186 </div>
187 <div class="modal-body">
188 <p class="text-center alert alert-warning text-larger">
189 <strong><?php echo __('You cannot restrict access to the Dashboard Home page.', 'advanced-access-manager'); ?></strong><br />
190 <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('The [Dashboard Home] is the default page every user redirects to after login. To restrict access to the entire backend, check the %sHow to lock down WordPress backend%s Q&A.', 'b'), '<a href="https://aamportal.com/question/how-to-lockdown-the-entire-wordpress-backend-area?ref=plugin" target="_blank">', '</a>'); ?>
191 </p>
192 </div>
193 <div class="modal-footer">
194 <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('OK', 'advanced-access-manager'); ?></button>
195 </div>
196 </div>
197 </div>
198 </div>
199
200 <div class="modal fade" id="menu-details-modal" tabindex="-1" role="dialog">
201 <div class="modal-dialog" role="document">
202 <div class="modal-content">
203 <div class="modal-header">
204 <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">&times;</span></button>
205 <h4 class="modal-title"><?php echo __('Menu Details', 'advanced-access-manager'); ?></h4>
206 </div>
207 <div class="modal-body">
208 <table class="table table-striped table-bordered">
209 <tbody>
210 <tr>
211 <th width="20%"><?php echo __('Name', 'advanced-access-manager'); ?></th>
212 <td id="menu-item-name"></td>
213 </tr>
214 <tr>
215 <th width="20%"><?php echo __('Slug', 'advanced-access-manager'); ?></th>
216 <td id="menu-item-slug"></td>
217 </tr>
218 <tr>
219 <th width="20%"><?php echo __('Capability', 'advanced-access-manager'); ?></th>
220 <td id="menu-item-cap"></td>
221 </tr>
222 <tr>
223 <th width="20%"><?php echo __('Path', 'advanced-access-manager'); ?></th>
224 <td id="menu-item-path"></td>
225 </tr>
226 </tbody>
227 </table>
228 </div>
229 <div class="modal-footer">
230 <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', 'advanced-access-manager'); ?></button>
231 </div>
232 </div>
233 </div>
234 </div>
235 </div>
236 <?php }