Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/ts.corals.io/corals-api/Corals/core/User/Hooks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/ts.corals.io/corals-api/Corals/core/User/Hooks/Users.php
<?php

namespace Corals\User\Hooks;


class Users
{
    public function add_cookie_consent()
    {

        $cookieConsent = \Settings::get('cookie_consent', true);
        if (!$cookieConsent) {
            return false;
        }

        $default_config = '
        {
            type: "opt-in",
            position: "bottom",
            palette: { "popup": { "background": "#383b75" }, "button": { "background": "#f1d600", padding: "5px 50px" } }
             
        }';
        $current_request = \Request::route()->getName();
        //$is_auth = in_array($current_request, ['login', 'register']) ? 'true' : 'false';
        $has_token = \Cookie::get('XSRF-TOKEN');;
        $consent_config = \Settings::get('cookie_consent_config', $default_config);
        echo '<script type="text/javascript">
               $(document).ready(function () {
                        
                     var consent_config = ' . $consent_config . ';
                     //var is_auth = "";
                     
                     var has_token = "' . $has_token . '";
                     
                    consent_config.onInitialise =  function (status) {
                      var type = this.options.type;
                      var didConsent = this.hasConsented();
                      if (type == "opt-in" && !didConsent  ) {
                        $("form button[type=submit]").attr("disabled","disabled");
                      }

                    };
                     consent_config.onStatusChange =  function(status, chosenBefore) {
                          var type = this.options.type;
                          var didConsent = this.hasConsented();
                          if (type == "opt-in") {
                                if(didConsent ){
                                    if(has_token){
                                       $("form button[type=submit]").attr("disabled",false);
                                    }else{
                                       site_reload(); 
                                    }
                            
                                }else{
                                    $("form button[type=submit]").attr("disabled","disabled");
                                }
                          }

                      }
                      
                      ;
                     window.cookieconsent.initialise(consent_config);
                        
                 });
        </script>';

        echo \Html::style('assets/corals/plugins/cookieconsent2/cookieconsent.min.css');
        echo \Html::script('assets/corals/plugins/cookieconsent2/cookieconsent.min.js');
        echo \Html::script('assets/corals/plugins/cookieconsent2/js.cookie.min.js');

    }
}


Spamworldpro Mini