Changeset 3305818
- Timestamp:
- 06/03/2025 01:41:40 PM (10 months ago)
- Location:
- avacy/trunk
- Files:
-
- 1 added
- 1 deleted
- 17 edited
-
avacy.php (modified) (1 diff)
-
package.json (modified) (1 diff)
-
src/AddAdminInterface.php (modified) (9 diffs)
-
src/EnqueueBanner.php (modified) (1 diff)
-
src/FormSubmission.php (modified) (2 diffs)
-
src/Integrations/ContactForm7.php (modified) (4 diffs)
-
src/Integrations/ElementorForms.php (modified) (2 diffs)
-
src/Integrations/HtmlForms.php (modified) (4 diffs)
-
src/Integrations/WooCommerceCheckoutForm.php (modified) (5 diffs)
-
src/Integrations/WpForms.php (modified) (5 diffs)
-
src/Interfaces/Form.php (added)
-
src/Interfaces/Integration.php (deleted)
-
src/SendFormsToConsentSolution.php (modified) (2 diffs)
-
src/views/avacy-dashboard.php (modified) (4 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/InstalledVersions.php (modified) (5 diffs)
-
vendor/composer/autoload_classmap.php (modified) (1 diff)
-
vendor/composer/autoload_static.php (modified) (1 diff)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
avacy/trunk/avacy.php
r3299219 r3305818 37 37 } 38 38 39 global $api_base_url; 40 $api_base_url = 'https://api.avacy.eu'; 41 39 42 class Init 40 43 { -
avacy/trunk/package.json
r3286297 r3305818 8 8 }, 9 9 "author": "Jump Group", 10 "license": "GPL-2.0-or-later" 10 "license": "GPL-2.0-or-later", 11 "dependencies": { 12 "@wp-now/wp-now": "^0.1.74" 13 } 11 14 } -
avacy/trunk/src/AddAdminInterface.php
r3239361 r3305818 41 41 42 42 if (empty($checkSaasAccount) || ( !empty($checkSaasAccount) && $checkSaasAccount['status'] === 200) ) { 43 // if tenant and webspace key are not empty, concat them with a pipe 44 if (strpos($webspaceKey, '|') === false) { 45 $webspaceKey = $tenant . '|' . $webspaceKey; 46 update_option('avacy_webspace_key', $webspaceKey); 47 } 48 43 49 if(empty($apiToken)){ 44 50 return; … … 90 96 die( 'Security check' ); 91 97 } 98 99 $isKeyInOldFormat = strpos($_POST['avacy_webspace_key'], '|') === false; 100 if( $isKeyInOldFormat) { 101 $webspaceKey = $_POST['avacy_webspace_key']; 102 $saveAccountToken = $_POST['avacy_webspace_key']; 103 } else { 104 $accountToken = explode('|', $_POST['avacy_webspace_key']); 105 $webspaceKey = $accountToken[1]; 106 $saveAccountToken = $_POST['avacy_webspace_key']; 107 } 108 109 if( $isKeyInOldFormat ) { 110 $tenant = $_POST['avacy_tenant']; 111 } else { 112 $accountToken = explode('|', $_POST['avacy_webspace_key']); 113 $tenant = $accountToken[0]; 114 } 115 92 116 $redirect_to = isset($_POST['redirectToUrl']) ? esc_url(sanitize_text_field($_POST['redirectToUrl'])) : ''; 93 $tenant = isset($_POST['avacy_tenant']) ? sanitize_text_field($_POST['avacy_tenant']) : '';94 $webspaceKey = isset($_POST['avacy_webspace_key']) ? sanitize_text_field($_POST['avacy_webspace_key']) : '';95 117 $apiToken = isset($_POST['avacy_api_token']) ? sanitize_text_field($_POST['avacy_api_token']) : ''; 96 118 $showBanner = isset($_POST['avacy_show_banner']) ? sanitize_text_field($_POST['avacy_show_banner']) : ''; … … 107 129 $can_update = true; 108 130 109 $checkSaasAccount = self::checkSaasAccount($tenant, $ webspaceKey);131 $checkSaasAccount = self::checkSaasAccount($tenant, $_POST['avacy_webspace_key']); 110 132 if (!empty($checkSaasAccount)) { 111 133 $notices[] = $checkSaasAccount['notice']; … … 121 143 } 122 144 123 if (!empty($can_update) && isset($_POST['avacy_active_tab']) && empty($checkSaasAccount)) { 145 $avacyActiveTab = $_POST['avacy_active_tab'] ?? 'cookie-banner'; 146 if (!empty($can_update) && isset($avacyActiveTab) && empty($checkSaasAccount)) { 147 update_option('avacy_webspace_key', esc_attr($saveAccountToken)); 124 148 update_option('avacy_show_banner', esc_attr($showBanner)); 125 149 update_option('avacy_enable_preemptive_block', esc_attr($enablePreemptiveBlock)); … … 151 175 152 176 private static function checkSaasAccount($tenant, $webspaceKey) { 153 $option_tenant = get_option('avacy_tenant'); 154 $option_webspace_key = get_option('avacy_webspace_key'); 155 156 $endpoint = 'https://api.avacy.eu/wp/validate/' . $tenant . '/' . $webspaceKey; 157 177 global $api_base_url; 178 179 $option_account_token = get_option('avacy_webspace_key'); 180 181 if( empty($option_account_token) ) { 182 $option_account_token = $webspaceKey; 183 } 184 185 if (strpos($option_account_token, '|') === false) { 186 $option_tenant = get_option('avacy_tenant'); 187 $option_webspace_key = $option_account_token; 188 $save_account_token = $option_webspace_key; 189 } else { 190 $option_tenant = explode('|', $option_account_token)[0] ?? ''; 191 $option_webspace_key = explode('|', $option_account_token)[1] ?? ''; 192 $save_account_token = $option_account_token; 193 } 194 195 $endpoint = $api_base_url . '/wp/validate/' . $option_tenant . '/' . $option_webspace_key; 158 196 $response = wp_remote_get($endpoint); 159 197 $status_code = wp_remote_retrieve_response_code($response); 160 198 $body = wp_remote_retrieve_body($response); 161 199 $data = json_decode($body, true); 162 163 200 164 201 $setting = ''; … … 185 222 } 186 223 } else { 187 if ( $tenant === $option_tenant && $webspaceKey === $option_webspace_key) {224 if ( ($tenant === $option_tenant && $webspaceKey === $option_webspace_key) || (isset($_POST['avacy_webspace_key']) && $option_account_token === $_POST['avacy_webspace_key'])) { 188 225 return []; 189 226 } … … 194 231 } 195 232 if (!empty($webspaceKey)) { 196 update_option('avacy_webspace_key', esc_attr($ webspaceKey));233 update_option('avacy_webspace_key', esc_attr($save_account_token)); 197 234 } 198 235 if (!empty($webspaceId)) { … … 219 256 220 257 public static function checkConsentSolutionToken($apiToken) { 258 global $api_base_url; 221 259 $option_api_token = get_option('avacy_api_token'); 222 260 … … 230 268 $option_webspace_key = get_option('avacy_webspace_key'); 231 269 232 $endpoint = 'https://api.avacy.eu/wp/validate/' . $option_tenant . '/' . $option_webspace_key . '/' . $apiToken; 270 if( strpos($option_webspace_key, '|') === false ) { 271 $option_webspace_key = $option_webspace_key; 272 } else { 273 $option_tenant = explode('|', $option_webspace_key)[0] ?? ''; 274 $option_webspace_key = explode('|', $option_webspace_key)[1] ?? ''; 275 } 276 277 $endpoint = $api_base_url . '/wp/validate/' . $option_tenant . '/' . $option_webspace_key . '/' . $apiToken; 278 // $endpoint = $api_base_url . '/wp/validate/' . $apiToken; 233 279 234 280 $response = wp_remote_get($endpoint); -
avacy/trunk/src/EnqueueBanner.php
r3123908 r3305818 14 14 public static function enqueueScripts() { 15 15 $avacy_team = esc_attr(get_option('avacy_tenant')); 16 $avacy_uuid = esc_attr(get_option('avacy_webspace_key')); 16 17 $avacy_account_token = esc_attr(get_option('avacy_webspace_key')); 18 if(strpos($avacy_account_token, '|')) { 19 $avacy_account_token = explode('|', $avacy_account_token); 20 $avacy_uuid = $avacy_account_token[1]; 21 } else { 22 $avacy_uuid = esc_attr(get_option('avacy_webspace_key')); 23 } 17 24 18 25 if (!empty($avacy_team) && !empty($avacy_uuid)) { -
avacy/trunk/src/FormSubmission.php
r3123908 r3305818 8 8 class FormSubmission 9 9 { 10 private array $fields; 11 private string $identifier; 12 private string $ipAddress; 13 private string $proofs; 14 private array $legalNotices; 15 private array $preferences; 10 private $ipAddress; 11 private $consentType; 12 private $optin; 13 private $consentData; 14 private $identifier; 15 private $source; 16 private $consentFeatures; 17 private $proof; 16 18 17 19 public function __construct( 18 $fields, 20 $ipAddress, 21 $consentType, 22 $optin, 23 $consentData, 19 24 $identifier, 20 $ipAddress, 21 $proofs, 22 $legalNotices, 23 $preferences 25 $source, 26 $consentFeatures, 27 $proof 24 28 ) { 25 $this->fields = $this->sanitizeFields($fields); 26 $this->identifier = sanitize_text_field($identifier); 27 $this->ipAddress = sanitize_text_field($ipAddress); 28 $this->proofs = sanitize_text_field($proofs); 29 $this->legalNotices = $this->sanitizeLegalNotices($legalNotices); 30 $this->preferences = $this->sanitizePreferences($preferences); 29 $this->ipAddress = $ipAddress ?: '0.0.0.0'; 30 $this->consentType = $consentType; 31 $this->optin = $optin; 32 $this->consentData = $consentData; 33 $this->identifier = $identifier; 34 $this->source = $source; 35 $this->consentFeatures = $consentFeatures; 36 $this->proof = $proof; 31 37 } 32 38 … … 34 40 { 35 41 return [ 36 'subject' => $this->fields, 42 'ip_address' => $this->ipAddress, 43 'consent_type' => $this->consentType, 44 'optin' => $this->optin, 45 'consent_data' => json_decode($this->consentData, true), 37 46 'identifier' => $this->identifier, 38 'ip_address' => $this->ipAddress, 39 'proofs' => $this->proofs, 40 'legal_notices' => $this->legalNotices, 41 'preferences' => $this->preferences 47 'source' => $this->source, 48 'consent_features' => $this->consentFeatures, 49 'html_form' => $this->proof, 42 50 ]; 43 51 } -
avacy/trunk/src/Integrations/ContactForm7.php
r3239981 r3305818 8 8 use Jumpgroup\Avacy\Form; 9 9 use WPCF7_Submission; 10 use Jumpgroup\Avacy\Interfaces\ Integration;10 use Jumpgroup\Avacy\Interfaces\Form as FormInterface; 11 11 use Jumpgroup\Avacy\SendFormsToConsentSolution; 12 12 use Jumpgroup\Avacy\FormSubmission; … … 14 14 use WPCF7_ContactForm; 15 15 16 class ContactForm7 implements Integration16 class ContactForm7 implements FormInterface 17 17 { 18 18 … … 31 31 $selectedFields = []; 32 32 foreach($fields as $field) { 33 $selectedFields[$field] = sanitize_text_field($posted_data[$field]); 33 if(!empty($field)) { 34 $selectedFields[] = [ 35 'label' => $field, 36 'value' => sanitize_text_field($posted_data[$field]) 37 ]; 38 } 34 39 } 35 40 36 $identifier = get_option('avacy_contact_form_7_'. $id .'_form_user_identifier'); // TODO: get identifier from settings41 $identifierKey = get_option('avacy_contact_form_7_'. $id .'_form_user_identifier'); // TODO: get identifier from settings 37 42 $remoteAddr = sanitize_text_field( $_SERVER['REMOTE_ADDR'] ); 38 43 $ipAddress = $remoteAddr ?: '0.0.0.0'; 39 $proofs = wp_json_encode($contact_form->form); 40 41 // TODO: get legal notices from settings 42 $legalNotices = [ 43 ["name" => "privacy_policy"], 44 ["name" => "cookie_policy"] 45 ]; 46 47 // TODO: get preferences from settings 48 $preferences = [ 49 [ 50 "name" => "newsletter", 51 "accepted" => true 52 ], 53 [ 54 "name" => "updates", 55 "accepted" => true 56 ] 44 $proof = self::getHTMLForm($id); 45 $consentData = wp_json_encode($selectedFields); 46 $identifier = $posted_data[$identifierKey] ?? null; 47 $consentFeatures = [ 48 'privacy_policy', 49 'cookie_policy' 57 50 ]; 58 51 59 52 $sub = new FormSubmission( 60 $selectedFields, 53 $ipAddress, 54 'form', 55 'accepted', 56 $consentData, 61 57 $identifier, 62 $ipAddress, 63 $proofs, 64 $legalNotices, 65 $preferences 58 'plugin', 59 $consentFeatures, 60 $proof 66 61 ); 67 62 … … 124 119 }, $fieldNames); 125 120 } 121 122 /** 123 * This function retrieves the HTML form for the Contact Form 7 from the id 124 */ 125 public static function getHTMLForm($id): string { 126 $shortcode = '[contact-form-7 id="' . $id . '"]'; 127 return self::renderShortcode($shortcode); 128 } 129 130 protected static function renderShortcode(string $shortcode): string { 131 ob_start(); 132 echo do_shortcode($shortcode); 133 return ob_get_clean(); 134 } 126 135 } -
avacy/trunk/src/Integrations/ElementorForms.php
r3239361 r3305818 7 7 8 8 use Jumpgroup\Avacy\Form; 9 use Jumpgroup\Avacy\Interfaces\ Integration;9 use Jumpgroup\Avacy\Interfaces\Form as FormInterface; 10 10 use Jumpgroup\Avacy\SendFormsToConsentSolution; 11 11 use Jumpgroup\Avacy\FormSubmission; 12 12 use WP_Query; 13 13 14 class ElementorForms implements Integration{14 class ElementorForms implements FormInterface { 15 15 16 16 public static function listen() : void { … … 176 176 } 177 177 } 178 179 public static function getHTMLForm($id) : string 180 { 181 return ''; 182 } 178 183 } -
avacy/trunk/src/Integrations/HtmlForms.php
r3290429 r3305818 9 9 use Jumpgroup\Avacy\Form; 10 10 use Jumpgroup\Avacy\FormSubmission; 11 use Jumpgroup\Avacy\Interfaces\ Integration;11 use Jumpgroup\Avacy\Interfaces\Form as FormInterface; 12 12 use Jumpgroup\Avacy\SendFormsToConsentSolution; 13 13 use WP_Query; 14 14 15 class HtmlForms implements Integration{15 class HtmlForms implements FormInterface { 16 16 public static function listen() : void { 17 17 add_action('hf_form_success', [__CLASS__, 'formSubmitted'], 10, 2); … … 19 19 20 20 public static function convertToFormSubmission($contact_form) : FormSubmission { 21 $identifier = get_option('avacy_html_forms_'. $contact_form['id'] . '_form_user_identifier'); 21 $identifierKey = get_option('avacy_html_forms_'. $contact_form['id'] . '_form_user_identifier'); 22 $identifier = $contact_form['submission'][$identifierKey]; 22 23 $remoteAddr = sanitize_text_field( $_SERVER['REMOTE_ADDR'] ); 23 24 $ipAddress = $remoteAddr ?: '0.0.0.0'; 24 25 25 $proof s = wp_json_encode($contact_form['source']);26 $proof = self::getHTMLForm($contact_form['slug']); 26 27 $fields = self::getFields($contact_form['id']); 27 28 28 29 $selectedFields = []; 29 30 foreach($fields as $field) { 30 $selectedFields[$field] = sanitize_text_field($contact_form['submission'][$field]); 31 if(!empty($field)) { 32 $selectedFields[] = [ 33 'label' => $field, 34 'value' => sanitize_text_field($contact_form['submission'][$field]) 35 ]; 36 } 31 37 } 32 38 33 // TODO: get legal notices from settings 34 $legalNotices = [ 35 ["name" => "privacy_policy"], 36 ["name" => "cookie_policy"] 39 $consentData = wp_json_encode($selectedFields); 40 41 $consentFeatures = [ 42 'privacy_policy', 43 'cookie_policy' 37 44 ]; 38 45 39 // TODO: get preferences from settings 40 $preferences = [ 41 [ 42 "name" => "newsletter", 43 "accepted" => true 44 ], 45 [ 46 "name" => "updates", 47 "accepted" => true 48 ] 49 ]; 46 $sub = new FormSubmission( 47 $ipAddress, 48 'form', 49 'accepted', 50 $consentData, 51 $identifier, 52 'plugin', 53 $consentFeatures, 54 $proof 55 ); 50 56 51 return new FormSubmission( 52 $selectedFields, 53 $identifier, 54 $ipAddress, 55 $proofs, 56 $legalNotices, 57 $preferences 58 ); 57 return $sub; 59 58 } 60 59 61 60 public static function formSubmitted($submission, $form) : void { 61 62 62 // eventually we want to do something with the form... 63 63 $submissionInput = []; … … 70 70 $formData['id'] = $submission->form_id; 71 71 $formData['source'] = htmlentities($form->markup); 72 $formData['slug'] = htmlentities($form->slug); 72 73 73 74 self::sendFormData($formData); … … 163 164 } 164 165 166 public static function getHTMLForm($id) : string 167 { 168 $shortcode = '[hf_form slug="' . $id . '"]'; 169 $form = self::renderShortcode($shortcode); 170 return $form; 171 } 172 173 public static function renderShortcode($shortcode) : string 174 { 175 ob_start(); 176 echo do_shortcode($shortcode); 177 return ob_get_clean(); 178 } 179 165 180 } -
avacy/trunk/src/Integrations/WooCommerceCheckoutForm.php
r3239361 r3305818 7 7 8 8 use Jumpgroup\Avacy\Form; 9 use Jumpgroup\Avacy\Interfaces\ Integration;9 use Jumpgroup\Avacy\Interfaces\Form as FormInterface; 10 10 use Jumpgroup\Avacy\SendFormsToConsentSolution; 11 11 use Jumpgroup\Avacy\FormSubmission; 12 12 use WP_Query; 13 13 14 class WooCommerceCheckoutForm implements Integration14 class WooCommerceCheckoutForm implements FormInterface 15 15 { 16 16 … … 61 61 public static function convertToFormSubmission($order_id) : FormSubmission 62 62 { 63 $checkoutForm = self::getWcCheckoutTemplate();64 63 65 $identifier = get_option('avacy_WooCommerce_Checkout_Form_' . $id . '_form_user_identifier'); // TODO: get identifier from settings 64 $identifierKey = get_option('avacy_WooCommerce_Checkout_Form_' . $id . '_form_user_identifier'); // TODO: get identifier from settings 65 $identifier = ''; 66 66 67 $remoteAddr = sanitize_text_field( $_SERVER['REMOTE_ADDR'] ); 67 68 $ipAddress = $remoteAddr ?: '0.0.0.0'; 68 $proofs = wp_json_encode($checkoutForm);69 69 $posted_data = wc_get_order($order_id)->get_data()['billing']; 70 $proofs = self::getHTMLForm(1); 70 71 71 72 $fields = self::getFields(); … … 74 75 foreach($fields as $field) { 75 76 if(isset($posted_data[$field])) 76 $selectedFields[$field] = sanitize_text_field($posted_data[$field]); 77 $selectedFields[$field] = [ 78 'label' => $field, 79 'value' => sanitize_text_field($posted_data[$field]) 80 ]; 77 81 } 78 82 79 // TODO: get legal notices from settings 80 $legalNotices = [ 81 ["name" => "privacy_policy"], 82 ["name" => "cookie_policy"] 83 $selectedFields[] = 84 $identifier = $posted_data[$identifier] ?? null; 85 $consentFeatures = [ 86 'privacy_policy', 87 'cookie_policy' 83 88 ]; 84 89 85 // TODO: get preferences from settings 86 $preferences = [ 87 [ 88 "name" => "newsletter", 89 "accepted" => true 90 ], 91 [ 92 "name" => "updates", 93 "accepted" => true 94 ] 95 ]; 90 $consentData = wp_json_encode($selectedFields); 96 91 97 return new FormSubmission( 98 $selectedFields, 92 $sub = new FormSubmission( 93 $ipAddress, 94 'form', 95 'accepted', 96 $consentData, 99 97 $identifier, 100 $ipAddress, 101 $proofs, 102 $legalNotices, 103 $preferences 98 'plugin', 99 $consentFeatures, 100 $proofs 104 101 ); 102 103 return $sub; 105 104 } 106 105 … … 132 131 } 133 132 134 p rivate static function getWcCheckoutTemplate(){133 public static function getHTMLForm($id) : string { 135 134 ob_start(); 136 135 … … 145 144 ob_end_clean(); 146 145 147 return $checkoutForm;146 return json_encode($checkoutForm); 148 147 } 149 148 -
avacy/trunk/src/Integrations/WpForms.php
r3239361 r3305818 7 7 8 8 use Jumpgroup\Avacy\Form; 9 use Jumpgroup\Avacy\Interfaces\ Integration;9 use Jumpgroup\Avacy\Interfaces\Form as FormInterface; 10 10 use Jumpgroup\Avacy\SendFormsToConsentSolution; 11 11 use Jumpgroup\Avacy\FormSubmission; 12 12 13 class WpForms implements Integration{13 class WpForms implements FormInterface { 14 14 15 15 public static function listen() : void { … … 19 19 public static function convertToFormSubmission($contact_form) : FormSubmission { 20 20 $id = absint($contact_form['id']); 21 $identifier = get_option('avacy_wp_forms_' . $id . '_form_user_identifier'); 21 $identifierKey = get_option('avacy_wp_forms_' . $id . '_form_user_identifier'); 22 $identifier = ''; 22 23 $remoteAddr = sanitize_text_field( $_SERVER['REMOTE_ADDR'] ); 23 24 $ipAddress = $remoteAddr ?: '0.0.0.0'; … … 25 26 $fields = self::getFields($id); 26 27 $selectedFields = []; 27 28 $formContent = wpforms()->form->get( $id, array( 'content_only' => true ) );29 28 30 29 $submittedFields = $contact_form['fields']; … … 34 33 $slug = strtolower(str_replace(' ', '_', $inputValue['name'])); 35 34 if($field === $slug) { 36 $selectedFields[$field] = sanitize_text_field($inputValue['value']); 35 $selectedFields[] = [ 36 'label' => $field, 37 'value' => sanitize_text_field($inputValue['value']) 38 ]; 39 } 40 41 if($identifierKey === $slug) { 42 $identifier = $inputValue['value']; 37 43 } 38 44 } 39 45 } 40 46 41 $proofs = wp_json_encode($formContent); 42 43 // TODO: get legal notices from settings 44 $legalNotices = [ 45 ["name" => "privacy_policy"], 46 ["name" => "cookie_policy"] 47 $consentData = wp_json_encode($selectedFields); 48 $consentFeatures = [ 49 'privacy_policy', 50 'cookie_policy' 47 51 ]; 48 52 49 // TODO: get preferences from settings50 $ preferences = [51 [52 "name" => "newsletter",53 "accepted" => true54 ],55 [56 "name" => "updates",57 "accepted" => true58 ]59 ];53 $proofs = self::getHTMLForm($id); 54 $sub = new FormSubmission( 55 $ipAddress, 56 'form', 57 'accepted', 58 $consentData, 59 $identifier, 60 'plugin', 61 $consentFeatures, 62 $proofs 63 ); 60 64 61 return new FormSubmission( 62 $selectedFields, 63 $identifier, 64 $ipAddress, 65 $proofs, 66 $legalNotices, 67 $preferences 68 ); 65 return $sub; 69 66 } 70 67 … … 132 129 }, $fieldNames); 133 130 } 131 132 public static function getHTMLForm($id) : string 133 { 134 $shortcode = '[wpforms id="' . $id . '"]'; 135 $form = self::renderShortcode($shortcode); 136 return $form; 137 } 138 139 public static function renderShortcode($shortcode) : string 140 { 141 ob_start(); 142 echo do_shortcode($shortcode); 143 return ob_get_clean(); 144 } 134 145 } -
avacy/trunk/src/SendFormsToConsentSolution.php
r3123908 r3305818 30 30 public static function send(FormSubmission $form) 31 31 { 32 global $api_base_url; 33 32 34 $payload = $form->getPayload(); 33 35 $apiToken = get_option('avacy_api_token'); 34 36 $tenant = get_option('avacy_tenant'); 37 if( empty($tenant) && strpos(get_option('avacy_webspace_key'), '|') !== false ) { 38 $tenant = explode('|', get_option('avacy_webspace_key'))[0]; 39 } 40 35 41 $webspaceId = get_option('avacy_webspace_id'); 36 42 … … 52 58 53 59 // API endpoint URL 54 $url = 'https://api.avacy.eu/' . $tenant . '/v2/webspaces/' . $webspaceId . '/consents';60 $url = $api_base_url . '/' . $tenant . '/v4/webspaces/' . $webspaceId . '/consents'; 55 61 56 62 // Set the arguments for the POST request -
avacy/trunk/src/views/avacy-dashboard.php
r3239363 r3305818 4 4 } 5 5 use Jumpgroup\Avacy\AddAdminInterface; 6 7 global $api_base_url; 6 8 // esacape the base api url 7 $base_api_url = esc_attr( 'https://api.avacy.eu/wp');9 $base_api_url = esc_attr($api_base_url . '/wp'); 8 10 $registration_url = esc_attr('https://avacy.eu/registration'); 9 11 $documention_url = esc_attr('https://docs.avacysolution.com'); … … 68 70 <section class="AvacySection AvacySection--Account"> 69 71 <div class="EditAccountPanel <?php echo !empty(get_option('avacy_webspace_id')) ? 'hidden' : ''?>"> 70 < sl-input name="avacy_tenant" placeholder="<?php echo esc_html__('Enter the name of your team', 'avacy')?>" size="small" value="<?php echo esc_attr(get_option('avacy_tenant')); ?>" required>72 <!-- <sl-input name="avacy_tenant" placeholder="<?php echo esc_html__('Enter the name of your team', 'avacy')?>" size="small" value="<?php echo esc_attr(get_option('avacy_tenant')); ?>" required> 71 73 <label for="avacy_tenant" slot="label"> 72 74 <span><?php echo esc_html__('Avacy Team Name', 'avacy')?></span> … … 75 77 <sl-icon name="info-circle"></sl-icon> 76 78 </sl-tooltip> 77 </sl-input> 79 </sl-input> --> 78 80 <sl-input name="avacy_webspace_key" placeholder="<?php echo esc_html__('Enter the specific key of your webspace', 'avacy')?>" size="small" value="<?php echo esc_attr(get_option('avacy_webspace_key')); ?>" required> 79 81 <label for="avacy_webspace_key" slot="label"> … … 88 90 </div> 89 91 <div class="RenderAccountPanel <?php echo empty(get_option('avacy_webspace_id')) ? 'hidden' : ''?>"> 90 < div class="AccountDetail"><span class="AccountDetail__Key"><?php echo esc_html__('Avacy Team Name', 'avacy')?>:</span><span class="AccountDetail__Value"><?php echo esc_attr(get_option('avacy_tenant')); ?></span></div>92 <!-- <div class="AccountDetail"><span class="AccountDetail__Key"><?php echo esc_html__('Avacy Team Name', 'avacy')?>:</span><span class="AccountDetail__Value"><?php echo esc_attr(get_option('avacy_tenant')); ?></span></div> --> 91 93 <div class="AccountDetail"><span class="AccountDetail__Key"><?php echo esc_html__('Webspace Key', 'avacy')?>:</span><span class="AccountDetail__Value"><?php echo esc_attr(get_option('avacy_webspace_key')); ?></span></div> 92 94 <sl-button class="Edit" variant="text"> -
avacy/trunk/vendor/autoload.php
r3299219 r3305818 15 15 } 16 16 } 17 trigger_error( 18 $err, 19 E_USER_ERROR 20 ); 17 throw new RuntimeException($err); 21 18 } 22 19 -
avacy/trunk/vendor/composer/InstalledVersions.php
r3299219 r3305818 28 28 { 29 29 /** 30 * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to 31 * @internal 32 */ 33 private static $selfDir = null; 34 35 /** 30 36 * @var mixed[]|null 31 37 * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null 32 38 */ 33 39 private static $installed; 40 41 /** 42 * @var bool 43 */ 44 private static $installedIsLocalDir; 34 45 35 46 /** … … 310 321 self::$installed = $data; 311 322 self::$installedByVendor = array(); 323 324 // when using reload, we disable the duplicate protection to ensure that self::$installed data is 325 // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not, 326 // so we have to assume it does not, and that may result in duplicate data being returned when listing 327 // all installed packages for example 328 self::$installedIsLocalDir = false; 329 } 330 331 /** 332 * @return string 333 */ 334 private static function getSelfDir() 335 { 336 if (self::$selfDir === null) { 337 self::$selfDir = strtr(__DIR__, '\\', '/'); 338 } 339 340 return self::$selfDir; 312 341 } 313 342 … … 323 352 324 353 $installed = array(); 354 $copiedLocalDir = false; 325 355 326 356 if (self::$canGetVendors) { 357 $selfDir = self::getSelfDir(); 327 358 foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { 359 $vendorDir = strtr($vendorDir, '\\', '/'); 328 360 if (isset(self::$installedByVendor[$vendorDir])) { 329 361 $installed[] = self::$installedByVendor[$vendorDir]; … … 331 363 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 364 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 365 self::$installedByVendor[$vendorDir] = $required; 366 $installed[] = $required; 367 if (self::$installed === null && $vendorDir.'/composer' === $selfDir) { 368 self::$installed = $required; 369 self::$installedIsLocalDir = true; 336 370 } 371 } 372 if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) { 373 $copiedLocalDir = true; 337 374 } 338 375 } … … 351 388 } 352 389 353 if (self::$installed !== array() ) {390 if (self::$installed !== array() && !$copiedLocalDir) { 354 391 $installed[] = self::$installed; 355 392 } -
avacy/trunk/vendor/composer/autoload_classmap.php
r3299219 r3305818 18 18 'Jumpgroup\\Avacy\\Integrations\\WooCommerceCheckoutForm' => $baseDir . '/src/Integrations/WooCommerceCheckoutForm.php', 19 19 'Jumpgroup\\Avacy\\Integrations\\WpForms' => $baseDir . '/src/Integrations/WpForms.php', 20 'Jumpgroup\\Avacy\\Interfaces\\ Integration' => $baseDir . '/src/Interfaces/Integration.php',20 'Jumpgroup\\Avacy\\Interfaces\\Form' => $baseDir . '/src/Interfaces/Form.php', 21 21 'Jumpgroup\\Avacy\\PreemptiveBlock' => $baseDir . '/src/PreemptiveBlock.php', 22 22 'Jumpgroup\\Avacy\\SendFormsToConsentSolution' => $baseDir . '/src/SendFormsToConsentSolution.php', -
avacy/trunk/vendor/composer/autoload_static.php
r3299219 r3305818 33 33 'Jumpgroup\\Avacy\\Integrations\\WooCommerceCheckoutForm' => __DIR__ . '/../..' . '/src/Integrations/WooCommerceCheckoutForm.php', 34 34 'Jumpgroup\\Avacy\\Integrations\\WpForms' => __DIR__ . '/../..' . '/src/Integrations/WpForms.php', 35 'Jumpgroup\\Avacy\\Interfaces\\ Integration' => __DIR__ . '/../..' . '/src/Interfaces/Integration.php',35 'Jumpgroup\\Avacy\\Interfaces\\Form' => __DIR__ . '/../..' . '/src/Interfaces/Form.php', 36 36 'Jumpgroup\\Avacy\\PreemptiveBlock' => __DIR__ . '/../..' . '/src/PreemptiveBlock.php', 37 37 'Jumpgroup\\Avacy\\SendFormsToConsentSolution' => __DIR__ . '/../..' . '/src/SendFormsToConsentSolution.php', -
avacy/trunk/vendor/composer/installed.php
r3299219 r3305818 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 4079e2eb96de082dd880b4a4dbaab5c3dae52f2e',6 'reference' => '23989fdd4f75d9b7a42cd5f4cbc43ed4a9f6fc7d', 7 7 'type' => 'wordpress-muplugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 4079e2eb96de082dd880b4a4dbaab5c3dae52f2e',16 'reference' => '23989fdd4f75d9b7a42cd5f4cbc43ed4a9f6fc7d', 17 17 'type' => 'wordpress-muplugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.