Plugin Directory

Changeset 3084002


Ignore:
Timestamp:
05/09/2024 01:39:03 PM (19 months ago)
Author:
jamieblomerus
Message:

Upload version 1.2 to trunk

Location:
mobile-bankid-integration/trunk
Files:
21 added
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • mobile-bankid-integration/trunk/assets/js/setup.full.js

    r3070283 r3084002  
    5858
    5959function configureSubmit() {
    60     // Check if all required fields are filled
    61     if (!document.getElementById('mobile-bankid-integration-endpoint').value) {
    62         alert(mobile_bankid_integration_setup_localization.endpoint_required);
    63         return false;
    64     }
    6560    if (!document.getElementById('mobile-bankid-integration-certificate').value) {
    6661        alert(mobile_bankid_integration_setup_localization.certificate_required);
     
    8782
    8883    formdata = new FormData();
    89     formdata.append('endpoint', document.getElementById('mobile-bankid-integration-endpoint').value);
    9084    formdata.append('certificate', document.getElementById('mobile-bankid-integration-certificate').value);
    9185    formdata.append('password', document.getElementById('mobile-bankid-integration-password').value);
  • mobile-bankid-integration/trunk/assets/js/setup.js

    r3070283 r3084002  
    1 document.getElementById("adminmenumain").remove();document.getElementById("wpadminbar").remove();document.getElementById("wpfooter").remove();document.getElementById("screen-meta").remove();function nextStep(){step=document.getElementById("wizard-content").attributes.step.value;if(step<4){for(i in document.getElementById("wizard-content").getElementsByTagName("button")){document.getElementById("wizard-content").getElementsByTagName("button")[i].disabled=true}for(i in document.getElementById("wizard-content").getElementsByTagName("input")){document.getElementById("wizard-content").getElementsByTagName("input")[i].disabled=true}document.getElementsByClassName("steps")[0].children[0].children[step-1].classList.add("done");document.getElementsByClassName("steps")[0].children[0].children[step-1].classList.remove("active");document.getElementsByClassName("steps")[0].children[0].children[step-1].classList.add("animate-done");document.getElementsByClassName("steps")[0].children[0].children[step].classList.add("active");document.getElementsByClassName("steps")[0].children[0].children[step].classList.add("animate-active");step++;setTimeout(function(){window.location.search+="&step="+step},500)}else{console.log("nextStep() can't be used on last step.")}}function requireconfirmation(id,confirmationText){document.getElementById("wizard-modal-confirmation-text").innerHTML=confirmationText+"<br><br>"+mobile_bankid_integration_setup_localization.confirmation_abort_text;document.getElementById("wizard-modal-abort").setAttribute("onclick",'abortconfirmation("'+id+'")');document.getElementById("wizard-modal-confirm").setAttribute("onclick",'confirmconfirmation("'+id+'")');document.getElementById("wizard-modal-abort").removeAttribute("disabled");document.getElementById("wizard-modal-confirm").removeAttribute("disabled");document.getElementById("wizard-modal").style.display="block"}function abortconfirmation(id=null){if(id!=null){document.getElementById(id).checked=false}document.getElementById("wizard-modal").style.display="none"}function confirmconfirmation(id){document.getElementById("wizard-modal-abort").setAttribute("disabled","disabled");document.getElementById("wizard-modal-confirm").setAttribute("disabled","disabled");if(id=="mobile-bankid-integration-testenv"){autoconfiguretestenv()}document.getElementById("wizard-modal").style.display="none"}function configureSubmit(){if(!document.getElementById("mobile-bankid-integration-endpoint").value){alert(mobile_bankid_integration_setup_localization.endpoint_required);return false}if(!document.getElementById("mobile-bankid-integration-certificate").value){alert(mobile_bankid_integration_setup_localization.certificate_required);return false}if(!document.getElementById("mobile-bankid-integration-password").value){alert(mobile_bankid_integration_setup_localization.password_required);return false}var xhr=new XMLHttpRequest;xhr.open("POST",mobile_bankid_integration_rest_api+"/configuration",true);xhr.setRequestHeader("X-WP-Nonce",mobile_bankid_integration_rest_api_nonce);xhr.onload=function(){if(this.status==200){nextStep()}else{response=JSON.parse(this.responseText);alert(mobile_bankid_integration_setup_localization.configuration_failed+response["message"])}};formdata=new FormData;formdata.append("endpoint",document.getElementById("mobile-bankid-integration-endpoint").value);formdata.append("certificate",document.getElementById("mobile-bankid-integration-certificate").value);formdata.append("password",document.getElementById("mobile-bankid-integration-password").value);xhr.send(formdata)}function settingsSubmit(){var xhr=new XMLHttpRequest;xhr.open("POST",mobile_bankid_integration_rest_api+"/setup_settings",true);xhr.setRequestHeader("X-WP-Nonce",mobile_bankid_integration_rest_api_nonce);xhr.onload=function(){if(this.status==200){nextStep()}else{response=JSON.parse(this.responseText);alert(mobile_bankid_integration_setup_localization.configuration_failed+response["message"])}};formdata=new FormData;formdata.append("wplogin",document.getElementById("mobile-bankid-integration-wplogin").value);formdata.append("registration",document.getElementById("mobile-bankid-integration-registration").value);xhr.send(formdata)}function autoconfiguretestenv(){var xhr=new XMLHttpRequest;xhr.open("GET",mobile_bankid_integration_rest_api+"/autoconfiguretestenv",true);xhr.setRequestHeader("X-WP-Nonce",mobile_bankid_integration_rest_api_nonce);xhr.onload=function(){if(this.status==200){nextStep()}else{alert(mobile_bankid_integration_setup_localization.testenv_autoconfig_failed);document.getElementById("mobile-bankid-integration-testenv").checked=false}};xhr.send()}mobile_bankid_integration_testenv=document.getElementById("mobile-bankid-integration-testenv");if(mobile_bankid_integration_testenv){mobile_bankid_integration_testenv.addEventListener("click",function(){if(this.checked){requireconfirmation("mobile-bankid-integration-testenv",mobile_bankid_integration_setup_localization.testenv_confirmation_text)}})}
     1document.getElementById("adminmenumain").remove();document.getElementById("wpadminbar").remove();document.getElementById("wpfooter").remove();document.getElementById("screen-meta").remove();function nextStep(){step=document.getElementById("wizard-content").attributes.step.value;if(step<4){for(i in document.getElementById("wizard-content").getElementsByTagName("button")){document.getElementById("wizard-content").getElementsByTagName("button")[i].disabled=true}for(i in document.getElementById("wizard-content").getElementsByTagName("input")){document.getElementById("wizard-content").getElementsByTagName("input")[i].disabled=true}document.getElementsByClassName("steps")[0].children[0].children[step-1].classList.add("done");document.getElementsByClassName("steps")[0].children[0].children[step-1].classList.remove("active");document.getElementsByClassName("steps")[0].children[0].children[step-1].classList.add("animate-done");document.getElementsByClassName("steps")[0].children[0].children[step].classList.add("active");document.getElementsByClassName("steps")[0].children[0].children[step].classList.add("animate-active");step++;setTimeout(function(){window.location.search+="&step="+step},500)}else{console.log("nextStep() can't be used on last step.")}}function requireconfirmation(id,confirmationText){document.getElementById("wizard-modal-confirmation-text").innerHTML=confirmationText+"<br><br>"+mobile_bankid_integration_setup_localization.confirmation_abort_text;document.getElementById("wizard-modal-abort").setAttribute("onclick",'abortconfirmation("'+id+'")');document.getElementById("wizard-modal-confirm").setAttribute("onclick",'confirmconfirmation("'+id+'")');document.getElementById("wizard-modal-abort").removeAttribute("disabled");document.getElementById("wizard-modal-confirm").removeAttribute("disabled");document.getElementById("wizard-modal").style.display="block"}function abortconfirmation(id=null){if(id!=null){document.getElementById(id).checked=false}document.getElementById("wizard-modal").style.display="none"}function confirmconfirmation(id){document.getElementById("wizard-modal-abort").setAttribute("disabled","disabled");document.getElementById("wizard-modal-confirm").setAttribute("disabled","disabled");if(id=="mobile-bankid-integration-testenv"){autoconfiguretestenv()}document.getElementById("wizard-modal").style.display="none"}function configureSubmit(){if(!document.getElementById("mobile-bankid-integration-certificate").value){alert(mobile_bankid_integration_setup_localization.certificate_required);return false}if(!document.getElementById("mobile-bankid-integration-password").value){alert(mobile_bankid_integration_setup_localization.password_required);return false}var xhr=new XMLHttpRequest;xhr.open("POST",mobile_bankid_integration_rest_api+"/configuration",true);xhr.setRequestHeader("X-WP-Nonce",mobile_bankid_integration_rest_api_nonce);xhr.onload=function(){if(this.status==200){nextStep()}else{response=JSON.parse(this.responseText);alert(mobile_bankid_integration_setup_localization.configuration_failed+response["message"])}};formdata=new FormData;formdata.append("certificate",document.getElementById("mobile-bankid-integration-certificate").value);formdata.append("password",document.getElementById("mobile-bankid-integration-password").value);xhr.send(formdata)}function settingsSubmit(){var xhr=new XMLHttpRequest;xhr.open("POST",mobile_bankid_integration_rest_api+"/setup_settings",true);xhr.setRequestHeader("X-WP-Nonce",mobile_bankid_integration_rest_api_nonce);xhr.onload=function(){if(this.status==200){nextStep()}else{response=JSON.parse(this.responseText);alert(mobile_bankid_integration_setup_localization.configuration_failed+response["message"])}};formdata=new FormData;formdata.append("wplogin",document.getElementById("mobile-bankid-integration-wplogin").value);formdata.append("registration",document.getElementById("mobile-bankid-integration-registration").value);xhr.send(formdata)}function autoconfiguretestenv(){var xhr=new XMLHttpRequest;xhr.open("GET",mobile_bankid_integration_rest_api+"/autoconfiguretestenv",true);xhr.setRequestHeader("X-WP-Nonce",mobile_bankid_integration_rest_api_nonce);xhr.onload=function(){if(this.status==200){nextStep()}else{alert(mobile_bankid_integration_setup_localization.testenv_autoconfig_failed);document.getElementById("mobile-bankid-integration-testenv").checked=false}};xhr.send()}mobile_bankid_integration_testenv=document.getElementById("mobile-bankid-integration-testenv");if(mobile_bankid_integration_testenv){mobile_bankid_integration_testenv.addEventListener("click",function(){if(this.checked){requireconfirmation("mobile-bankid-integration-testenv",mobile_bankid_integration_setup_localization.testenv_confirmation_text)}})}
  • mobile-bankid-integration/trunk/includes/admin/class-admin.php

    r3070283 r3084002  
    11<?php
     2
    23namespace Mobile_BankID_Integration;
    34
     
    1011 */
    1112class Admin {
     13
    1214
    1315    /**
     
    9294    public function redirect_to_setup_if_incomplete() {
    9395        if ( get_admin_page_parent() === 'mobile-bankid-integration' ) {
    94             if ( ! ( get_option( 'mobile_bankid_integration_certificate' ) && get_option( 'mobile_bankid_integration_password' ) && get_option( 'mobile_bankid_integration_endpoint' ) ) ) {
     96            if ( ! ( get_option( 'mobile_bankid_integration_env' ) && get_option( 'mobile_bankid_integration_certificate' ) && get_option( 'mobile_bankid_integration_password' ) ) ) {
    9597                // Redirect to setup wizard.
    9698                wp_safe_redirect( home_url() . '/wp-admin/admin.php?page=mobile-bankid-integration-setup' );
     
    112114        Session::admin_notice(); // Show admin notice if session secret is not set.
    113115
    114         $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : null; // phpcs:ignore -- Sanitization not needed as it is used in array_key_exists().
     116        $current_tab = isset($_GET['tab']) ? $_GET['tab'] : null; // phpcs:ignore -- Sanitization not needed as it is used in array_key_exists().
    115117        if ( ! isset( $current_tab ) || ! array_key_exists( $current_tab, self::$tabs ) ) {
    116118            $current_tab = array_key_first( self::$tabs );
     
    140142     */
    141143    private function page_settings() {
     144        $env = get_option( 'mobile_bankid_integration_env' );
    142145        ?>
    143 <form autocomplete="off">
    144     <h2><?php esc_html_e( 'Basic configuration', 'mobile-bankid-integration' ); ?></h2>
    145     <p class="description"><?php esc_html_e( 'These settings can only be changed by running the setup wizard again.', 'mobile-bankid-integration' ); ?></p>
    146     <div class="form-group">
    147         <label for="mobile-bankid-integration-endpoint"><?php esc_html_e( 'API Endpoint', 'mobile-bankid-integration' ); ?></label>
    148         <input type="text" name="mobile-bankid-integration-endpoint" id="mobile-bankid-integration-endpoint" disabled readonly value="<?php echo esc_url( get_option( 'mobile_bankid_integration_endpoint' ) ); ?>">
    149     </div>
    150     <div class="form-group">
    151         <label for="mobile-bankid-integration-certificate"><?php esc_html_e( 'Certificate location (absolute path)', 'mobile-bankid-integration' ); ?></label>
    152         <input type="text" name="mobile-bankid-integration-certificate" id="mobile-bankid-integration-certificate" disabled readonly value="<?php echo esc_attr( get_option( 'mobile_bankid_integration_certificate' ) ); ?>">
    153     </div>
    154     <div class="form-group">
    155         <label for="mobile-bankid-integration-password"><?php esc_html_e( 'Certificate password', 'mobile-bankid-integration' ); ?></label>
    156         <input type="password" name="mobile-bankid-integration-password" id="mobile-bankid-integration-password" autocomplete="off" disabled readonly value="<?php echo get_option( 'mobile_bankid_integration_password' ) ? '************' : '';?>">
    157     </div>
    158 
    159     <h2><?php esc_html_e( 'Login page', 'mobile-bankid-integration' ); ?></h2>
    160     <div class="form-group">
    161         <label for="mobile-bankid-integration-wplogin"><?php esc_html_e( 'Show BankID on login page', 'mobile-bankid-integration' ); ?></label>
    162         <select name="mobile-bankid-integration-wplogin" id="mobile-bankid-integration-wplogin">
    163             <option value="as_alternative"
     146        <form autocomplete="off">
     147            <h2><?php esc_html_e( 'Basic configuration', 'mobile-bankid-integration' ); ?></h2>
    164148            <?php
    165             if ( get_option( 'mobile_bankid_integration_wplogin' ) === 'as_alternative' ) {
    166                 echo 'selected'; }
     149            if ( 'production' === $env ) {
     150                ?>
     151                <p class="description"><?php esc_html_e( 'These settings can only be changed by running the setup wizard again.', 'mobile-bankid-integration' ); ?></p>
     152                <div class="form-group">
     153                    <label for="mobile-bankid-integration-certificate"><?php esc_html_e( 'Certificate location (absolute path)', 'mobile-bankid-integration' ); ?></label>
     154                    <input type="text" name="mobile-bankid-integration-certificate" id="mobile-bankid-integration-certificate" disabled readonly value="<?php echo esc_attr( get_option( 'mobile_bankid_integration_certificate' ) ); ?>">
     155                </div>
     156                <div class="form-group">
     157                    <label for="mobile-bankid-integration-password"><?php esc_html_e( 'Certificate password', 'mobile-bankid-integration' ); ?></label>
     158                    <input type="password" name="mobile-bankid-integration-password" id="mobile-bankid-integration-password" autocomplete="off" disabled readonly value="<?php echo get_option( 'mobile_bankid_integration_password' ) ? '************' : ''; ?>">
     159                </div>
     160                <?php
     161            } else {
     162                ?>
     163                <p class="description"><?php esc_html_e( 'The plugin is configured for test environment. To change this, run the setup wizard again.', 'mobile-bankid-integration' ); ?></p>
     164                <?php
     165            }
    167166            ?>
    168             ><?php esc_html_e( 'Show as alternative to traditional login', 'mobile-bankid-integration' ); ?></option>
    169             <option value="hide"
    170             <?php
    171             if ( get_option( 'mobile_bankid_integration_wplogin' ) === 'hide' ) {
    172                 echo 'selected'; }
    173             ?>
    174             ><?php esc_html_e( 'Do not show at all', 'mobile-bankid-integration' ); ?></option>
    175         </select>
    176     </div><br>
    177     <div class="form-group">
    178         <label for="mobile-bankid-integration-registration"><?php esc_html_e( 'Allow registration with BankID', 'mobile-bankid-integration' ); ?></label>
    179         <select name="mobile-bankid-integration-registration" id="mobile-bankid-integration-registration">
    180             <option value="yes"
    181             <?php
    182             if ( get_option( 'mobile_bankid_integration_registration' ) === 'yes' ) {
    183                 echo 'selected'; }
    184             ?>
    185             ><?php esc_html_e( 'Yes', 'mobile-bankid-integration' ); ?></option>
    186             <option value="no"
    187             <?php
    188             if ( get_option( 'mobile_bankid_integration_registration' ) === 'no' ) {
    189                 echo 'selected'; }
    190             ?>
    191             ><?php esc_html_e( 'No', 'mobile-bankid-integration' ); ?></option>
    192         </select>
    193         <p class="description"><?php esc_html_e( 'This setting does not affect, nor is affected by, the native "Allow registration" setting.', 'mobile-bankid-integration' ); ?></p>
    194     </div>
    195     <div class="form-group">
    196         <label for="mobile-bankid-integration-terms"><?php esc_html_e( 'Terms to show with login (Supports HTML)', 'mobile-bankid-integration' ); ?></label>
    197         <textarea name="mobile-bankid-integration-terms" id="mobile-bankid-integration-terms" rows="5"><?php // phpcs:ignore -- PHP tag needed to prevent whitespace in textarea.
    198         echo wp_kses(
    199             get_option( 'mobile_bankid_integration_terms', __( 'By logging in using Mobile BankID you agree to our Terms of Service and Privacy Policy.', 'mobile-bankid-integration' ) ),
    200             array(
    201                 'a'      => array(
    202                     'href'   => array(),
    203                     'title'  => array(),
    204                     'target' => array(),
    205                 ),
    206                 'br'     => array(),
    207                 'em'     => array(),
    208                 'strong' => array(),
    209                 'i'      => array(),
    210             )
    211         );
    212         // phpcs:ignore -- PHP tag needed to prevent whitespace in textarea.?></textarea>
    213         <p class="description"><?php esc_html_e( 'Following HTML elements are supported: a, br, em, strong and i. All others will be escaped.', 'mobile-bankid-integration' ); ?></p>
    214     </div>
    215 </form>
    216 <button class="button button-primary" onclick="settingsSubmit()" id="mobile-bankid-integration-save"><?php esc_html_e( 'Save changes', 'mobile-bankid-integration' ); ?></button>
    217 <style>
    218     form {
    219         width: fit-content;
    220     }
    221     form .description {
    222         /* Line break when description is too long */
    223         max-width: 500px;
    224         word-break: break-word;
    225     }
    226     .form-group {
    227         margin-bottom: 1rem;
    228         box-sizing: border-box;
    229         width: 100%;
    230     }
    231     .form-group label {
    232         font-weight: bold;
    233         display: block;
    234         margin-bottom: 0.5rem;
    235     }
    236     .form-group input[type="text"],
    237     .form-group input[type="password"],
    238     .form-group textarea {
    239         width: 100%;
    240         padding: 0.5rem;
    241         border: 1px solid #ddd;
    242         border-radius: 0.25rem;
    243         background-color: #fff;
    244         font-size: 1rem;
    245         line-height: 1.2;
    246         -webkit-appearance: none;
    247         -moz-appearance: none;
    248         appearance: none;
    249         resize: none;
    250     }
    251     .form-group select {
    252         width: 100%;
    253         padding: 0.5rem;
    254         border: 1px solid #ddd;
    255         border-radius: 0.25rem;
    256         background-color: #fff;
    257         font-size: 1rem;
    258         line-height: 1.2;
    259         -webkit-appearance: none;
    260         -moz-appearance: none;
    261         appearance: none;
    262     }
    263 </style>
    264 <script>
    265     function settingsSubmit() {
    266         document.getElementById("mobile-bankid-integration-save").innerHTML = "<?php esc_html_e( 'Saving...', 'mobile-bankid-integration' ); ?>";
    267         document.getElementById("mobile-bankid-integration-save").disabled = true;
    268         var wplogin = document.getElementById("mobile-bankid-integration-wplogin").value;
    269         var registration = document.getElementById("mobile-bankid-integration-registration").value;
    270         var terms = document.getElementById("mobile-bankid-integration-terms").value;
    271        
    272         var xhr = new XMLHttpRequest();
    273         xhr.open("POST", "<?php echo esc_url( rest_url( 'mobile-bankid-integration/v1/settings' ) ) . '/settings'; ?>", true);
    274         xhr.setRequestHeader("X-WP-Nonce", "<?php echo esc_attr( wp_create_nonce( 'wp_rest' ) ); ?>");
    275 
    276         xhr.onload = function() {
    277             if (this.status == 200) {
    278                 document.getElementById("mobile-bankid-integration-save").innerHTML = "<?php esc_html_e( 'Saved!', 'mobile-bankid-integration' ); ?>";
    279                 setTimeout(function() {
    280                     document.getElementById("mobile-bankid-integration-save").innerHTML = "<?php esc_html_e( 'Save changes', 'mobile-bankid-integration' ); ?>";
    281                     document.getElementById("mobile-bankid-integration-save").disabled = false;
    282                 }, 2000);
    283             } else {
    284                 response = JSON.parse(this.responseText);
    285                 alert(mobile_bankid_integration_setup_localization.configuration_failed + response['message']);
    286             }
    287         }
    288 
    289         formdata = new FormData();
    290         formdata.append("wplogin", wplogin);
    291         formdata.append("registration", registration);
    292         formdata.append("terms", terms);
    293 
    294         xhr.send(formdata);
    295     }
    296 </script>
     167
     168            <h2><?php esc_html_e( 'Login page', 'mobile-bankid-integration' ); ?></h2>
     169            <div class="form-group">
     170                <label for="mobile-bankid-integration-wplogin"><?php esc_html_e( 'Show BankID on login page', 'mobile-bankid-integration' ); ?></label>
     171                <select name="mobile-bankid-integration-wplogin" id="mobile-bankid-integration-wplogin">
     172                    <option value="as_alternative"
     173                    <?php
     174                    if ( get_option( 'mobile_bankid_integration_wplogin' ) === 'as_alternative' ) {
     175                        echo 'selected';
     176                    }
     177                    ?>
     178                                                    ><?php esc_html_e( 'Show as alternative to traditional login', 'mobile-bankid-integration' ); ?></option>
     179                    <option value="hide"
     180                    <?php
     181                    if ( get_option( 'mobile_bankid_integration_wplogin' ) === 'hide' ) {
     182                        echo 'selected';
     183                    }
     184                    ?>
     185                                            ><?php esc_html_e( 'Do not show at all', 'mobile-bankid-integration' ); ?></option>
     186                </select>
     187            </div><br>
     188            <div class="form-group">
     189                <label for="mobile-bankid-integration-registration"><?php esc_html_e( 'Allow registration with BankID', 'mobile-bankid-integration' ); ?></label>
     190                <select name="mobile-bankid-integration-registration" id="mobile-bankid-integration-registration">
     191                    <option value="yes"
     192                    <?php
     193                    if ( get_option( 'mobile_bankid_integration_registration' ) === 'yes' ) {
     194                        echo 'selected';
     195                    }
     196                    ?>
     197                                        ><?php esc_html_e( 'Yes', 'mobile-bankid-integration' ); ?></option>
     198                    <option value="no"
     199                    <?php
     200                    if ( get_option( 'mobile_bankid_integration_registration' ) === 'no' ) {
     201                        echo 'selected';
     202                    }
     203                    ?>
     204                                        ><?php esc_html_e( 'No', 'mobile-bankid-integration' ); ?></option>
     205                </select>
     206                <p class="description"><?php esc_html_e( 'This setting does not affect, nor is affected by, the native "Allow registration" setting.', 'mobile-bankid-integration' ); ?></p>
     207            </div>
     208            <div class="form-group">
     209                <label for="mobile-bankid-integration-terms"><?php esc_html_e( 'Terms to show with login (Supports HTML)', 'mobile-bankid-integration' ); ?></label>
     210                <textarea name="mobile-bankid-integration-terms" id="mobile-bankid-integration-terms" rows="5"><?php // phpcs:ignore -- PHP tag needed to prevent whitespace in textarea.
     211                                                                                                                echo wp_kses(
     212                                                                                                                    get_option( 'mobile_bankid_integration_terms', __( 'By logging in using Mobile BankID you agree to our Terms of Service and Privacy Policy.', 'mobile-bankid-integration' ) ),
     213                                                                                                                    array(
     214                                                                                                                        'a'      => array(
     215                                                                                                                            'href'   => array(),
     216                                                                                                                            'title'  => array(),
     217                                                                                                                            'target' => array(),
     218                                                                                                                        ),
     219                                                                                                                        'br'     => array(),
     220                                                                                                                        'em'     => array(),
     221                                                                                                                        'strong' => array(),
     222                                                                                                                        'i'      => array(),
     223                                                                                                                    )
     224                                                                                                                );
     225                                                                                                                // phpcs:ignore -- PHP tag needed to prevent whitespace in textarea.
     226                                                                                                                ?></textarea>
     227                <p class="description"><?php esc_html_e( 'Following HTML elements are supported: a, br, em, strong and i. All others will be escaped.', 'mobile-bankid-integration' ); ?></p>
     228            </div>
     229        </form>
     230        <button class="button button-primary" onclick="settingsSubmit()" id="mobile-bankid-integration-save"><?php esc_html_e( 'Save changes', 'mobile-bankid-integration' ); ?></button>
     231        <style>
     232            form {
     233                width: fit-content;
     234            }
     235
     236            form .description {
     237                /* Line break when description is too long */
     238                max-width: 500px;
     239                word-break: break-word;
     240            }
     241
     242            .form-group {
     243                margin-bottom: 1rem;
     244                box-sizing: border-box;
     245                width: 100%;
     246            }
     247
     248            .form-group label {
     249                font-weight: bold;
     250                display: block;
     251                margin-bottom: 0.5rem;
     252            }
     253
     254            .form-group input[type="text"],
     255            .form-group input[type="password"],
     256            .form-group textarea {
     257                width: 100%;
     258                padding: 0.5rem;
     259                border: 1px solid #ddd;
     260                border-radius: 0.25rem;
     261                background-color: #fff;
     262                font-size: 1rem;
     263                line-height: 1.2;
     264                -webkit-appearance: none;
     265                -moz-appearance: none;
     266                appearance: none;
     267                resize: none;
     268            }
     269
     270            .form-group select {
     271                width: 100%;
     272                padding: 0.5rem;
     273                border: 1px solid #ddd;
     274                border-radius: 0.25rem;
     275                background-color: #fff;
     276                font-size: 1rem;
     277                line-height: 1.2;
     278                -webkit-appearance: none;
     279                -moz-appearance: none;
     280                appearance: none;
     281            }
     282        </style>
     283        <script>
     284            function settingsSubmit() {
     285                document.getElementById("mobile-bankid-integration-save").innerHTML = "<?php esc_html_e( 'Saving...', 'mobile-bankid-integration' ); ?>";
     286                document.getElementById("mobile-bankid-integration-save").disabled = true;
     287                var wplogin = document.getElementById("mobile-bankid-integration-wplogin").value;
     288                var registration = document.getElementById("mobile-bankid-integration-registration").value;
     289                var terms = document.getElementById("mobile-bankid-integration-terms").value;
     290
     291                var xhr = new XMLHttpRequest();
     292                xhr.open("POST", "<?php echo esc_url( rest_url( 'mobile-bankid-integration/v1/settings' ) ) . '/settings'; ?>", true);
     293                xhr.setRequestHeader("X-WP-Nonce", "<?php echo esc_attr( wp_create_nonce( 'wp_rest' ) ); ?>");
     294
     295                xhr.onload = function() {
     296                    if (this.status == 200) {
     297                        document.getElementById("mobile-bankid-integration-save").innerHTML = "<?php esc_html_e( 'Saved!', 'mobile-bankid-integration' ); ?>";
     298                        setTimeout(function() {
     299                            document.getElementById("mobile-bankid-integration-save").innerHTML = "<?php esc_html_e( 'Save changes', 'mobile-bankid-integration' ); ?>";
     300                            document.getElementById("mobile-bankid-integration-save").disabled = false;
     301                        }, 2000);
     302                    } else {
     303                        response = JSON.parse(this.responseText);
     304                        alert(mobile_bankid_integration_setup_localization.configuration_failed + response['message']);
     305                    }
     306                }
     307
     308                formdata = new FormData();
     309                formdata.append("wplogin", wplogin);
     310                formdata.append("registration", registration);
     311                formdata.append("terms", terms);
     312
     313                xhr.send(formdata);
     314            }
     315        </script>
    297316        <?php
    298317    }
     
    344363                margin-left: 5px;
    345364            }
     365
    346366            .mobile-bankid-integration-integration {
    347367                display: flex;
     
    353373                max-width: 300px;
    354374            }
     375
    355376            .mobile-bankid-integration-integration__logo {
    356377                display: flex;
     
    359380                margin-bottom: 20px;
    360381            }
     382
    361383            .mobile-bankid-integration-integration__logo img {
    362384                max-width: 100%;
    363385                height: 50px;
    364386            }
     387
    365388            .mobile-bankid-integration-integration__title {
    366389                margin-top: 0;
    367390            }
     391
    368392            .mobile-bankid-integration-integration__description {
    369393                margin-bottom: 20px;
    370394            }
     395
    371396            .coming-soon {
    372397                background: #e5e5e5;
     
    396421                color: rgb(201, 97, 152);
    397422            }
    398         <?php
     423
     424            <?php
    399425    }
    400426}
  • mobile-bankid-integration/trunk/includes/class-activation.php

    r3070283 r3084002  
    5252        // Delete DB table.
    5353        global $wpdb;
    54         $wpdb->query( $wpdb->prepare( 'DROP TABLE IF EXISTS %s', $wpdb->prefix . 'mobile_bankid_integration_auth_responses' ) ); // phpcs:ignore -- Safe query.
     54        $table_name = $wpdb->prefix . 'mobile_bankid_integration_auth_responses';
     55        $wpdb->query( "DROP TABLE IF EXISTS `{$table_name}`" );
    5556
    5657        // Delete session secret.
  • mobile-bankid-integration/trunk/includes/class-core.php

    r3070283 r3084002  
    44defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    55
    6 use Dimafe6\BankID\Service\BankIDService;
     6use LJSystem\BankID\BankID;
    77
    88new Core();
     
    2424     * BankIDService object.
    2525     *
    26      * @var BankIDService|null
    27      */
    28     private BankIDService $bankid_service;
     26     * @var BankID|null
     27     */
     28    private BankID $bankid_service;
    2929
    3030    /**
     
    4646     */
    4747    public function init() {
    48         if ( get_option( 'mobile_bankid_integration_endpoint' ) && get_option( 'mobile_bankid_integration_certificate' ) && get_option( 'mobile_bankid_integration_password' ) ) {
     48        if ( get_option( 'mobile_bankid_integration_env' ) && get_option( 'mobile_bankid_integration_certificate' ) && get_option( 'mobile_bankid_integration_password' ) ) {
    4949            $this->create_bankid_service();
    5050            do_action( 'mobile_bankid_integration_init' );
     
    5858     */
    5959    private function create_bankid_service() {
    60         $this->bankid_service = new BankIDService(
    61             get_option( 'mobile_bankid_integration_endpoint' ),
    62             $_SERVER['REMOTE_ADDR'], // phpcs:ignore -- Does always exist and isn't user input.
    63             array(
    64                 'verify' => false,
    65                 'cert'   => array( get_option( 'mobile_bankid_integration_certificate' ), get_option( 'mobile_bankid_integration_password' ) ),
    66             )
    67         );
     60        if ( 'test' === get_option( 'mobile_bankid_integration_env' ) ) {
     61            $this->bankid_service = new BankID();
     62        } else {
     63            $this->bankid_service = new BankID(
     64                BankID::ENVIRONMENT_PRODUCTION,
     65                get_option( 'mobile_bankid_integration_certificate' ),
     66                MOBILE_BANKID_INTEGRATION_PLUGIN_DIR . 'assets/certs/prod_cacert.cer',
     67                null,
     68                get_option( 'mobile_bankid_integration_password' )
     69            );
     70        }
    6871    }
    6972
     
    7174     * Get BankIDService object.
    7275     *
    73      * @return BankIDService
     76     * @return BankID
    7477     */
    7578    public function get_bankid_service() {
     
    8790        }
    8891
    89         $response = $this->bankid_service->getAuthResponse();
     92        $response = $this->bankid_service->authenticate( $_SERVER['REMOTE_ADDR'] ); // phpcs:ignore
    9093        // Save the response in DB.
    91         $this->saveAuthResponseToDB( $response->orderRef, $response ); // phpcs:ignore -- We cannot modify $orderRef to snake_case.
     94        $this->saveAuthResponseToDB( $response->getOrderRef(), $response->getBody() );
    9295        return array(
    93             'orderRef'       => $response->orderRef, // phpcs:ignore -- We cannot modify $orderRef to snake_case.
    94             'autoStartToken' => $response->autoStartToken, // phpcs:ignore -- We cannot modify $autoStartToken to snake_case.
     96            'orderRef'       => $response->getOrderRef(),
     97            'autoStartToken' => $response->getAutoStartToken(),
    9598        );
    9699    }
     
    115118        return array(
    116119            'time_created' => $response->time_created,
    117             'response'     => $this->convert_json_order_response_to_array( $response->response ),
     120            'response'     => json_decode( $response->response, true ),
    118121            'orderRef'     => $response->orderRef, // phpcs:ignore -- We shall not modify $orderRef to snake_case.
    119122        );
     
    134137            array(
    135138                'time_created' => time(),
    136                 'response'     => $this->convert_order_response_to_json( $response ),
     139                'response'     => wp_json_encode( $response ),
    137140                'orderRef'     => $orderRef, // phpcs:ignore -- We shall not modify $orderRef to snake_case.
    138141            )
     
    243246        $session->destroy();
    244247    }
    245 
    246     /**
    247      * Convert Dimafe6\BankID\OrderResponse to json.
    248      *
    249      * @param Dimafe6\BankID\OrderResponse $order_response Order response.
    250      * @return array
    251      * @since 1.0.1
    252      */
    253     private function convert_order_response_to_json( $order_response ): string {
    254         // Make sure that $order_response is an instance of Dimafe6\BankID\Model\OrderResponse.
    255         if ( ! $order_response instanceof \Dimafe6\BankID\Model\OrderResponse ) {
    256             return array();
    257         }
    258         $array = array(
    259             'orderRef'       => $order_response->orderRef, // phpcs:ignore -- We shall not modify $orderRef to snake_case.
    260             'autoStartToken' => $order_response->autoStartToken // phpcs:ignore -- We shall not modify $autoStartToken to snake_case.
    261         );
    262         // If property qrStartToken exists, add it to the array.
    263         if ( property_exists( $order_response, 'qrStartToken' ) ) {
    264             $array['qrStartToken'] = $order_response->qrStartToken; // phpcs:ignore -- We shall not modify $qrStartToken to snake_case.
    265         }
    266         // If property qrStartSecret exists, add it to the array.
    267         if ( property_exists( $order_response, 'qrStartSecret' ) ) {
    268             $array['qrStartSecret'] = $order_response->qrStartSecret; // phpcs:ignore -- We shall not modify $qrStartSecret to snake_case.
    269         }
    270 
    271         $json = wp_json_encode( $array );
    272 
    273         return $json ? $json : '{}';
    274     }
    275 
    276     /**
    277      * Convert JSON OrderResponse to array after checking if it is valid.
    278      *
    279      * @param string $json JSON OrderResponse.
    280      * @throws \Exception If JSON or data is not valid.
    281      * @return array
    282      * @since 1.0.1
    283      */
    284     private function convert_json_order_response_to_array( $json ): array {
    285         // Check each property in the JSON OrderResponse against [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    286         // If any of the properties is not valid, return an empty array.
    287         $json = json_decode( $json, true );
    288         if ( ! is_array( $json ) ) {
    289             throw new \Exception( 'Invalid JSON' );
    290         }
    291         foreach ( $json as $key => $value ) {
    292             if ( ! preg_match( '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $value ) ) {
    293                 throw new \Exception( 'Data is not valid' );
    294             }
    295         }
    296         return $json;
    297     }
    298248}
  • mobile-bankid-integration/trunk/includes/class-session.php

    r3070283 r3084002  
    107107     */
    108108    public static function install() {
     109        // Include the WordPress filesystem API functions.
     110        require_once ABSPATH . 'wp-admin/includes/file.php';
     111        WP_Filesystem();
     112
    109113        // Check if a secret already exists.
    110114        if ( defined( 'MOBILE_BANKID_INTEGRATION_SESSION_SECRET' ) || get_option( 'mobile_bankid_integration_session_secret' ) ) {
     
    148152     */
    149153    public static function uninstall() {
     154        // Include the WordPress filesystem API functions.
     155        require_once ABSPATH . 'wp-admin/includes/file.php';
     156        WP_Filesystem();
     157
    150158        // Check if a secret exists.
    151159        if ( ! defined( 'MOBILE_BANKID_INTEGRATION_SESSION_SECRET' ) && ! get_option( 'mobile_bankid_integration_session_secret' ) ) {
  • mobile-bankid-integration/trunk/includes/settings/class-api.php

    r3070283 r3084002  
    7878    public function configuration() {
    7979        // Get params.
    80         $endpoint    = isset( $_POST['endpoint'] ) ? sanitize_text_field( wp_unslash( $_POST['endpoint'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification
    8180        $certificate = isset( $_POST['certificate'] ) ? sanitize_text_field( wp_unslash( $_POST['certificate'] ) ) : null; // phpcs:ignore WordPress.Security.NonceVerification
    8281        $password    = isset( $_POST['password'] ) ? $_POST['password'] : null; // phpcs:ignore
    8382
    84         // Check endpoint domain is one of the allowed endpoints.
    85         if ( ! isset( $endpoint ) || ! preg_match( '/^https:\/\/appapi2\.(test\.)?bankid\.com\/rp\/v5\.1$/', $endpoint ) ) {
    86             return new \WP_Error( 'invalid_endpoint', esc_html__( 'API Endpoint is not valid.', 'mobile-bankid-integration' ), array( 'status' => 400 ) );
    87         }
    88 
    8983        // Check that submitted certificate is valid and exists.
    90         if ( ! isset( $certificate ) || ! preg_match( '/^\/([A-z0-9-_+]+\/)*([A-z0-9]+\.(p12))$/', $certificate ) ) {
     84        if ( ! isset( $certificate ) || ! preg_match( '/^\/([A-z0-9-_+]+\/)*([A-z0-9]+\.(pem))$/', $certificate ) ) {
    9185            return new \WP_Error( 'invalid_certificate', esc_html__( 'Certificate is not valid.', 'mobile-bankid-integration' ), array( 'status' => 400 ) );
    9286        }
     
    111105
    112106        // Update the WP options.
     107        update_option( 'mobile_bankid_integration_env', 'production' );
    113108        update_option( 'mobile_bankid_integration_certificate', $certificate );
    114         update_option( 'mobile_bankid_integration_endpoint', $endpoint );
    115109        update_option( 'mobile_bankid_integration_password', $password );
    116110
     
    127121     */
    128122    public function auto_configure_test_env() {
    129         // Check if certificate exists.
    130         $certificate_dir = MOBILE_BANKID_INTEGRATION_PLUGIN_DIR . 'assets/certs/';
    131         if ( ! file_exists( $certificate_dir . 'testenv.p12' ) ) {
    132             return new \WP_Error( 'certificate_does_not_exist', esc_html__( 'Certificate does not exist.', 'mobile-bankid-integration' ), array( 'status' => 400 ) );
    133         }
    134 
    135         // Update the WP options.
    136         update_option( 'mobile_bankid_integration_certificate', $certificate_dir . 'testenv.p12' );
    137         update_option( 'mobile_bankid_integration_endpoint', 'https://appapi2.test.bankid.com/rp/v5.1/' );
    138         update_option( 'mobile_bankid_integration_password', 'qwerty123' );
     123        // Update the WP option.
     124        update_option( 'mobile_bankid_integration_env', 'test' );
     125        update_option( 'mobile_bankid_integration_certificate', 'test-env' );
     126        update_option( 'mobile_bankid_integration_password', 'test-env' );
    139127
    140128        return true;
  • mobile-bankid-integration/trunk/includes/settings/views/setup-configuration.php

    r3070283 r3084002  
    77<form autocomplete="off">
    88    <input autocomplete="false" type="text" name="mobile_bankid_integration_setup" value="1" style="display: none;">
    9     <h2><?php esc_html_e( 'Auto-configuration', 'mobile-bankid-integration' ); ?></h2>
     9    <h2><?php esc_html_e( 'Test environment', 'mobile-bankid-integration' ); ?></h2>
    1010    <div class="form-group">
    1111        <label for="mobile-bankid-integration-testenv"><?php esc_html_e( 'Auto-configure for test enviroment', 'mobile-bankid-integration' ); ?></label>
     
    1313        <p class="description"><?php esc_html_e( 'This will configure the plugin for the test enviroment. This is only recommended if you are testing the plugin.', 'mobile-bankid-integration' ); ?></p>
    1414    </div>
    15     <h2><?php esc_html_e( 'Manual configuration', 'mobile-bankid-integration' ); ?></h2>
     15    <h2><?php esc_html_e( 'Production environment', 'mobile-bankid-integration' ); ?></h2>
    1616    <div class="form-group">
    17         <label for="mobile-bankid-integration-endpoint"><?php esc_html_e( 'API Endpoint', 'mobile-bankid-integration' ); ?></label>
    18         <input type="url" id="mobile-bankid-integration-endpoint">
    19         <p class="description">
    20         <?php
    21         printf(
    22             /* translators: %1$s Production API Endpoint, %1$s Test enviroment API Endpoint */
    23             esc_html__( 'The API Endpoint is normally %1$s for production and %2$s for test environment.', 'mobile-bankid-integration' ),
    24             '<code>https://appapi2.bankid.com/rp/v5.1</code>',
    25             '<code>https://appapi2.test.bankid.com/rp/v5.1</code>'
    26         )
    27         ?>
    28             </p>
    29     </div>
    30     <div class="form-group">
    31         <label for="mobile-bankid-integration-certificate"><?php esc_html_e( 'Absolute path to certificate', 'mobile-bankid-integration' ); ?></label>
    32         <input type="text" id="mobile-bankid-integration-certificate" placeholder="<?php /* translators: Placeholder path to .p12 certificate. */ esc_attr_e( '/path/to/certificate.p12', 'mobile-bankid-integration' ); ?>">
     17        <label for="mobile-bankid-integration-certificate"><?php esc_html_e( 'Absolute path to certificate (.pem)', 'mobile-bankid-integration' ); ?></label>
     18        <input type="text" id="mobile-bankid-integration-certificate" placeholder="<?php /* translators: Placeholder path to .pem certificate. */ esc_attr_e( '/path/to/certificate.pem', 'mobile-bankid-integration' ); ?>">
    3319        <p class="description"><?php esc_html_e( 'Please note that the certificate shall, for security reasons, not be placed within any publicly accessible directory.', 'mobile-bankid-integration' ); ?></p>
    3420    </div>
  • mobile-bankid-integration/trunk/includes/settings/views/setup.php

    r3070283 r3084002  
    22/**
    33 * Setup view on activation.
    4  * 
     4 *
    55 * @package mobile-bankid-integration
    66 */
    77
    8  defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
     8defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
    99
    1010$step = isset( $_GET['step'] ) ? $_GET['step'] : 1; // phpcs:ignore
  • mobile-bankid-integration/trunk/includes/wp-login/class-api.php

    r3070283 r3084002  
    7979        $time_since_auth = $time - $db_row['time_created'];
    8080
    81         $status = $instance->get_bankid_service()->collectResponse( $auth_response['orderRef'] );
     81        $status = $instance->get_bankid_service()->collect( $_GET['orderRef'] ); // phpcs:ignore
    8282
    83         if ( 'failed' === $status->status ) {
     83        $status = $status->getBody();
     84
     85        if ( 'failed' === $status['status'] ) {
    8486            $instance->deleteAuthResponseFromDB( $order_ref );
    8587            $return = array(
     
    8890                'time_since_auth' => $time_since_auth,
    8991                'status'          => 'failed',
    90                 'hintCode'        => $status->hintCode, // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     92                'hintCode'        => $status['hintCode'], // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    9193            );
    9294            return $return;
    9395        }
    9496
    95         if ( 'complete' === $status->status ) {
     97        if ( 'complete' === $status['status'] ) {
    9698            $instance->deleteAuthResponseFromDB( $order_ref );
    97             if ( $this->sign_in_as_user_from_bankid( $status->completionData->user->personalNumber, $status->completionData->user->givenName, $status->completionData->user->surname ) === false ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     99            $create_user = $this->sign_in_as_user_from_bankid( $status['completionData']['user']['personalNumber'], $status['completionData']['user']['givenName'], $status['completionData']['user']['surname'] );
     100            if ( false === $create_user ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    98101                return array(
    99102                    'qr'              => null,
     
    117120            'orderRef'        => $order_ref,
    118121            'time_since_auth' => $time_since_auth,
    119             'status'          => $status->status,
    120             'hintCode'        => $status->hintCode ?? '', // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
     122            'status'          => $status['status'],
     123            'hintCode'        => $status['hintCode'] ?? '', // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
    121124        );
    122125    }
     
    158161            $user_id = $user->ID;
    159162        }
     163        wp_clear_auth_cookie();
    160164        wp_set_current_user( $user_id );
    161165        wp_set_auth_cookie( $user_id );
  • mobile-bankid-integration/trunk/includes/wp-login/class-login.php

    r3070283 r3084002  
    3333     * @return void
    3434     */
    35     public function login_button( $redirect = null ) {
    36         if ( null === $redirect ) {
     35    public function login_button( $redirect = '' ) {
     36        if ( empty( $redirect ) ) {
    3737            $redirect = '/wp-admin/';
    3838        }
  • mobile-bankid-integration/trunk/mobile-bankid-integration.php

    r3070284 r3084002  
    33Plugin Name: Mobile BankID Integration
    44Description: A plugin that allows you to integrate Mobile BankID with your WordPress site.
    5 Version: 1.1.1
     5Version: 1.2
    66Author: Jamie Blomerus
    77Author URI: https://github.com/jamieblomerus
     
    1414
    1515// Define constants.
    16 define( 'MOBILE_BANKID_INTEGRATION_VERSION', '1.1.1' );
     16define( 'MOBILE_BANKID_INTEGRATION_VERSION', '1.2' );
    1717define( 'MOBILE_BANKID_INTEGRATION_PLUGIN_FILE', __FILE__ );
    1818define( 'MOBILE_BANKID_INTEGRATION_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
  • mobile-bankid-integration/trunk/readme.txt

    r3070289 r3084002  
    44Requires at least: 5.2
    55Tested up to: 6.5
    6 Stable tag: 1.1.1
     6Stable tag: 1.2
    77Requires PHP: 7.2
    88License: GPLv3 or later
     
    1515This is a plugin that allows you to integrate Mobile BankID with your WordPress site and use it for the following:
    1616
    17 - Authenticate users (as an alternative to username and password)
    18 - Perform age checks of customers (Woocommerce)
    19 - Tailor it to your needs with extensions (Very developer friendly)
    20 
     17    - Authenticate users (as an alternative to username and password)
     18    - Perform age checks of customers (Woocommerce)
     19    - Tailor it to your needs with extensions (Very developer friendly)
    2120And more.
    2221
     
    4948== Changelog ==
    5049
     50= 1.2 =
     51* Added support for API version 6.0 while removing support for API version 5.1.
     52* Fixed some errors being thrown on activation and deactivation of the plugin.
     53
    5154= 1.1.1 =
    5255* Changed the license of the plugin to GPLv3 or later.
     
    7275== Upgrade Notice ==
    7376
     77= 1.2 =
     78Major update. Requires total reinstallation of the plugin.
     79
    7480= 1.1.1 =
    7581This update changes the license of the plugin to GPLv3 or later. And fixes a minor problem with translations.
  • mobile-bankid-integration/trunk/vendor/autoload.php

    r3070283 r3084002  
    2323require_once __DIR__ . '/composer/autoload_real.php';
    2424
    25 return ComposerAutoloaderInitf1ee947fd74be7d3fc6011c144f5a4e4::getLoader();
     25return ComposerAutoloaderInit841ba1d7db30a331995bbf9dcd7573e3::getLoader();
  • mobile-bankid-integration/trunk/vendor/composer/autoload_classmap.php

    r3070283 r3084002  
    88return array(
    99    'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
    10     'Dimafe6\\BankID\\Model\\AbstractResponseModel' => $vendorDir . '/dimafe6/bank-id/src/Model/AbstractResponseModel.php',
    11     'Dimafe6\\BankID\\Model\\CertInfo' => $vendorDir . '/dimafe6/bank-id/src/Model/CertInfo.php',
    12     'Dimafe6\\BankID\\Model\\CollectResponse' => $vendorDir . '/dimafe6/bank-id/src/Model/CollectResponse.php',
    13     'Dimafe6\\BankID\\Model\\CompletionData' => $vendorDir . '/dimafe6/bank-id/src/Model/CompletionData.php',
    14     'Dimafe6\\BankID\\Model\\DeviceInfo' => $vendorDir . '/dimafe6/bank-id/src/Model/DeviceInfo.php',
    15     'Dimafe6\\BankID\\Model\\OrderResponse' => $vendorDir . '/dimafe6/bank-id/src/Model/OrderResponse.php',
    16     'Dimafe6\\BankID\\Model\\UserInfo' => $vendorDir . '/dimafe6/bank-id/src/Model/UserInfo.php',
    17     'Dimafe6\\BankID\\Service\\BankIDService' => $vendorDir . '/dimafe6/bank-id/src/Service/BankIDService.php',
    1810    'GuzzleHttp\\BodySummarizer' => $vendorDir . '/guzzlehttp/guzzle/src/BodySummarizer.php',
    1911    'GuzzleHttp\\BodySummarizerInterface' => $vendorDir . '/guzzlehttp/guzzle/src/BodySummarizerInterface.php',
     
    10294    'GuzzleHttp\\TransferStats' => $vendorDir . '/guzzlehttp/guzzle/src/TransferStats.php',
    10395    'GuzzleHttp\\Utils' => $vendorDir . '/guzzlehttp/guzzle/src/Utils.php',
     96    'LJSystem\\BankID\\BankID' => $vendorDir . '/ljsystem/bankid/src/BankID.php',
     97    'LJSystem\\BankID\\BankIDResponse' => $vendorDir . '/ljsystem/bankid/src/BankIDResponse.php',
    10498    'Personnummer\\Personnummer' => $vendorDir . '/personnummer/personnummer/src/Personnummer.php',
    10599    'Personnummer\\PersonnummerException' => $vendorDir . '/personnummer/personnummer/src/PersonnummerException.php',
  • mobile-bankid-integration/trunk/vendor/composer/autoload_psr4.php

    r3070283 r3084002  
    1212    'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
    1313    'Personnummer\\' => array($vendorDir . '/personnummer/personnummer/src'),
     14    'LJSystem\\BankID\\' => array($vendorDir . '/ljsystem/bankid/src'),
    1415    'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'),
    1516    'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'),
    1617    'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'),
    17     'Dimafe6\\BankID\\' => array($vendorDir . '/dimafe6/bank-id/src'),
    1818);
  • mobile-bankid-integration/trunk/vendor/composer/autoload_real.php

    r3070283 r3084002  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitf1ee947fd74be7d3fc6011c144f5a4e4
     5class ComposerAutoloaderInit841ba1d7db30a331995bbf9dcd7573e3
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitf1ee947fd74be7d3fc6011c144f5a4e4', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit841ba1d7db30a331995bbf9dcd7573e3', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitf1ee947fd74be7d3fc6011c144f5a4e4', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit841ba1d7db30a331995bbf9dcd7573e3', 'loadClassLoader'));
    3030
    3131        require __DIR__ . '/autoload_static.php';
    32         call_user_func(\Composer\Autoload\ComposerStaticInitf1ee947fd74be7d3fc6011c144f5a4e4::getInitializer($loader));
     32        call_user_func(\Composer\Autoload\ComposerStaticInit841ba1d7db30a331995bbf9dcd7573e3::getInitializer($loader));
    3333
    3434        $loader->register(true);
    3535
    36         $filesToLoad = \Composer\Autoload\ComposerStaticInitf1ee947fd74be7d3fc6011c144f5a4e4::$files;
     36        $filesToLoad = \Composer\Autoload\ComposerStaticInit841ba1d7db30a331995bbf9dcd7573e3::$files;
    3737        $requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
    3838            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • mobile-bankid-integration/trunk/vendor/composer/autoload_static.php

    r3070283 r3084002  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitf1ee947fd74be7d3fc6011c144f5a4e4
     7class ComposerStaticInit841ba1d7db30a331995bbf9dcd7573e3
    88{
    99    public static $files = array (
     
    2525            'Personnummer\\' => 13,
    2626        ),
     27        'L' =>
     28        array (
     29            'LJSystem\\BankID\\' => 16,
     30        ),
    2731        'G' =>
    2832        array (
     
    3135            'GuzzleHttp\\' => 11,
    3236        ),
    33         'D' =>
    34         array (
    35             'Dimafe6\\BankID\\' => 15,
    36         ),
    3737    );
    3838
     
    5959            0 => __DIR__ . '/..' . '/personnummer/personnummer/src',
    6060        ),
     61        'LJSystem\\BankID\\' =>
     62        array (
     63            0 => __DIR__ . '/..' . '/ljsystem/bankid/src',
     64        ),
    6165        'GuzzleHttp\\Psr7\\' =>
    6266        array (
     
    7074        array (
    7175            0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src',
    72         ),
    73         'Dimafe6\\BankID\\' =>
    74         array (
    75             0 => __DIR__ . '/..' . '/dimafe6/bank-id/src',
    7676        ),
    7777    );
     
    7979    public static $classMap = array (
    8080        'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
    81         'Dimafe6\\BankID\\Model\\AbstractResponseModel' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/AbstractResponseModel.php',
    82         'Dimafe6\\BankID\\Model\\CertInfo' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/CertInfo.php',
    83         'Dimafe6\\BankID\\Model\\CollectResponse' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/CollectResponse.php',
    84         'Dimafe6\\BankID\\Model\\CompletionData' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/CompletionData.php',
    85         'Dimafe6\\BankID\\Model\\DeviceInfo' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/DeviceInfo.php',
    86         'Dimafe6\\BankID\\Model\\OrderResponse' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/OrderResponse.php',
    87         'Dimafe6\\BankID\\Model\\UserInfo' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Model/UserInfo.php',
    88         'Dimafe6\\BankID\\Service\\BankIDService' => __DIR__ . '/..' . '/dimafe6/bank-id/src/Service/BankIDService.php',
    8981        'GuzzleHttp\\BodySummarizer' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/BodySummarizer.php',
    9082        'GuzzleHttp\\BodySummarizerInterface' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/BodySummarizerInterface.php',
     
    173165        'GuzzleHttp\\TransferStats' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/TransferStats.php',
    174166        'GuzzleHttp\\Utils' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/Utils.php',
     167        'LJSystem\\BankID\\BankID' => __DIR__ . '/..' . '/ljsystem/bankid/src/BankID.php',
     168        'LJSystem\\BankID\\BankIDResponse' => __DIR__ . '/..' . '/ljsystem/bankid/src/BankIDResponse.php',
    175169        'Personnummer\\Personnummer' => __DIR__ . '/..' . '/personnummer/personnummer/src/Personnummer.php',
    176170        'Personnummer\\PersonnummerException' => __DIR__ . '/..' . '/personnummer/personnummer/src/PersonnummerException.php',
     
    223217    {
    224218        return \Closure::bind(function () use ($loader) {
    225             $loader->prefixLengthsPsr4 = ComposerStaticInitf1ee947fd74be7d3fc6011c144f5a4e4::$prefixLengthsPsr4;
    226             $loader->prefixDirsPsr4 = ComposerStaticInitf1ee947fd74be7d3fc6011c144f5a4e4::$prefixDirsPsr4;
    227             $loader->classMap = ComposerStaticInitf1ee947fd74be7d3fc6011c144f5a4e4::$classMap;
     219            $loader->prefixLengthsPsr4 = ComposerStaticInit841ba1d7db30a331995bbf9dcd7573e3::$prefixLengthsPsr4;
     220            $loader->prefixDirsPsr4 = ComposerStaticInit841ba1d7db30a331995bbf9dcd7573e3::$prefixDirsPsr4;
     221            $loader->classMap = ComposerStaticInit841ba1d7db30a331995bbf9dcd7573e3::$classMap;
    228222
    229223        }, null, ClassLoader::class);
  • mobile-bankid-integration/trunk/vendor/composer/installed.json

    r3070283 r3084002  
    152152            ],
    153153            "install-path": "../chillerlan/php-settings-container"
    154         },
    155         {
    156             "name": "dimafe6/bank-id",
    157             "version": "2.1.1",
    158             "version_normalized": "2.1.1.0",
    159             "source": {
    160                 "type": "git",
    161                 "url": "https://github.com/dimafe6/bank-id.git",
    162                 "reference": "2a47a361aac14c9ef98f3073f02bfe29fe2034e1"
    163             },
    164             "dist": {
    165                 "type": "zip",
    166                 "url": "https://api.github.com/repos/dimafe6/bank-id/zipball/2a47a361aac14c9ef98f3073f02bfe29fe2034e1",
    167                 "reference": "2a47a361aac14c9ef98f3073f02bfe29fe2034e1",
    168                 "shasum": ""
    169             },
    170             "require": {
    171                 "guzzlehttp/guzzle": "^7.0.1",
    172                 "php": ">=7.2.0 | 8.0.*"
    173             },
    174             "require-dev": {
    175                 "phpunit/phpunit": "5.7.* || 6.3.* || 9.5.*"
    176             },
    177             "time": "2021-12-16T12:43:27+00:00",
    178             "type": "library",
    179             "extra": {
    180                 "branch-alias": {
    181                     "dev-master": "2.0-dev"
    182                 }
    183             },
    184             "installation-source": "dist",
    185             "autoload": {
    186                 "psr-4": {
    187                     "Dimafe6\\BankID\\": "src"
    188                 }
    189             },
    190             "notification-url": "https://packagist.org/downloads/",
    191             "license": [
    192                 "MIT"
    193             ],
    194             "authors": [
    195                 {
    196                     "name": "Dmitry Feshchenko",
    197                     "email": "[email protected]"
    198                 },
    199                 {
    200                     "name": "Oleg Davudyuk",
    201                     "email": "[email protected]"
    202                 },
    203                 {
    204                     "name": "Anders Fajerson",
    205                     "email": "[email protected]"
    206                 },
    207                 {
    208                     "name": "Puggan",
    209                     "email": "[email protected]"
    210                 },
    211                 {
    212                     "name": "Sebastian Marcusson",
    213                     "email": "[email protected]"
    214                 }
    215             ],
    216             "description": "Library for Swedish BankID",
    217             "homepage": "https://github.com/dimafe6/bank-id",
    218             "keywords": [
    219                 "bank-id",
    220                 "dimafe6"
    221             ],
    222             "support": {
    223                 "issues": "https://github.com/dimafe6/bank-id/issues",
    224                 "source": "https://github.com/dimafe6/bank-id/tree/2.1.1"
    225             },
    226             "install-path": "../dimafe6/bank-id"
    227154        },
    228155        {
     
    559486            ],
    560487            "install-path": "../guzzlehttp/psr7"
     488        },
     489        {
     490            "name": "ljsystem/bankid",
     491            "version": "1.0",
     492            "version_normalized": "1.0.0.0",
     493            "source": {
     494                "type": "git",
     495                "url": "https://github.com/ljsystem/bankid.git",
     496                "reference": "2177dedf67b8b88771fc4821057d32736e011ec6"
     497            },
     498            "dist": {
     499                "type": "zip",
     500                "url": "https://api.github.com/repos/ljsystem/bankid/zipball/2177dedf67b8b88771fc4821057d32736e011ec6",
     501                "reference": "2177dedf67b8b88771fc4821057d32736e011ec6",
     502                "shasum": ""
     503            },
     504            "require": {
     505                "ext-json": "*",
     506                "guzzlehttp/guzzle": "^6.3 | ^7.0.1",
     507                "php": "^7.1 || ^8.0"
     508            },
     509            "time": "2023-07-18T09:23:19+00:00",
     510            "type": "library",
     511            "installation-source": "dist",
     512            "autoload": {
     513                "psr-4": {
     514                    "LJSystem\\BankID\\": "src"
     515                }
     516            },
     517            "notification-url": "https://packagist.org/downloads/",
     518            "license": [
     519                "MIT"
     520            ],
     521            "description": "Library for the Swedish BankID API",
     522            "support": {
     523                "issues": "https://github.com/ljsystem/bankid/issues",
     524                "source": "https://github.com/ljsystem/bankid/tree/1.0"
     525            },
     526            "install-path": "../ljsystem/bankid"
    561527        },
    562528        {
     
    857823        {
    858824            "name": "symfony/deprecation-contracts",
    859             "version": "v3.4.0",
    860             "version_normalized": "3.4.0.0",
     825            "version": "v3.5.0",
     826            "version_normalized": "3.5.0.0",
    861827            "source": {
    862828                "type": "git",
    863829                "url": "https://github.com/symfony/deprecation-contracts.git",
    864                 "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
    865             },
    866             "dist": {
    867                 "type": "zip",
    868                 "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
    869                 "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
     830                "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1"
     831            },
     832            "dist": {
     833                "type": "zip",
     834                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
     835                "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1",
    870836                "shasum": ""
    871837            },
     
    873839                "php": ">=8.1"
    874840            },
    875             "time": "2023-05-23T14:45:45+00:00",
     841            "time": "2024-04-18T09:32:20+00:00",
    876842            "type": "library",
    877843            "extra": {
    878844                "branch-alias": {
    879                     "dev-main": "3.4-dev"
     845                    "dev-main": "3.5-dev"
    880846                },
    881847                "thanks": {
     
    907873            "homepage": "https://symfony.com",
    908874            "support": {
    909                 "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0"
     875                "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0"
    910876            },
    911877            "funding": [
  • mobile-bankid-integration/trunk/vendor/composer/installed.php

    r3070283 r3084002  
    44        'pretty_version' => 'dev-trunk',
    55        'version' => 'dev-trunk',
    6         'reference' => 'b6f753d77e0b192f4f130b08324e4b00f9e9e273',
     6        'reference' => '7aedfae704fa281f38077e40019261b06e1964e7',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-trunk',
    1515            'version' => 'dev-trunk',
    16             'reference' => 'b6f753d77e0b192f4f130b08324e4b00f9e9e273',
     16            'reference' => '7aedfae704fa281f38077e40019261b06e1964e7',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
     
    3535            'type' => 'library',
    3636            'install_path' => __DIR__ . '/../chillerlan/php-settings-container',
    37             'aliases' => array(),
    38             'dev_requirement' => false,
    39         ),
    40         'dimafe6/bank-id' => array(
    41             'pretty_version' => '2.1.1',
    42             'version' => '2.1.1.0',
    43             'reference' => '2a47a361aac14c9ef98f3073f02bfe29fe2034e1',
    44             'type' => 'library',
    45             'install_path' => __DIR__ . '/../dimafe6/bank-id',
    4637            'aliases' => array(),
    4738            'dev_requirement' => false,
     
    7162            'type' => 'library',
    7263            'install_path' => __DIR__ . '/../guzzlehttp/psr7',
     64            'aliases' => array(),
     65            'dev_requirement' => false,
     66        ),
     67        'ljsystem/bankid' => array(
     68            'pretty_version' => '1.0',
     69            'version' => '1.0.0.0',
     70            'reference' => '2177dedf67b8b88771fc4821057d32736e011ec6',
     71            'type' => 'library',
     72            'install_path' => __DIR__ . '/../ljsystem/bankid',
    7373            'aliases' => array(),
    7474            'dev_requirement' => false,
     
    138138        ),
    139139        'symfony/deprecation-contracts' => array(
    140             'pretty_version' => 'v3.4.0',
    141             'version' => '3.4.0.0',
    142             'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf',
     140            'pretty_version' => 'v3.5.0',
     141            'version' => '3.5.0.0',
     142            'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1',
    143143            'type' => 'library',
    144144            'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
  • mobile-bankid-integration/trunk/vendor/symfony/deprecation-contracts/composer.json

    r3070283 r3084002  
    2626    "extra": {
    2727        "branch-alias": {
    28             "dev-main": "3.4-dev"
     28            "dev-main": "3.5-dev"
    2929        },
    3030        "thanks": {
Note: See TracChangeset for help on using the changeset viewer.