Plugin Directory

Changeset 3369608


Ignore:
Timestamp:
09/29/2025 10:23:29 AM (5 months ago)
Author:
jumptech
Message:

fix links to avacy SaaS and webspace key updating process

Location:
avacy/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • avacy/trunk/src/AddAdminInterface.php

    r3305818 r3369608  
    145145    $avacyActiveTab = $_POST['avacy_active_tab'] ?? 'cookie-banner';
    146146    if (!empty($can_update) && isset($avacyActiveTab) && empty($checkSaasAccount)) {
    147       update_option('avacy_webspace_key', esc_attr($saveAccountToken));
    148147      update_option('avacy_show_banner', esc_attr($showBanner));
    149148      update_option('avacy_enable_preemptive_block', esc_attr($enablePreemptiveBlock));
     
    155154        'success'
    156155      ];
     156    }
     157
     158    // if current avacy_webspace_key and avacy_tenant are not the same as the new ones, update them
     159    if (get_option('avacy_tenant') !== $tenant || get_option('avacy_webspace_key') !== $webspaceKey) {
     160      update_option('avacy_tenant', esc_attr($tenant));
     161      update_option('avacy_webspace_key', esc_attr($saveAccountToken));
    157162    }
    158163
  • avacy/trunk/src/views/avacy-dashboard.php

    r3328185 r3369608  
    116116                        <div class="AvacyDescription">
    117117                            <p>
    118                                 <?php
    119                                     $cookie_banner_href = $base_api_url.'/redirect/cookie-banner/'.get_option('avacy_tenant').'/'.get_option('avacy_webspace_key');
     118                                <?php
     119                                    $isKeyInOldFormat = strpos(get_option('avacy_webspace_key'), '|') === false;
     120                                    if( $isKeyInOldFormat) {
     121                                        $webspaceKey = get_option('avacy_webspace_key');
     122                                    } else {
     123                                        $accountToken = explode('|', get_option('avacy_webspace_key'));
     124                                        $webspaceKey = $accountToken[1];
     125                                    }
     126                                    $cookie_banner_href = $base_api_url.'/redirect/cookie-banner/'.get_option('avacy_tenant').'/'.$webspaceKey;
    120127                                    echo wp_kses_post(sprintf(__('To modify the appearance of the cookie banner <a href=%s target="_blank">click here</a>.', 'avacy'),esc_url($cookie_banner_href)));
    121128                                ?>
Note: See TracChangeset for help on using the changeset viewer.