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
url.php
198 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->urls(); |
| 7 | ?> |
| 8 | |
| 9 | <div class="aam-feature" id="url-content"> |
| 10 | <div class="row"> |
| 11 | <div class="col-xs-12"> |
| 12 | <?php if (AAM::api()->config->get('core.settings.ui.tips')) { ?> |
| 13 | <p class="aam-info"> |
| 14 | <?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Manage access to an unlimited number of individual URLs. With the premium %sComplete Package%s, you can use the wildcard [*] denotation to manage access to a specific website section (e.g. [/members/*], [/premium*]) or make the entire website private. To learn more, refer to our official documentation page %shere%s.', 'strong', 'i', 'i'), '<a href="https://aamportal.com/premium?ref=plugin" target="_blank">', '</a>', '<a href="https://aamportal.com/article/managing-access-to-wordpress-website-urls?ref=plugin" target="_blank">', '</a>'); ?> |
| 15 | </p> |
| 16 | <?php } ?> |
| 17 | |
| 18 | <div |
| 19 | class="aam-overwrite" |
| 20 | id="aam-uri-overwrite" |
| 21 | style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>" |
| 22 | > |
| 23 | <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span> |
| 24 | <span><a href="#" id="uri-reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span> |
| 25 | </div> |
| 26 | |
| 27 | <table id="uri-list" class="table table-striped table-bordered"> |
| 28 | <thead> |
| 29 | <tr> |
| 30 | <th width="60%"><?php echo __('URL', 'advanced-access-manager'); ?></th> |
| 31 | <th width="20%"><?php echo __('Type', 'advanced-access-manager'); ?></th> |
| 32 | <th><?php echo __('Actions', 'advanced-access-manager'); ?></th> |
| 33 | <th>Rule</th> |
| 34 | </tr> |
| 35 | </thead> |
| 36 | <tbody></tbody> |
| 37 | </table> |
| 38 | </div> |
| 39 | </div> |
| 40 | |
| 41 | <div class="modal fade" id="uri-model" tabindex="-1" role="dialog"> |
| 42 | <div class="modal-dialog" role="document"> |
| 43 | <div class="modal-content"> |
| 44 | <div class="modal-header"> |
| 45 | <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">×</span></button> |
| 46 | <h4 class="modal-title"><?php echo __('URL Access Rule', 'advanced-access-manager'); ?></h4> |
| 47 | </div> |
| 48 | <div class="modal-body"> |
| 49 | <div class="form-group"> |
| 50 | <label><?php echo AAM_Backend_View_Helper::preparePhrase('Enter URL [(wildcard * is available with premium add-on)]', 'small'); ?></label> |
| 51 | <input |
| 52 | type="text" |
| 53 | class="form-control form-clearable" |
| 54 | id="url_rule_url" |
| 55 | placeholder="<?php echo __('Enter valid URL', 'advanced-access-manager'); ?>" |
| 56 | /> |
| 57 | </div> |
| 58 | |
| 59 | <label><?php echo __('What should be done when a URL is matched?', 'advanced-access-manager'); ?></label><br /> |
| 60 | |
| 61 | <?php |
| 62 | $restriction_types = apply_filters('aam_ui_url_restriction_types_filter', [ |
| 63 | 'allow' => [ |
| 64 | 'title' => __('Allow direct access', 'advanced-access-manager') |
| 65 | ], |
| 66 | 'deny' => [ |
| 67 | 'title' => __('Restrict direct access (Access Denied Redirect preference is applied)', 'advanced-access-manager') |
| 68 | ], |
| 69 | 'custom_message' => [ |
| 70 | 'title' => __('Show customized message (plain text or HTML)', 'advanced-access-manager') |
| 71 | ], |
| 72 | 'page_redirect' => [ |
| 73 | 'title' => __('Redirected to existing page (select from the drop-down)', 'advanced-access-manager') |
| 74 | ], |
| 75 | 'url_redirect' => [ |
| 76 | 'title' => __('Redirected to a different URL (valid URL, starting with http or https is required)', 'advanced-access-manager') |
| 77 | ], |
| 78 | 'trigger_callback' => [ |
| 79 | 'title' => __('Trigger PHP callback function (valid HP callback is required)', 'advanced-access-manager') |
| 80 | ], |
| 81 | ]); |
| 82 | |
| 83 | if ($access_level->is_visitor()) { |
| 84 | $restriction_types['login_redirect'] = [ |
| 85 | 'title' => __('Redirect to the login page (after login, user will be redirected back to the restricted page)', 'advanced-access-manager') |
| 86 | ]; |
| 87 | } |
| 88 | ?> |
| 89 | |
| 90 | <?php foreach($restriction_types as $type => $props) { ?> |
| 91 | <div class="radio"> |
| 92 | <input |
| 93 | type="radio" |
| 94 | name="uri.access.type" |
| 95 | id="url_access_<?php echo esc_attr($type); ?>" |
| 96 | value="<?php echo esc_attr($type); ?>" |
| 97 | /> |
| 98 | <label for="url_access_<?php echo esc_attr($type); ?>"> |
| 99 | <?php echo esc_js($props['title']); ?> |
| 100 | </label> |
| 101 | </div> |
| 102 | <?php } ?> |
| 103 | |
| 104 | <div class="form-group aam-uri-access-action" id="url_access_custom_message_attrs" style="display: none;"> |
| 105 | <label><?php echo __('Customized Message', 'advanced-access-manager'); ?></label> |
| 106 | <textarea |
| 107 | class="form-control form-clearable" |
| 108 | rows="3" |
| 109 | id="url_access_custom_message_value" |
| 110 | placeholder="<?php echo __('Enter message...', 'advanced-access-manager'); ?>"> |
| 111 | </textarea> |
| 112 | </div> |
| 113 | |
| 114 | <div class="form-group aam-uri-access-action" id="url_access_page_redirect_attrs" style="display: none;"> |
| 115 | <label><?php echo __('Existing Page', 'advanced-access-manager'); ?></label> |
| 116 | <?php |
| 117 | wp_dropdown_pages(array( |
| 118 | 'depth' => 99, |
| 119 | 'echo' => 1, |
| 120 | 'id' => 'url_access_page_redirect_value', |
| 121 | 'class' => 'form-control form-clearable', |
| 122 | 'show_option_none' => __('-- Select Page --', 'advanced-access-manager') |
| 123 | )); |
| 124 | ?> |
| 125 | </div> |
| 126 | |
| 127 | <div class="form-group aam-uri-access-action" id="url_access_url_redirect_attrs" style="display: none;"> |
| 128 | <label><?php echo __('The Valid Redirect URL', 'advanced-access-manager'); ?></label> |
| 129 | <input |
| 130 | type="text" |
| 131 | class="form-control form-clearable" |
| 132 | placeholder="https://" |
| 133 | id="url_access_url_redirect_value" |
| 134 | /> |
| 135 | </div> |
| 136 | |
| 137 | <div class="form-group aam-uri-access-action" id="url_access_http_status_code" style="display: none;"> |
| 138 | <label><?php echo __('HTTP Redirect Code', 'advanced-access-manager'); ?></label> |
| 139 | <select class="form-control form-clearable" id="url_access_http_redirect_code"> |
| 140 | <option value=""><?php echo __('HTTP Code (Default 307)', 'advanced-access-manager'); ?></option> |
| 141 | <option value="301"><?php echo __('301 - Moved Permanently', 'advanced-access-manager'); ?></option> |
| 142 | <option value="302"><?php echo __('302 - Found', 'advanced-access-manager'); ?></option> |
| 143 | <option value="303"><?php echo __('303 - See Other', 'advanced-access-manager'); ?></option> |
| 144 | <option value="307"><?php echo __('307 - Temporary Redirect', 'advanced-access-manager'); ?></option> |
| 145 | </select> |
| 146 | </div> |
| 147 | |
| 148 | <div class="form-group aam-uri-access-action" id="url_access_trigger_callback_attrs" style="display: none;"> |
| 149 | <label><?php echo __('PHP Callback Function', 'advanced-access-manager'); ?></label> |
| 150 | <input |
| 151 | type="text" |
| 152 | class="form-control form-clearable" |
| 153 | placeholder="Enter valid callback" |
| 154 | id="url_access_trigger_callback_value" |
| 155 | /> |
| 156 | </div> |
| 157 | |
| 158 | <?php do_action('aam_ui_url_access_restriction_modal_action'); ?> |
| 159 | </div> |
| 160 | <div class="modal-footer"> |
| 161 | <button |
| 162 | type="button" |
| 163 | class="btn btn-success" |
| 164 | id="url_save_btn" |
| 165 | ><?php echo __('Save', 'advanced-access-manager'); ?></button> |
| 166 | <button |
| 167 | type="button" |
| 168 | class="btn btn-default" |
| 169 | data-dismiss="modal" |
| 170 | ><?php echo __('Close', 'advanced-access-manager'); ?></button> |
| 171 | </div> |
| 172 | </div> |
| 173 | </div> |
| 174 | </div> |
| 175 | |
| 176 | <div class="modal fade" id="uri-delete-model" tabindex="-1" role="dialog"> |
| 177 | <div class="modal-dialog modal-sm" role="document"> |
| 178 | <div class="modal-content"> |
| 179 | <div class="modal-header"> |
| 180 | <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Close', 'advanced-access-manager'); ?>"><span aria-hidden="true">×</span></button> |
| 181 | <h4 class="modal-title"><?php echo __('Delete URL Rule', 'advanced-access-manager'); ?></h4> |
| 182 | </div> |
| 183 | <div class="modal-body"> |
| 184 | <div class="form-group"> |
| 185 | <p class="aam-notification"> |
| 186 | <?php echo __('You are about to delete the URL Rule. Please confirm!', 'advanced-access-manager'); ?> |
| 187 | </p> |
| 188 | </div> |
| 189 | </div> |
| 190 | <div class="modal-footer"> |
| 191 | <button type="button" class="btn btn-danger" id="uri-delete-btn"><?php echo __('Delete', 'advanced-access-manager'); ?></button> |
| 192 | <button type="button" class="btn btn-default" data-dismiss="modal"><?php echo __('Close', 'advanced-access-manager'); ?></button> |
| 193 | </div> |
| 194 | </div> |
| 195 | </div> |
| 196 | </div> |
| 197 | </div> |
| 198 | <?php } |