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
login-redirect.php
120 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->login_redirect(); |
| 7 | $settings = $service->get_redirect(); |
| 8 | ?> |
| 9 | <div class="aam-feature" id="login_redirect-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 __('Seamlessly redirects users to their designated landing page post-login, ensuring personalized and efficient access to the website.', 'advanced-access-manager'); ?> |
| 15 | </p> |
| 16 | <?php } ?> |
| 17 | |
| 18 | <div class="aam-overwrite" id="aam-login-redirect-overwrite" style="display: <?php echo ($service->is_customized() ? 'block' : 'none'); ?>"> |
| 19 | <span><i class="icon-check"></i> <?php echo __('Settings are customized', 'advanced-access-manager'); ?></span> |
| 20 | <span><a href="#" id="login-redirect-reset" class="btn btn-xs btn-primary"><?php echo __('Reset to default', 'advanced-access-manager'); ?></a></span> |
| 21 | </div> |
| 22 | |
| 23 | <?php $type = $settings['type']; ?> |
| 24 | |
| 25 | <div class="radio"> |
| 26 | <input |
| 27 | type="radio" |
| 28 | name="login.redirect.type" |
| 29 | id="login-redirect-default" |
| 30 | data-action="#default-redirect-action" |
| 31 | value="default" |
| 32 | <?php echo ($type === 'default' ? ' checked' : ''); ?> |
| 33 | /> |
| 34 | <label for="login-redirect-default"><?php echo __('WordPress default behavior', 'advanced-access-manager'); ?></label> |
| 35 | </div> |
| 36 | <div class="radio"> |
| 37 | <input |
| 38 | type="radio" |
| 39 | name="login.redirect.type" |
| 40 | id="login-redirect-page" |
| 41 | data-action="#page-login-redirect-action" |
| 42 | value="page_redirect" |
| 43 | <?php echo ($type === 'page_redirect' ? ' checked' : ''); ?> |
| 44 | /> |
| 45 | <label for="login-redirect-page"><?php echo AAM_Backend_View_Helper::preparePhrase('Redirected to an existing page [(select from the drop-down)]', 'small'); ?></label> |
| 46 | </div> |
| 47 | <div class="radio"> |
| 48 | <input |
| 49 | type="radio" |
| 50 | name="login.redirect.type" |
| 51 | id="login-redirect-url" |
| 52 | data-action="#url-login-redirect-action" |
| 53 | value="url_redirect" |
| 54 | <?php echo ($type === 'url_redirect' ? ' checked' : ''); ?> |
| 55 | /> |
| 56 | <label for="login-redirect-url"><?php echo AAM_Backend_View_Helper::preparePhrase('Redirected to a URL [(enter a valid URL starting from http or https)]', 'small'); ?></label> |
| 57 | </div> |
| 58 | <div class="radio"> |
| 59 | <input |
| 60 | type="radio" |
| 61 | name="login.redirect.type" |
| 62 | id="login-redirect-callback" |
| 63 | data-action="#callback-login-redirect-action" |
| 64 | value="trigger_callback" |
| 65 | <?php echo ($type === 'trigger_callback' ? ' checked' : ''); ?> |
| 66 | /> |
| 67 | <label for="login-redirect-callback"><?php echo sprintf(AAM_Backend_View_Helper::preparePhrase('Trigger a 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> |
| 68 | </div> |
| 69 | |
| 70 | <div |
| 71 | class="form-group login-redirect-action" |
| 72 | id="page-login-redirect-action" |
| 73 | style="display: <?php echo ($type === 'page_redirect' ? 'block' : 'none'); ?>;" |
| 74 | > |
| 75 | <label><?php echo __('Existing Page', 'advanced-access-manager'); ?></label> |
| 76 | <?php |
| 77 | wp_dropdown_pages(array( |
| 78 | 'depth' => 99, |
| 79 | 'selected' => isset($settings['redirect_page_id']) ? $settings['redirect_page_id'] : 0, |
| 80 | 'echo' => 1, |
| 81 | 'id' => 'login-redirect-page', |
| 82 | 'class' => 'form-control', |
| 83 | 'show_option_none' => __('-- Select Page --', 'advanced-access-manager') |
| 84 | )); |
| 85 | ?> |
| 86 | </div> |
| 87 | |
| 88 | <div |
| 89 | class="form-group login-redirect-action" |
| 90 | id="url-login-redirect-action" |
| 91 | style="display: <?php echo ($type === 'url_redirect' ? 'block' : 'none'); ?>;" |
| 92 | > |
| 93 | <label><?php echo __('The URL', 'advanced-access-manager'); ?></label> |
| 94 | <input |
| 95 | type="text" |
| 96 | class="form-control" |
| 97 | name="login.redirect.url" |
| 98 | placeholder="https://" |
| 99 | value="<?php echo stripslashes(esc_js(isset($settings['redirect_url']) ? $settings['redirect_url'] : '')); ?>" |
| 100 | /> |
| 101 | </div> |
| 102 | |
| 103 | <div |
| 104 | class="form-group login-redirect-action" |
| 105 | id="callback-login-redirect-action" |
| 106 | style="display: <?php echo ($type === 'trigger_callback' ? 'block' : 'none'); ?>;" |
| 107 | > |
| 108 | <label><?php echo __('PHP Callback Function', 'advanced-access-manager'); ?></label> |
| 109 | <input |
| 110 | type="text" |
| 111 | class="form-control" |
| 112 | placeholder="Enter valid callback" |
| 113 | name="login.redirect.callback" |
| 114 | value="<?php echo stripslashes(esc_js(isset($settings['callback']) ? $settings['callback'] : '')); ?>" |
| 115 | /> |
| 116 | </div> |
| 117 | </div> |
| 118 | </div> |
| 119 | </div> |
| 120 | <?php } |