From 2d18a1a7c59fba6cef45ab453fd1d56a4db27209 Mon Sep 17 00:00:00 2001 From: Ross Trottier Date: Thu, 31 Oct 2024 10:39:40 -0600 Subject: [PATCH] my account now points to dashboard --- federated.php | 6 +- rest-api/get_dns_records_test.php | 28 ------- woocommerce/my_account_customizations.php | 97 ++--------------------- 3 files changed, 10 insertions(+), 121 deletions(-) delete mode 100644 rest-api/get_dns_records_test.php diff --git a/federated.php b/federated.php index 3d19b0d..80153c1 100644 --- a/federated.php +++ b/federated.php @@ -3,7 +3,7 @@ /** * Plugin Name: Federated Computer E-Commerce * Description: This plugin contains customizations for Federated Computer. - * Version: 1.1.0 + * Version: 1.2.0 */ @@ -17,6 +17,4 @@ include( plugin_dir_path( __FILE__ ) . 'rest-api/provisioner_rest_api_extensions include( plugin_dir_path( __FILE__ ) . 'woocommerce/new_subscription_set_to_needs_provision.php'); include( plugin_dir_path( __FILE__ ) . 'woocommerce/processing_to_complete_order.php'); include( plugin_dir_path( __FILE__ ) . 'shared/federated_woocommerce_shared_functions.php'); -include( plugin_dir_path( __FILE__ ) . 'acf-extensions/search-acf.php'); - -//include( plugin_dir_path( __FILE__ ) . 'rest-api/get_dns_records_test.php'); \ No newline at end of file +include( plugin_dir_path( __FILE__ ) . 'acf-extensions/search-acf.php'); \ No newline at end of file diff --git a/rest-api/get_dns_records_test.php b/rest-api/get_dns_records_test.php deleted file mode 100644 index 929b08f..0000000 --- a/rest-api/get_dns_records_test.php +++ /dev/null @@ -1,28 +0,0 @@ - 'GET', - 'callback' => 'federated_get_dns', - 'permissions_callback' => 'check_federated_permissions' - ) - ); -} - -function federated_get_dns($request){ - $hostname = $request['hostname']; - - $dns = dns_get_record($hostname); - - return $dns; -} \ No newline at end of file diff --git a/woocommerce/my_account_customizations.php b/woocommerce/my_account_customizations.php index ae43156..2a6600e 100644 --- a/woocommerce/my_account_customizations.php +++ b/woocommerce/my_account_customizations.php @@ -11,18 +11,6 @@ if( ! defined( 'ABSPATH' ) ){ // 1. Register new endpoint (URL) for My Account page // Note: Re-save Permalinks or it will give 404 error -add_action('init', 'register_federated_my_account_styles'); -function register_federated_my_account_styles() { - wp_register_style( 'my-account', '/wp-content/plugins/fed-comp-customizations/css/federated-my-account.css' ); - wp_register_style( 'my-account-sidebar', '/wp-content/plugins/fed-comp-customizations/css/federated-my-account-sidebar.css' ); -} -add_action( 'wp_enqueue_scripts', 'conditionally_enqueue_federated_my_account_styles_scripts' ); -function conditionally_enqueue_federated_my_account_styles_scripts() { - if ( is_page('my-account') ) { - wp_enqueue_style( 'my-account' ); - wp_enqueue_style( 'my-account-sidebar' ); - } -} function federated_provision_info_endpoint() { add_rewrite_endpoint( 'provision-info', EP_ROOT | EP_PAGES ); @@ -81,15 +69,17 @@ function echo_subscription_info($subscription){ if(!empty($domain) && $provision_status === 'provisioned'){ echo '
'; echo '
'; - echo '

Apps for ' . $domain . '

'; - echo '

Click the links below to access your apps. Also, check out our helpful articles here for tips and tutorials on how to use these amazing open source tools.

'; + echo '

Apps for: ' . $domain . '

'; + echo '

Click here to access your apps. Also, check out our helpful articles here for tips and tutorials on how to use these amazing open source tools.

'; if($domain_status === 'default'){ echo '

This is a default domain, please do not change your admin password until you have switched to your custom domain.

'; } echo '

Admin Username: admin@' . $domain . ' \\ Initial Admin Password: ' . $initial_admin_password . '

'; echo '
'; echo '
'; - echo_links($tier, $domain); + echo '
'; + echo '
'; + echo '
'; } else if($provision_status === 'needs_provision' || $provision_status === 'provisioning') { echo '
'; echo '
'; @@ -97,82 +87,11 @@ function echo_subscription_info($subscription){ echo '

Your Federated Core is your very own, we provision each one made-to-order. Your apps, on your server, without having to share with anyone else. This only takes about 5 - 10 minutes, please check back shortly.

'; echo '
'; echo '
'; + echo '
'; + echo '
'; + echo '
'; } } - -function echo_links($tier, $domain){ - //echo container - echo '
'; - if($tier === 'starter' || $tier === 'creator' || $tier === 'team' || $tier === 'enterprise'){ - echo_base_app_links($domain); - } - if($tier === 'creator' || $tier === 'team' || $tier === 'enterprise'){ - echo_creator_app_links($domain); - } - if($tier === 'team' || $tier === 'enterprise'){ - echo_team_app_links($domain); - } - if($tier === 'enterprise'){ - echo_enterprise_app_links($domain); - } - echo '
'; -} - -function echo_base_app_links($domain){ - echo_link_for_core_app($domain, 'panel', 'User Management', 'teal', '', 'Use panel to create users for your core. The first default user is your admin user.'); - echo_link_for_core_app($domain, 'nextcloud', 'Email, File Storage, and Documents', 'purple', '', 'Use Nextcloud for Email, File Storage, Project Management, Documents, and more.'); - echo_link_for_core_app($domain, 'vaultwarden', 'Password Management', 'sky', '', 'Manage Passwords with Vaultwarden'); -} - -function echo_creator_app_links($domain){ - echo_link_for_core_app($domain, 'element', 'Team Chat', 'yellow', '', 'Chat with your team using Element and Matrix.'); - echo_link_for_core_app($domain, '', 'Website', 'rose', '', 'Create the website of your dreams with WordPress.'); -} - -function echo_team_app_links($domain){ - echo_link_for_core_app($domain, 'espocrm', 'CRM', 'indigo', '', 'Perfect your sales pipeline with EspoCRM.'); - echo_link_for_core_app($domain, 'freescout', 'Helpdesk', 'sky', '', 'Provide amazing customer support with FreeScout.'); -} - -function echo_enterprise_app_links($domain){ - echo_link_for_core_app($domain, 'jitsi', 'Video Chat', 'zinc', '', 'Host secure video calls with your clients and team.'); - echo_link_for_core_app($domain, 'listmonk', 'Email Marketing', 'pink', '', 'Boost sales and engagement with ListMonk.'); - echo_link_for_core_app($domain, 'baserow', 'Visual Databases', 'yellow', '', 'Maintain your data, or build a back end for your next web app with Baserow.'); - echo_link_for_core_app($domain, 'bookstack', 'Wiki Documentation', 'amber', '', 'Create and maintain beautiful documentation for your personal knowledge, company processes, and more.'); - echo_link_for_core_app($domain, 'gitea', 'GIT Source Control', 'emerald', '', 'Manage your repos and CI/CD with confidence using GiTea source control.'); - echo_link_for_core_app($domain, 'castopod', 'Podcast Broadcasting', 'yellow', '', 'Keep your audience engaged and aggregate your podcast easily with Castopod.', '/cp-auth/login'); -} - -function echo_link_for_core_app($domain, $subdomain = '', $app_title = '', $color = 'emerald', $svg = '', $app_description = '', $domain_extension = ''){ - $url = ''; - if (isset($subdomain) && $subdomain !== '') { - $url = $subdomain . '.' . $domain; - } else { - $url = $domain; - } - echo '
'; - echo '
'; - echo '
'; - echo ''; - echo $svg; - echo ''; - echo '
'; - echo '
'; - echo '

'; - echo ''; - echo ''; - echo $app_title; - echo ''; - echo '

'; - echo '

' . $app_description . '

'; - echo '
'; - echo ''; - echo '
'; -} add_action( 'woocommerce_account_provision-info_endpoint', 'federated_provision_info_content' ); // Note: add_action must follow 'woocommerce_account_{your-endpoint-slug}_endpoint' format \ No newline at end of file