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
logout-redirect.php
114 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->logout_redirect(); |
| 7 | $settings = $service->get_redirect(); |
| 8 | ?> |
| 9 | <div class="aam-feature" id="logout_redirect-content"> |
| 10 | <div class="row"> |
| 11 | <div class="col-xs-12"> |
| 12 | |
| 13 | </div> |
| 14 | </div> |
| 15 | |
| 16 | <div class="row"> |
| 17 | <div class="col-xs-12"> |
| 18 | <?php if (AAM::api()->config->get('core.settings.ui.tips')) { ?> |
| 19 | <p class="aam-info"> |
| 20 | <?php echo __('Efficiently handle user logouts, ensuring they are securely redirected to the appropriate post-logout destination for a smooth and safe exit.', 'advanced-access-manager'); ?> |
| 21 | </p> |
| 22 | <?php } ?> |
| 23 | |
| 24 | <div class="aam-overwrite" id="aam-logout-redirect-overwrite" style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>"> |
| 25 | <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span> |
| 26 | <span><a href="#" id="logout-redirect-reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span> |
| 27 | </div> |
| 28 | |
| 29 | <?php $type = $settings['type']; ?> |
| 30 | |
| 31 | <div class="radio"> |
| 32 | <input |
| 33 | type="radio" |
| 34 | name="logout.redirect.type" |
| 35 | id="logout-redirect-default" |
| 36 | data-action="#default-redirect-action" |
| 37 | value="default" |
| 38 | <?php echo ($type === 'default' ? ' checked' : ''); ?> |
| 39 | /> |
| 40 | <label for="logout-redirect-default"><?php echo __('WordPress default behavior', 'advanced-access-manager'); ?></label> |
| 41 | </div> |
| 42 | <div class="radio"> |
| 43 | <input |
| 44 | type="radio" |
| 45 | name="logout.redirect.type" |
| 46 | id="logout-redirect-page" |
| 47 | data-action="#page-logout-redirect-action" |
| 48 | value="page_redirect" |
| 49 | <?php echo ($type === 'page_redirect' ? ' checked' : ''); ?> |
| 50 | /> |
| 51 | <label for="logout-redirect-page"><?php echo AAM_Backend_View_Helper::preparePhrase('Redirected to existing page [(select from the drop-down)]', 'small'); ?></label> |
| 52 | </div> |
| 53 | <div class="radio"> |
| 54 | <input |
| 55 | type="radio" |
| 56 | name="logout.redirect.type" |
| 57 | id="logout-redirect-url" |
| 58 | data-action="#url-logout-redirect-action" |
| 59 | value="url_redirect" |
| 60 | <?php echo ($type === 'url_redirect' ? ' checked' : ''); ?> |
| 61 | /> |
| 62 | <label for="logout-redirect-url"><?php echo AAM_Backend_View_Helper::preparePhrase('Redirected to the URL [(enter full URL starting from http or https)]', 'small'); ?></label> |
| 63 | </div> |
| 64 | <div class="radio"> |
| 65 | <input |
| 66 | type="radio" |
| 67 | name="logout.redirect.type" |
| 68 | id="logout-redirect-callback" |
| 69 | data-action="#callback-logout-redirect-action" |
| 70 | value="trigger_callback" |
| 71 | <?php echo ($type === 'trigger_callback' ? ' checked' : ''); ?> |
| 72 | /> |
| 73 | <label for="logout-redirect-callback"><?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Trigger PHP callback function [(valid %sPHP callback%s is required)]', 'small'), '<a href="https://php.net/manual/en/language.types.callable.php" target="_blank">', '</a>'); ?></label> |
| 74 | </div> |
| 75 | |
| 76 | <div class="form-group logout-redirect-action" id="page-logout-redirect-action" style="display: <?php echo ($type === 'page_redirect' ? 'block' : 'none'); ?>;"> |
| 77 | <label><?php echo __('Existing Page', 'advanced-access-manager'); ?></label> |
| 78 | <?php |
| 79 | wp_dropdown_pages(array( |
| 80 | 'depth' => 99, |
| 81 | 'selected' => isset($settings['redirect_page_id']) ? $settings['redirect_page_id'] : 0, |
| 82 | 'echo' => 1, |
| 83 | 'id' => 'logout-redirect-page', |
| 84 | 'class' => 'form-control', |
| 85 | 'show_option_none' => __('-- Select Page --', 'advanced-access-manager') |
| 86 | )); |
| 87 | ?> |
| 88 | </div> |
| 89 | |
| 90 | <div class="form-group logout-redirect-action" id="url-logout-redirect-action" style="display: <?php echo ($type === 'url_redirect' ? 'block' : 'none'); ?>;"> |
| 91 | <label><?php echo __('The URL', 'advanced-access-manager'); ?></label> |
| 92 | <input |
| 93 | type="text" |
| 94 | class="form-control" |
| 95 | name="logout.redirect.url" |
| 96 | placeholder="https://" |
| 97 | value="<?php echo stripslashes(esc_js(isset($settings['redirect_url']) ? $settings['redirect_url'] : '')); ?>" |
| 98 | /> |
| 99 | </div> |
| 100 | |
| 101 | <div class="form-group logout-redirect-action" id="callback-logout-redirect-action" style="display: <?php echo ($type === 'trigger_callback' ? 'block' : 'none'); ?>;"> |
| 102 | <label><?php echo __('PHP Callback Function', 'advanced-access-manager'); ?></label> |
| 103 | <input |
| 104 | type="text" |
| 105 | class="form-control" |
| 106 | placeholder="Enter valid callback" |
| 107 | name="logout.redirect.callback" |
| 108 | value="<?php echo stripslashes(esc_js(isset($settings['callback']) ? $settings['callback'] : '')); ?>" |
| 109 | /> |
| 110 | </div> |
| 111 | </div> |
| 112 | </div> |
| 113 | </div> |
| 114 | <?php } |