access.php
6 years ago
advanced_settings.php
5 years ago
exclusion_settings.php
6 years ago
geolocation_settings.php
6 years ago
get_started.php
6 years ago
info.php
5 years ago
info_bug_report.php
6 years ago
info_help.php
5 years ago
info_high_traffic.php
6 years ago
info_multisite.php
6 years ago
info_newsletter.php
6 years ago
info_shared.php
6 years ago
marketplace.php
5 years ago
privacy_gdpr.php
5 years ago
settings.php
6 years ago
summary.php
5 years ago
systemreport.php
6 years ago
tracking.php
5 years ago
update_notice_clear_cache.php
6 years ago
access.php
102 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Matomo - free/libre analytics platform |
| 4 | * |
| 5 | * @link https://matomo.org |
| 6 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 7 | * @package matomo |
| 8 | */ |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | use WpMatomo\Access; |
| 14 | use WpMatomo\Admin\AccessSettings; |
| 15 | |
| 16 | /** @var Access $access */ |
| 17 | /** @var \WpMatomo\Roles $roles */ |
| 18 | /** @var \WpMatomo\Capabilities $capabilites */ |
| 19 | ?> |
| 20 | |
| 21 | <p><?php esc_html_e( 'Manage which roles can view and manage your reporting data.', 'matomo' ); ?></p> |
| 22 | |
| 23 | <form method="post"> |
| 24 | <?php wp_nonce_field( AccessSettings::NONCE_NAME ); ?> |
| 25 | |
| 26 | <table class="matomo-form widefat"> |
| 27 | <thead> |
| 28 | <tr> |
| 29 | <th width="30%"><?php esc_html_e( 'WordPress Role', 'matomo' ); ?></th> |
| 30 | <th><?php esc_html_e( 'Matomo Role', 'matomo' ); ?></th> |
| 31 | </tr> |
| 32 | </thead> |
| 33 | <tbody> |
| 34 | <?php |
| 35 | foreach ( $roles->get_available_roles_for_configuration() as $matomo_role_id => $matomo_role_name ) { |
| 36 | echo '<tr><td>'; |
| 37 | echo esc_html( $matomo_role_name ) . '</td>'; |
| 38 | echo "<td><select name='" . AccessSettings::FORM_NAME . '[' . esc_attr( $matomo_role_id ) . "]'>"; |
| 39 | $matomo_value = $access->get_permission_for_role( $matomo_role_id ); |
| 40 | foreach ( Access::$matomo_permissions as $matomo_permission => $matomo_display_name ) { |
| 41 | echo "<option value='" . esc_attr( $matomo_permission ) . "' " . ( $matomo_value === $matomo_permission ? 'selected' : '' ) . '>' . esc_html( $matomo_display_name ) . '</option>'; |
| 42 | } |
| 43 | echo '</td></tr>'; |
| 44 | } |
| 45 | ?> |
| 46 | <tr> |
| 47 | <td colspan="2"><input name="Submit" type="submit" class="button-primary" |
| 48 | value="<?php echo esc_attr__( 'Save Changes', 'matomo' ); ?>"/></td> |
| 49 | </tr> |
| 50 | </tbody> |
| 51 | </table> |
| 52 | </form> |
| 53 | |
| 54 | <p> |
| 55 | <?php |
| 56 | if (!is_multisite()) { |
| 57 | esc_html_e( 'A user with role administrator automatically has the super user role.', 'matomo' ); |
| 58 | } |
| 59 | ?> |
| 60 | <?php esc_html_e( 'Learn about the differences between these Matomo roles:', 'matomo' ); ?> |
| 61 | <a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noopener"><?php esc_html_e( 'View', 'matomo' ); ?></a>, |
| 62 | <a href="https://matomo.org/faq/general/faq_26910/" target="_blank" |
| 63 | rel="noopener"><?php esc_html_e( 'Write', 'matomo' ); ?></a>, |
| 64 | <a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noopener"><?php esc_html_e( 'Admin', 'matomo' ); ?></a>, |
| 65 | <a href="https://matomo.org/faq/general/faq_35/" target="_blank" |
| 66 | rel="noopener"><?php esc_html_e( 'Super User', 'matomo' ); ?></a><br/> |
| 67 | <?php esc_html_e( 'Want to redirect to the home page when not logged in?', 'matomo' ); ?> <a href="https://matomo.org/faq/wordpress/how-do-i-hide-my-wordpress-login-url-when-someone-accesses-a-matomo-report-directly/" target="_blank" rel="noreferrer noopener"><?php esc_html_e( 'Learn more', 'matomo' ); ?></a> |
| 68 | </p> |
| 69 | |
| 70 | <h2><?php esc_html_e( 'Roles', 'matomo' ); ?></h2> |
| 71 | <p> |
| 72 | <?php |
| 73 | esc_html_e( |
| 74 | 'Want to give individual users access to Matomo? Simply create a user in your WordPress and assign of these roles |
| 75 | to the user:', |
| 76 | 'matomo' |
| 77 | ) |
| 78 | ?> |
| 79 | </p> |
| 80 | <ul class="matomo-list"> |
| 81 | <?php foreach ( $roles->get_matomo_roles() as $matomo_role_config ) { ?> |
| 82 | <li><?php echo esc_html( $matomo_role_config['name'] ); ?></li> |
| 83 | <?php } ?> |
| 84 | </ul> |
| 85 | |
| 86 | <h2><?php esc_html_e( 'Capabilities', 'matomo' ); ?></h2> |
| 87 | <p> |
| 88 | <?php |
| 89 | esc_html_e( |
| 90 | 'You can also install a WordPress plugin which lets you manage capabilities for each individual users. These are |
| 91 | the supported capabilities:', |
| 92 | 'matomo' |
| 93 | ) |
| 94 | ?> |
| 95 | </p> |
| 96 | <ul class="matomo-list"> |
| 97 | <?php |
| 98 | foreach ( $capabilites->get_all_capabilities_sorted_by_highest_permission() as $matomo_cap_name ) { |
| 99 | ?> |
| 100 | <li><?php echo esc_html( $matomo_cap_name ); ?></li> |
| 101 | <?php } ?> |
| 102 | </ul> |