85 lines
3.4 KiB
PHP
85 lines
3.4 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Provide a admin area view for the plugin
|
|
*
|
|
* This file is used to markup the admin-facing aspects of the plugin.
|
|
*
|
|
* @link http://secureprivacy.ai/
|
|
* @since 1.0.0
|
|
*
|
|
* @package Secureprivacy
|
|
* @subpackage Secureprivacy/admin/partials
|
|
*/
|
|
?>
|
|
|
|
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
|
|
<div class="wrap _s">
|
|
<div class="container" id="welcome-secure-privacy">
|
|
<div class="text-center"> <img style="width:160px; margin:30px;" class="img logo-sp" src="<?php echo plugin_dir_url( __FILE__ ) . '../images/logo-black.png'; ?>"> </div>
|
|
<h1 class="text-center" style="padding: 35px 0px;">Welcome to Secure Privacy</h1>
|
|
<h3 class="text-center" style="padding: 45px 0px;line-height: 34px;">
|
|
Make your WordPress site compliant with GDPR, CCPA and ePrivacy. <br/>Add cookie banners and privacy policies to your website.
|
|
</h3>
|
|
|
|
<h5 class="text-center" >
|
|
By clicking on the buttons below you accept our <a href='https://secureprivacy.ai/terms-of-use/' target='_blank'>terms of service.</a>
|
|
</h5>
|
|
|
|
<div class="text-center" style="padding: 15px 0px;">
|
|
<!-- <a href="<?php echo admin_url('admin.php?page=onboarding'); ?>" class="btn btn-success btn-lg">Create new account</a> -->
|
|
<button id="account_present" class="btn btn-success">Connect Secure Privacy</button>
|
|
|
|
<!-- <a href="<?php echo admin_url('admin.php?page=login'); ?>" class="btn btn-success btn-lg">Connect Secure Privacy</a> -->
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<form id="saveValueForm" action="options.php" method="post">
|
|
<?php
|
|
settings_fields( $this->plugin_name );
|
|
do_settings_sections( $this->plugin_name );
|
|
// submit_button();
|
|
?>
|
|
</form>
|
|
|
|
|
|
<script>
|
|
(function ($) {
|
|
'use strict';
|
|
|
|
$("#account_present").on("click", function () {
|
|
$("#account_present").prop("disabled", true);
|
|
$("#account_present").text("Processing ...",);
|
|
$.ajax({
|
|
url: window.sp_baseContext + '/api/adminsettings/openid/client',
|
|
type: "GET",
|
|
contentType: 'application/json; charset=utf-8',
|
|
dataType: "json",
|
|
success: function (response) {
|
|
$('#outdated_notice_client_id').val(response.ClientId);
|
|
$('#outdated_notice_client_secret').val(response.ClientSecret);
|
|
var b = $('#saveValueForm').serialize();
|
|
$.post('options.php', b).error(function () {
|
|
console.log('Error fetching Admin user data. Try again.');
|
|
}).success(function () {
|
|
var returnURL = '<?php echo admin_url('admin.php?page=loginSuccess'); ?>';
|
|
var loginURL = '<?php echo admin_url('admin.php?page=login'); ?>';
|
|
|
|
|
|
var childURL = window.sp_baseContext + '/checkAuth/index.html?redirectURI=' + encodeURIComponent(returnURL) + '&login=' + encodeURIComponent(loginURL);
|
|
window.location.href = childURL;
|
|
});
|
|
},
|
|
error: function (e, x, v) {
|
|
$("#account_present").prop("disabled", false);
|
|
$("#account_present").text("I already have an account",);
|
|
console.log('Error fetching Admin user data. Try again.');
|
|
}
|
|
});
|
|
});
|
|
})(jQuery);
|
|
|
|
</script>
|