query_vars, $home_url ); if($this_page_url != $home_url . '?page&pagename=my-account'){ return; } $user = wp_get_current_user(); // Loop through user subscriptions foreach ( wcs_get_users_subscriptions($user->ID) as $subscription ) { if($subscription->has_status( 'active' )){ echo_subscription_info($subscription); } } } function echo_subscription_info($subscription){ $subscription_id = $subscription->ID; $domain = get_field('domain', $subscription_id); $domain_status = get_field('domain_status', $subscription_id); $provision_status = get_field('provision_status', $subscription_id); $initial_admin_password = get_field('initial_admin_password', $subscription_id); $tier = get_subscription_tier($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.

'; 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); } else if($provision_status === 'needs_provision' || $provision_status === 'provisioning') { echo '
'; echo '
'; echo '

Welcome To Federated, Your Core is being provisioned as we speak.

'; 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 '
'; } } 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