Zen Cart Logo
Forums / General Questions / General Data Protection Rules GDPR

General Data Protection Rules GDPR

Views: 266,303

Results 61 to 80 of 177
20 May 2018, 10:36 AM
#61
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

General Data Protection Rules GDPR

@mesnitu - can you tell us how did you manage to handle the consent problem? How did you create the field that records user's consent value and date (the Privacy Checkbox thick). We are trying to achieve this in order to prove given consent from new customers as of 25 may.

10x

20 May 2018, 12:05 PM
#62
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

Adrian Ciocîrlan:

@mesnitu - can you tell us how did you manage to handle the consent problem? How did you create the field that records user's consent value and date (the Privacy Checkbox thick). We are trying to achieve this in order to prove given consent from new customers as of 25 may.

10x

I'm using the default zencart "Regulations->Confirm Privacy Notice During Account Creation Procedure"
But since that Confirm Privacy Notice is not registered anywhere , I had to create a table to save all records on create account and existent users.

CREATE TABLE `customers_gdpr` (
  `customers_id` int(11) NOT NULL,
  `customers_account_created_date` datetime DEFAULT NULL,
  `customers_accept_terms` tinyint(4) DEFAULT '0',
  `customers_accept_terms_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `customers_was_notify_date` datetime DEFAULT NULL,
  `customers_delete_account_request` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`customers_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

So if a user creates a account, he has to accept. If a existing user login he's notify and that notification is registers. If he accepts or not, really doen't matter. I just need to have something to show that the client was notify and is aware of that, etc,etc...

20 May 2018, 12:17 PM
#63
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

I just use the confirm privacy regulation at account creation and accept terms and conditions at the point of sale.

I do not think there is a need to keep a record that they accepted it as they cannot create an account without accepting it or place an order without accepting terms.

I did change the wording on the terms one to say accept and read terms and privacy policy. That should be proof enough for anyone.

20 May 2018, 12:25 PM
#64
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

DO NOT COPY AND PASTE, cause it will not work.
create a file at "auto_loader" folder, to load observer and init_scripts

$autoLoadConfig[190][] = array('autoType'=>'class',
			'loadFile'=>'observers/class.customer_gdpr.php');
	
$autoLoadConfig[190][] = array('autoType'=>'classInstantiate',
			'className'=>'CustomerGdpr',
			'objectName'=>'CustomerGdpr');

$autoLoadConfig[180][] = array('autoType'=>'init_script',
			'loadFile'=> 'init_customers_rgpd.php');

THE OBSERVER - It checks at create account and loging. Sends some emails, etc...

<?php 
/**
 * customerGdpr Class.
 * This class is used to manage customers RGPD compliance 
 *
 * @package classes
 */

class CustomerGdpr extends base {

    private $has_accepted = false;
    private $was_notify = false;
    private $was_notify_date = '';
    var $users_delete_request = '';
    

    function __construct() {

        global $zco_notifier;

        $notifyme = array();

        // if not redirects to account page
        $notifyme[] = 'NOTIFY_LOGIN_SUCCESS';
        // Now the customer can agree or not. Either way it was a record is inserted in DB 
        $notifyme[] = 'NOTIFY_HEADER_END_ACCOUNT';
        // Inserts privacy policy into DB at registration page
        $notifyme[] = 'NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD';

        $this->attach($this, $notifyme);

       if($_SESSION['customers_delete_account_request']==1) {
           $this->users_delete_request = true;
       }
    }

    /**
     * NOTIFY_LOGIN_SUCCESS
     * Verifica se o cliente já concordou com a RGPD.
    */
    public function updateNotifyLoginSuccess(&$callingClass, $notifier, $paramsArray) {
        global $db, $messageStack;

            if ($_SESSION['customer_rgpd'] =='' && $_SESSION['customer_rgpd_notified'] == '') {
                $customer_id =  $_SESSION['customer_id'];
               
                $customers_info = $db->Execute("SELECT customers_info_date_account_created FROM " . TABLE_CUSTOMERS_INFO . " WHERE customers_info_id=" . (int)$customer_id. ";");
                $sql = " SELECT * FROM ".TABLE_CUSTOMERS_GDPR." WHERE customers_id = :customers_id: ";
                $sql = $db->bindVars($sql , ':customers_id:', $_SESSION['customer_id'], 'integer');
                $res = $db->Execute($sql);
                if ($res->RecordCount() == 0) {
                    $sql = "INSERT INTO ".TABLE_CUSTOMERS_GDPR." VALUES (:customers_id:, :customers_account_created_date:, :customers_accept_terms:, :customers_accept_terms_date:, :customers_was_notify_date:, :customers_delete_account_request:)";
                    $sql = $db->bindVars($sql , ':customers_id:', $customer_id, 'integer');
                    $sql = $db->bindVars($sql, ':customers_account_created_date:', $customers_info->fields['customers_info_date_account_created'], 'date');
                    $sql = $db->bindVars($sql, ':customers_accept_terms:', '0', 'integer');
                    $sql = $db->bindVars($sql, ':customers_accept_terms_date:', 'NULL', 'string');
                    $sql = $db->bindVars($sql, ':customers_was_notify_date:', 'NOW()', 'noquotestring');
                    $sql = $db->bindVars($sql, ':customers_delete_account_request:', '0', 'integer');
                    $res = $db->Execute($sql);
                   
                    $_SESSION['customer_rgpd_notified'] = true;
                    //$messageStack->add_session('site_notifications', $this->displayRgpdMsg(), 'caution');
                }
                
            } elseif ($_SESSION['customer_rgpd'] =='0' && $_SESSION['customer_rgpd_notified'] !== '') {
                //$messageStack->add_session('site_notifications', $this->displayRgpdMsg(), 'caution');
            }
    }

	/**
	 * Inserir politica de privacidade no registo do cliente
	 */
    public function updateCreateAccountAddedCustomerRecord(&$callingClass, $notifier, $paramsArray) {

        global $db;

        $customer_id = $_SESSION['customer_id'];
       
        $sql = "INSERT INTO ".TABLE_CUSTOMERS_GDPR." VALUES (:customers_id:, :customers_account_created_date:, :customers_accept_terms:, :customers_accept_terms_date:, :customers_was_notify_date:, :customers_delete_account_request:)";
        $sql = $db->bindVars($sql , ':customers_id:', $customer_id, 'integer');
        $sql = $db->bindVars($sql, ':customers_account_created_date:', 'NOW()', 'noquotestring');
        $sql = $db->bindVars($sql, ':customers_accept_terms:', '1', 'integer');
        $sql = $db->bindVars($sql, ':customers_accept_terms_date:', 'NOW()', 'noquotestring');
        $sql = $db->bindVars($sql, ':customers_was_notify_date:', 'NOW()', 'noquotestring');
        $sql = $db->bindVars($sql, ':customers_delete_account_request:', '0', 'integer');
        $res = $db->Execute($sql); 

        unset($sql, $res);

    }

    
      // Notifier user account page
      public function updateHeaderEndAccount(&$callingClass, $notifier, $paramsArray) {

		global $db, $customer_newsletter_status;
		global $messageStack;
       
        $customer_id =  $_SESSION['customer_id'];

        if ( $_SESSION['customer_rgpd'] == '' ) {
                 
            if (isset($_POST) && ($_POST['privacy_conditions'] =='1')) {
                $_SESSION['customer_rgpd'] = true;
                $customers_info = $db->Execute("SELECT customers_info_date_account_created FROM " . TABLE_CUSTOMERS_INFO . " WHERE customers_info_id=" . (int)$customer_id. ";");

                $sql = " SELECT * FROM ".TABLE_CUSTOMERS_GDPR." WHERE customers_id = :customers_id: ";
                $sql = $db->bindVars($sql , ':customers_id:', $customer_id, 'integer');
                $res = $db->Execute($sql);


                if ($res->RecordCount() > 0) {
                    $sql_up = "UPDATE ".TABLE_CUSTOMERS_GDPR." SET customers_id = :customers_id:, customers_account_created_date= :customers_account_created_date:, customers_accept_terms = :customers_accept_terms:, customers_accept_terms_date = :customers_accept_terms_date:, customers_was_notify_date = :customers_was_notify_date: WHERE customers_id = :customers_id:";
                    $sql_up = $db->bindVars($sql_up , ':customers_id:', $customer_id, 'integer');
                    $sql_up = $db->bindVars($sql_up, ':customers_account_created_date:', $customers_info->fields['customers_info_date_account_created'], 'date');
                    $sql_up = $db->bindVars($sql_up, ':customers_accept_terms:', '1', 'integer');
                    $sql_up = $db->bindVars($sql_up, ':customers_accept_terms_date:', 'NOW()', 'noquotestring');
                    $sql_up = $db->bindVars($sql_up, ':customers_was_notify_date:', 'NOW()', 'noquotestring');
                   
                    $res_up = $db->Execute($sql_up);

                    $messageStack->add_session('site_notifications', 'Obrigado por Actualizar!', 'caution');
                } 
                //Send Emails
                $to_name = STORE_NAME;
                $to_address = EMAIL_FROM;
                $email_subject = "Cliente Aceita Politica de privacidade";
                $email_text = "------------------------------------------------------------"."\n";
                $email_text .= "O Cliente " .$customer_id." aceitou politica de privacidade"."\n";
                $email_text .= "-----------------------------------------------------------"."\n";
                $from_email_name = STORE_NAME;
                $from_email_address = EMAIL_FROM;
                $html_msg['EMAIL_MESSAGE_HTML'] = strip_tags($_POST['privacy_conditions']);
                zen_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $html_msg );
            }
            unset($sql, $res, $sql_up, $res_up,$_POST['privacy_conditions']);
        }
        
      
        //DELETE ACCOUNT 
        if (isset($_POST) && ($_POST['action'] == 'delete_customer_account')) {

            $_SESSION['customers_delete_account_request'] == '1';
            //Collect Customer Info
            $sql = "SELECT  customers_firstname, customers_lastname, customers_email_address, customers_email_format FROM ".TABLE_CUSTOMERS." WHERE customers_id = :customers_id:";
            $sql = $db->bindVars($sql , ':customers_id:', $customer_id, 'integer');
            $res = $db->Execute($sql);

            $customer_name = $res->fields['customers_firstname']. ' '. $res->fields['customers_lastname'];
            $email_address = $res->fields['customers_email_address'];

            //SEND MAIL TO CUSTOMER
            $to_name = $customer_name;
            $to_address = $email_address;
            $email_subject = "Pedido para Apagar a Conta na Livraria PromoBooks";
            $email_text = "Olá ".$customer_name." Recebemos um pedido para apagar a sua conta na Livraria PromoBooks"."\n";
            $email_text .= "Gostariamos que continuasse connosco, mas vamos proceder à eliminação da conta no prazo máximo de 20 dias"."\n\n";
            $email_text .= "Todos os dados serão eliminados da Loja Online."."\n";
            $email_text .= "Caso tenha efectuado encomendas, os dados relativos a facturação continuarão na LUNADIL UNIPESSOAL LDA, ao abrigo da lei portuguesa."."\n";
            $email_text .= "Se pensa que este email é um engano, ou tem outras questões, por favor entre em contacto connosco"."\n";
            $email_text .= "------------------------------------------------------"."\n\n";
            $from_email_name = STORE_NAME;
            $from_email_address = EMAIL_FROM;
            zen_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address );
                   
            $email_text_to_admin = "Pedido para apagar conta de ".$customer_name." com o ID:".$customer_id."  ";
            zen_mail(STORE_NAME, EMAIL_FROM, $email_subject , $email_text_to_admin , STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra');
              
            // Insere pedido na base de dados
            $sql_del_account = "UPDATE ".TABLE_CUSTOMERS_GDPR." SET customers_delete_account_request = :customers_delete_account_request: WHERE customers_id = :customers_id:";
            $sql_del_account = $db->bindVars($sql_del_account , ':customers_delete_account_request:', '1', 'integer');
            $sql_del_account = $db->bindVars($sql_del_account , ':customers_id:', $customer_id, 'integer');
            $res_del_account = $db->Execute($sql_del_account);
                    
        }

        //Informa cliente das sua subscrição em newsletter
        $sql = " SELECT customers_newsletter FROM ".TABLE_CUSTOMERS." WHERE customers_id = :customers_id: ";
        $sql = $db->bindVars($sql, ':customers_id:', $customer, 'integer');
        $res = $db->Execute($sql);
        //pr($res);
        $customer_newsletter_status = $res->fields['customers_newsletter'];  
}

    function update(&$callingClass, $notifier, $paramsArray)
    {   
        
        if ( $notifier == 'NOTIFY_LOGIN_SUCCESS' ) {
            $this->updateNotifyLoginSuccess($callingClass, $notifier, $paramsArray);
        }
        if ( $notifier == 'NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD' ) {
            $this->updateCreateAccountAddedCustomerRecord($callingClass, $notifier, $paramsArray);
        }  
        if ( $notifier == 'NOTIFY_HEADER_END_ACCOUNT' ) {
            $this->updateHeaderEndAccount($callingClass, $notifier, $paramsArray);
        }        
    }
}

INIT_SCRIPT

<?php

if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
   }
$check_until_date = '20181231'; // ON

$rgpd_date = '20180528';
// GDPR - If cookieconsent_status is set, allow tag manager to load. 
// Leaving two choices here for something
$cookie_config = false; // Start only with zenid cookie
$cookie_ga_default = true; // Analytics default: doesn't track remarketing and sets anonymous IP
$cookie_external = false; //  GA tracks for marketing, FB pixel, social shares, etc

//adds analytics cookie with Anonymous IP
if (!$_COOKIE["cookieconsent_status"] ) {

    if( !$_COOKIE["cc_analytics"] == 'deny') {
        zen_setcookie('cc_analytics', 'allow', time()+60*60*24*30, '/', (zen_not_null($current_domain) ? $current_domain : ''));
    } 

    if ( (str_replace('-','',$_SESSION['today_is']) <= $rgpd_date) && !$_COOKIE["cc_allowSocial"] == 'deny' ) {
        $cookie_external = true;
        zen_setcookie('cc_allowSocial', 'allow', time()+60*60*24*30, '/', (zen_not_null($current_domain) ? $current_domain : ''));
      }
}


if (isset($_COOKIE['cc_analytics']) && $_COOKIE['cc_analytics'] == 'deny') {
  $cookie_ga_default = false;
}
if (isset($_COOKIE['cc_allowSocial']) && $_COOKIE['cc_allowSocial'] == 'allow') {
  $cookie_external = true; 
}
if (isset($_COOKIE['cookieconsent_status'])) { // It's set, check
  $cookie_config = true; // flag that the user made some configuration
  // allow all cookies 
  if ($_COOKIE['cookieconsent_status'] == 'allow') {
    $cookie_ga_default = true;
    $cookie_external = true; 
  }
}

if ( !isset($_SESSION['customers_warning_count'])) {
    $_SESSION['customers_warning_count'] = 0;
}

    if($_SESSION['customer_id']) {

        if ( !$_SESSION['customers_delete_account_request']) {
        $sql = " SELECT  customers_delete_account_request FROM ".TABLE_CUSTOMERS_GDPR." WHERE customers_id = :customers_id: ";
        $sql = $db->bindVars($sql , ':customers_id:', $_SESSION['customer_id'], 'integer');
        $res = $db->Execute($sql);
        if ($res->fields['customers_delete_account_request'] == '1') {
            $_SESSION['customers_delete_account_request'] = $res->fields['customers_delete_account_request'];  
        unset($sql, $res);  
        } 

        }
        
        if(str_replace('-','',$_SESSION['today_is']) <= $check_until_date ) {

        define('RGPD_MSG', 'Para estar em conformidade com o Regulamento Geral da Protecção de Dados Europeia, a Livraria PromoBooks, está a informar todos os seus cliente registados antes da nova lei, a fim de tomarem conhecimento sobre os dados processados. Por favor leia a nossa política de privacidade e aceda à <a href="'.zen_href_link(FILENAME_ACCOUNT, '', 'SSL').'"> Sua Área de Cliente</a> para efectuar as alterações necessárias. Ao continuar no site, pressupõe que tem conhecimento e que assim deseja continuar. ');

       if (  $_SESSION['customer_rgpd'] == '') {
       
        $sql = " SELECT customers_accept_terms, customers_was_notify_date, customers_delete_account_request FROM ".TABLE_CUSTOMERS_GDPR." WHERE customers_id = :customers_id: ";
        $sql = $db->bindVars($sql , ':customers_id:', $_SESSION['customer_id'], 'integer');
        $res = $db->Execute($sql);
            if ($res->RecordCount() > 0) {
                if ($res->fields['customers_accept_terms'] !=='0') {  
                    $_SESSION['customer_rgpd'] = true;      
                }else {
                    $_SESSION['customer_rgpd'] = '';
                   
                    if($_SESSION['customers_warning_count'] <= 2 && $_SESSION['customers_warning_count'] !=='stop') {
                       
                        $messageStack->add_session('site_notifications', RGPD_MSG, 'caution');
                        $_SESSION['customers_warning_count'] ++;                       
                    }
                   
                }
                if ($res->fields['customers_was_notify_date'] !=='') {
                    $_SESSION['customer_rgpd_notified'] = $res->fields['customers_was_notify_date'];    
                } else {
                    $_SESSION['customer_rgpd_notified'] = '';
                }
                
            } else {
                $_SESSION['customer_rgpd'] = '';
                $_SESSION['customer_rgpd_notified'] = '';
                if(($_SESSION['customers_warning_count'] <= 2) && ($_SESSION['customers_warning_count'] !=='stop')) {
                   $messageStack->add_session('site_notifications', RGPD_MSG, 'caution');
                   
                }           
            }
       }  
    } 
    
}

if($_SESSION['customers_warning_count'] == 2) {
    unset($_SESSION['customers_warning_count']);
    $_SESSION['customers_warning_count'] ='stop';
}
if ( $_SESSION['customers_delete_account_request'] == '1') {
        
    $messageStack->add_session('site_notifications', 'Recebemos a notificação para apagar a sua conta dentro do prazo estipulado po lei será eliminada', 'caution');
  
}

And then at template user account_default

<?php
  if (DISPLAY_PRIVACY_CONDITIONS == 'true' && $_SESSION['customer_rgpd'] == '') {
  echo zen_draw_form('customer_privacy_policy', zen_href_link(FILENAME_ACCOUNT, '', 'SSL'), 'post', '') . zen_draw_hidden_field('action', 'process') . zen_draw_hidden_field('email_pref_html', 'email_format');
?>
<fieldset>

<legend><?php echo TABLE_HEADING_PRIVACY_CONDITIONS; ?></legend>
<div class="information gdpr-info"><?php echo TEXT_PRIVACY_CONDITIONS_DESCRIPTION_AT_REGISTRATION;?></div>
<?php echo zen_draw_checkbox_field('privacy_conditions', '1', false, 'id="privacy" required');?>
<label class="checkboxLabel gdpr-info-label" for="privacy"><?php echo TEXT_PRIVACY_CONDITIONS_CONFIRM;?></label>
<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SUBMIT, BUTTON_SUBMIT_ALT); ?></div>
</fieldset>
<?php
  }
?>

</form>

And added a delete account form
Hope it helps, but arrange this to your code.
Made this for myself so didnt't take into account some other zencart stuff "modules stuff"

20 May 2018, 12:37 PM
#65
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

mesnitu:

I'm using the default zencart "Regulations->Confirm Privacy Notice During Account Creation Procedure"
But since that Confirm Privacy Notice is not registered anywhere , I had to create a table to save all records on create account and existent users.

CREATE TABLE customers_gdpr (
customers_id int(11) NOT NULL,
customers_account_created_date datetime DEFAULT NULL,
customers_accept_terms tinyint(4) DEFAULT '0',
customers_accept_terms_date datetime DEFAULT CURRENT_TIMESTAMP,
customers_was_notify_date datetime DEFAULT NULL,
customers_delete_account_request tinyint(4) DEFAULT '0',
PRIMARY KEY (customers_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

> 
> So if a user creates a account, he has to accept. If a existing user login he's notify and that notification is registers. If he accepts or not, really doen't matter. I just need to have something to show that the client was notify and is aware of that, etc,etc...

OK, I'm not sure i understand completely, what do I do with this code?  it is a sql query? do i execute this code in the Php MyAdmin queries to create the tables in my DB?


10x
20 May 2018, 1:08 PM
#66
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

Adrian Ciocîrlan:

OK, I'm not sure i understand completely, what do I do with this code? it is a sql query? do i execute this code in the Php MyAdmin queries to create the tables in my DB?

10x
Yes, that's a sql statement.... but listen, this is just a example of what I've done taking into account what the store is using, etc...
You must examine what you're requiring as personal data, etc, and implement according to that.

The other post by Congerman says he's not using this record. Maybe he's right, but I prefer to have that record , even for re-consent purposes.
So you'll have to analyze what you are collecting, to be able to delete or transfer, etc..

But this is not a module.

20 May 2018, 1:16 PM
#67
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

But I think even this is not enough.
Let's take a example of a inspection to a restaurant.
They inspect everything, they say it's wonderful, everything it's fine. They even lunch at the restaurant but they leave and leave no records of what they done....
It's useless.
Same way, I believe some kind of record must exist saying what was implemented and for what.
If not.... it makes no sense.

20 May 2018, 1:22 PM
#68
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

mesnitu:

Yes, that's a sql statement.... but listen, this is just a example of what I've done taking into account what the store is using, etc...
You must examine what you're requiring as personal data, etc, and implement according to that.

The other post by Congerman says he's not using this record. Maybe he's right, but I prefer to have that record , even for re-consent purposes.
So you'll have to analyze what you are collecting, to be able to delete or transfer, etc..

But this is not a module.

For the moment I just want to be able to see in the DB when a user enters personal data via create account or COWOA that he checked the box and he accepted the Privacy Statement and also the date that he accepted it (for proof reasons). There isn't a record to store this information at the moement.

Can u tel me what do I need to do to achieve this?

20 May 2018, 1:33 PM
#69
congerman avatar

congerman

Zen Follower

Join Date:
Oct 2008
Posts:
392
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

There is also the other thing about their "right to be forgotten".

Some people think that to comply they must just delete the customers account and purchase history etc. But not so, In the UK we are required to keep certain records under statute for 7, 10 and in some cases 20 years. This includes transactions and proving of them for tax purposes etc.

So I had to put in my privacy policy "If you wish to exercise your “Right to be forgotten” under GDPR please contact us and we will remove all data about you with the exception of data that we are required to keep under statute."

20 May 2018, 2:19 PM
#70
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: General Data Protection Rules GDPR

For the moment I just want to be able to see in the DB when a user enters personal data via create account or COWOA that he checked the box and he accepted the Privacy Statement and also the date that he accepted it (for proof reasons). There isn't a record to store this information at the moement.

Attaching a zip of two items from my site. Page to request removal and privacy check added to the database with date for annual checkup. Not a plugin, just some quick instructions and the base code setup in folder format. Privacy, If its more then a year, they will get nag to review and check the privacy box on each login. How you use is up to you.

21 May 2018, 9:32 AM
#71
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

davewest:

Attaching a zip of two items from my site. Page to request removal and privacy check added to the database with date for annual checkup. Not a plugin, just some quick instructions and the base code setup in folder format. Privacy, If its more then a year, they will get nag to review and check the privacy box on each login. How you use is up to you.

Thank You very much

I installed the mod but i have a question, if you could shed some light...

Case: When a new customer creates an account, if the Regulations> Confirm Privacy Notice During Account Creation Procedure is set to True he has to check the confirmation box to go further (otherwise he can't continue), but this action doesn't record the acceptance anywhere and he can place the order with nothing recorded in the privacy_conditions fields in the DB.
Only after he logs in the next time he is forced to accept the "real privacy - the one in the module" and the action is indeed recorded.
Is there a possibility to validate Privacy and also create the DB record at create account level? Because at the moment he is obligated to accept the privacy twice - once at create account level, and once at privacy page level...

Thanks again,
Adrian

21 May 2018, 9:47 AM
#72
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

Adrian Ciocîrlan:

Thank You very much

I installed the mod but i have a question, if you could shed some light...

Case: When a new customer creates an account, if the Regulations> Confirm Privacy Notice During Account Creation Procedure is set to True he has to check the confirmation box to go further (otherwise he can't continue), but this action doesn't record the acceptance anywhere and he can place the order with nothing recorded in the privacy_conditions fields in the DB.
Only after he logs in the next time he is forced to accept the "real privacy - the one in the module" and the action is indeed recorded.
Is there a possibility to validate Privacy and also create the DB record at create account level? Because at the moment he is obligated to accept the privacy twice - once at create account level, and once at privacy page level...

Thanks again,
Adrian

Have you tried this mod in an earlier post by jsweb? I think it does all that you need.

21 May 2018, 9:52 AM
#73
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

I tried it, but my site crashes, merged the files twice, I' don't know what I did wrong, davewest's mod works but i only have the problems mentioned earlier. waiting for his answer...

A

21 May 2018, 10:01 AM
#74
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

If you find davewest's mod can't do what you want, post any error messages you had - I've installed that mod I referred to and it's working fine (only one issue I had to resolve).

21 May 2018, 11:55 AM
#75
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

simon1066:

If you find davewest's mod can't do what you want, post any error messages you had - I've installed that mod I referred to and it's working fine (only one issue I had to resolve).

In is not actually an error, at create account page you thick the Zen Cart's default Privacy box, nothing is recorded and you can go further to the next step and place the order, but no Privacy acceptance is recorded!!! in the database fields.
Only after you log out and login again the mod prompts Privacy Page with message that you need to agree with the Policy to continue shopping. But since you already have agreed at create account page level then you have to agree twice ...

I would like the NEW user to be able to agree the mod's Privacy checkbox not Zen Cart's default checkbox at create account page level and that should be enough, without having to agree again when he logs in.

For existing accounts it's working fine - when they visit the site next time, they will be prompted that they have to agree to continue which is what we need.

I'm using V 1.5.1 - forgot to mention

10x

21 May 2018, 1:22 PM
#76
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

Adrian Ciocîrlan:

In is not actually an error, at create account page you thick the Zen Cart's default Privacy box, nothing is recorded and you can go further to the next step and place the order, but no Privacy acceptance is recorded!!! in the database fields.
Only after you log out and login again the mod prompts Privacy Page with message that you need to agree with the Policy to continue shopping. But since you already have agreed at create account page level then you have to agree twice ...

I would like the NEW user to be able to agree the mod's Privacy checkbox not Zen Cart's default checkbox at create account page level and that should be enough, without having to agree again when he logs in.

For existing accounts it's working fine - when they visit the site next time, they will be prompted that they have to agree to continue which is what we need.

I'm using V 1.5.1 - forgot to mention

10x

Oops sorry, I didn't word my email very well. I was actually referring to errors you experienced using the JSWeb mod - when your site crashed, in case you decide to revisit that mod.

21 May 2018, 2:47 PM
#77
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: General Data Protection Rules GDPR

Sorry, I don't use the create account page and had to go back and get/match code.

The includes/modules/create_account.php if you modified this file then it would be in your template folder. If you are using COWOA or COWAA it would be the same for the register, and no_account modules too.

Standard input check, then storing the info into the database. The date is auto created for the time of creation.

look for this set of lines:

 if (isset($_POST['email_format'])) { 
    $email_format = zen_db_prepare_input($_POST['email_format']); 
  } 

  if (ACCOUNT_COMPANY == 'true') $company = zen_db_prepare_input($_POST['company']); 
  $firstname = zen_db_prepare_input(zen_sanitize_string($_POST['firstname'])); 
  $lastname = zen_db_prepare_input(zen_sanitize_string($_POST['lastname'])); 
  $nick = zen_db_prepare_input($_POST['nick']); 
  if (ACCOUNT_DOB == 'true') $dob = zen_db_prepare_input($_POST['dob']);

add this line above ACCOUNT_COMPANY

 
 if  (DISPLAY_PRIVACY_CONDITIONS == 'true') $privacy_conditions =  zen_db_prepare_input($_POST['privacy_conditions']); //added for gdpr 

Then on the database sql or look for this set of lines:

     $sql_data_array = array(array('fieldName'=>'customers_firstname',  'value'=>$firstname, 'type'=>'stringIgnoreNull'), 
                           array('fieldName'=>'customers_lastname', 'value'=>$lastname, 'type'=>'stringIgnoreNull'), 
                            array('fieldName'=>'customers_email_address',  'value'=>$email_address, 'type'=>'stringIgnoreNull'), 
                           array('fieldName'=>'customers_nick', 'value'=>$nick, 'type'=>'stringIgnoreNull'), 
                           array('fieldName'=>'customers_telephone', 'value'=>$telephone, 'type'=>'stringIgnoreNull'), 
                           array('fieldName'=>'customers_fax', 'value'=>$fax, 'type'=>'stringIgnoreNull'), 
                           array('fieldName'=>'customers_newsletter', 'value'=>$newsletter, 'type'=>'integer'), 
                            array('fieldName'=>'customers_email_format',  'value'=>$email_format, 'type'=>'stringIgnoreNull'), 
                           array('fieldName'=>'customers_default_address_id', 'value'=>0, 'type'=>'integer'), 
                            array('fieldName'=>'customers_password',  'value'=>zen_encrypt_password($password),  'type'=>'stringIgnoreNull'), 
                            array('fieldName'=>'customers_authorization',  'value'=>$customers_authorization, 'type'=>'integer'),
    );

add to the bottom:

  
                            array('fieldName'=>'customers_privacy_conditions',  'value'=>$privacy_conditions, 'type'=>'integer'), 
                           array('fieldName'=>'customers_privacy_date', 'value'=>now(), 'type'=>'date'), 

corrected the upload... The added create_account.php is from 155f

21 May 2018, 3:16 PM
#78
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

davewest:

Sorry, I don't use the create account page and had to go back and get/match code.

The includes/modules/create_account.php if you modified this file then it would be in your template folder. If you are using COWOA or COWAA it would be the same for the register, and no_account modules too.

Standard input check, then storing the info into the database. The date is auto created for the time of creation.

look for this set of lines:

if (isset($_POST['email_format'])) {
$email_format = zen_db_prepare_input($_POST['email_format']);
}

if (ACCOUNT_COMPANY == 'true') $company = zen_db_prepare_input($_POST['company']);
$firstname = zen_db_prepare_input(zen_sanitize_string($_POST['firstname']));
$lastname = zen_db_prepare_input(zen_sanitize_string($_POST['lastname']));
$nick = zen_db_prepare_input($_POST['nick']);
if (ACCOUNT_DOB == 'true') $dob = zen_db_prepare_input($_POST['dob']);

> add this line above ACCOUNT_COMPANY
> ```
 
 if  (DISPLAY_PRIVACY_CONDITIONS == 'true') $privacy_conditions =  zen_db_prepare_input($_POST['privacy_conditions']); //added for gdpr 

Then on the database sql or look for this set of lines:

 $sql_data_array = array(array('fieldName'=>'customers_firstname',  'value'=>$firstname, 'type'=>'stringIgnoreNull'), 
                       array('fieldName'=>'customers_lastname', 'value'=>$lastname, 'type'=>'stringIgnoreNull'), 
                        array('fieldName'=>'customers_email_address',  'value'=>$email_address, 'type'=>'stringIgnoreNull'), 
                       array('fieldName'=>'customers_nick', 'value'=>$nick, 'type'=>'stringIgnoreNull'), 
                       array('fieldName'=>'customers_telephone', 'value'=>$telephone, 'type'=>'stringIgnoreNull'), 
                       array('fieldName'=>'customers_fax', 'value'=>$fax, 'type'=>'stringIgnoreNull'), 
                       array('fieldName'=>'customers_newsletter', 'value'=>$newsletter, 'type'=>'integer'), 
                        array('fieldName'=>'customers_email_format',  'value'=>$email_format, 'type'=>'stringIgnoreNull'), 
                       array('fieldName'=>'customers_default_address_id', 'value'=>0, 'type'=>'integer'), 
                        array('fieldName'=>'customers_password',  'value'=>zen_encrypt_password($password),  'type'=>'stringIgnoreNull'), 
                        array('fieldName'=>'customers_authorization',  'value'=>$customers_authorization, 'type'=>'integer'),
);
> add to the bottom:
> ```
  
                            array('fieldName'=>'customers_privacy_conditions',  'value'=>$privacy_conditions, 'type'=>'integer'), 
                           array('fieldName'=>'customers_privacy_date', 'value'=>now(), 'type'=>'date'), 

corrected the upload... The added create_account.php is from 155f

I think it's the sql area i'm merging wrong, it is not working, the create acount page crashes after i click create account, i think it's because the lines are different, in 1.55 & i-m using 1.5.1.

I tried to adapt it in the sql array area, but i don't think i did it right, please tell me how the 1.5.1 version below should look like after adding the 2 lines you mentioned?

1.5.1 code without the 2 lines:

$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
'customers_email_address' => $email_address,
'customers_nick' => $nick,
'customers_telephone' => $telephone,
'customers_fax' => $fax,
'customers_newsletter' => (int)$newsletter,
'customers_email_format' => $email_format,
'customers_default_address_id' => 0,
'customers_password' => zen_encrypt_password($password),
'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION

21 May 2018, 3:42 PM
#79
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: General Data Protection Rules GDPR

I don't have any testing setup to go back that far, but this should be it, pay attention to the commas.

'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION,
                            'customers_privacy_conditions' => (int)$privacy_conditions, 
                            'customers_privacy_date' => now()
);
21 May 2018, 4:34 PM
#80
adrian_cioc_rlan avatar

adrian_cioc_rlan

New Zenner

Join Date:
May 2016
Location:
Bucharest
Posts:
48
Plugin Contributions:
0

Re: General Data Protection Rules GDPR

davewest:

I don't have any testing setup to go back that far, but this should be it, pay attention to the commas.

'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION,
'customers_privacy_conditions' => (int)$privacy_conditions,
'customers_privacy_date' => now()

);


10x again,

but it doesn't seem to do the job, i'm pulling my hair off, the create_account.php modifications break the site when i go ahead and i hit create account button, it returns 500 error, if I remove these lines everything goes back to normal. Can't figure out why these 3 lines break it i put them exactly where they are supposed to go, checked for commas... 

Maybe it doesen't communicate with the db, or looking for non existing tables...
The 2 tables that i'm thinking should record the action are those created by the sql patch customers_privacy_conditions and customers_privacy_date. 
Should there be more than these? duno