Advertisement:

Author Topic: GDPR Compliance and Osclass script  (Read 14843 times)

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #225 on: May 11, 2018, 12:47:56 am »
https://wptavern.com/wordpress-4-9-6-beta-1-adds-tools-for-gdpr-compliance

Wordpress adds also GDPR for its own services (what kind of information is exchanged between Wordpress.org and the sites using WP script etc etc).

Read all the info, very interesting what they do and how.

That's nice. ;) It would be nice if there are some GDPR regulations for BuddyPress plugin.

Regards.

Aficionado

  • Guest
Re: GDPR Compliance and Osclass script
« Reply #226 on: May 11, 2018, 12:52:41 am »

That's nice. ;) It would be nice if there are some GDPR regulations for BuddyPress plugin.


https://buddypress.trac.wordpress.org/ticket/7698

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #227 on: May 11, 2018, 01:34:25 am »

That's nice. ;) It would be nice if there are some GDPR regulations for BuddyPress plugin.


https://buddypress.trac.wordpress.org/ticket/7698

Thanks. I hope the new version releases soon. :D

Regards.

Aficionado

  • Guest
Re: GDPR Compliance and Osclass script
« Reply #228 on: May 11, 2018, 02:17:29 am »
It seems that it will be a while for most scripts to be compliant, and that is fine.

But at least they talk about it and prepare for it.


marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1623
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: GDPR Compliance and Osclass script
« Reply #229 on: May 11, 2018, 09:42:24 am »
For chance, does someone know if the osclass core sends something to osclass (excepting plugins) if the connection to the market was never made?

I ask because Aficionado mentioned something about WP in regard to this( or I've read it in one of the links he posted).

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #230 on: May 11, 2018, 01:08:12 pm »
For chance, does someone know if the osclass core sends something to osclass (excepting plugins) if the connection to the market was never made?

I ask because Aficionado mentioned something about WP in regard to this( or I've read it in one of the links he posted).

I think there is a checkbox at the installation where the script asks you to send usage reports or something like that to osclass.

Regards.

Aficionado

  • Guest
Re: GDPR Compliance and Osclass script
« Reply #231 on: May 11, 2018, 01:46:26 pm »
For chance, does someone know if the osclass core sends something to osclass (excepting plugins) if the connection to the market was never made?

I ask because Aficionado mentioned something about WP in regard to this( or I've read it in one of the links he posted).

Is this something we have to guess or probably look at the code to know.

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #232 on: May 11, 2018, 02:10:19 pm »
For chance, does someone know if the osclass core sends something to osclass (excepting plugins) if the connection to the market was never made?

I ask because Aficionado mentioned something about WP in regard to this( or I've read it in one of the links he posted).

I think there is a checkbox at the installation where the script asks you to send usage reports or something like that to osclass.

Regards.

I found this in preference table in osc DB:



Regards.

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1623
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: GDPR Compliance and Osclass script
« Reply #233 on: May 11, 2018, 04:46:43 pm »
Thank you. I'll look in the core for that field.
Edit
Who has that enabled, should adapt their TOS.
« Last Edit: May 11, 2018, 05:09:18 pm by marius-ciclistu »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1623
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: GDPR Compliance and Osclass script
« Reply #234 on: May 11, 2018, 06:43:50 pm »
Update on google analitics accept. https://forums.osclass.org/general-help/gdpr-compliance-and-osclass/msg161843/#msg161843

Added accept indefinitely

Code: [Select]
            <button onclick='g_a_user_accept();$(\"#gaaccept\").hide();set_gaaccept();'>Accept</button>
            <button onclick='g_a_user_accept();$(\"#gaaccept\").hide();set_gaaccept(\"local\");'>Accept indefinitely</button>

Code: [Select]
    function set_gaaccept(place = 'session'){
        switch (place) {
            case 'local':
                localStorage['gauseraccept'] = 'accepted';
                break;
            default:       
                sessionStorage['gauseraccept'] = 'accepted';
        }
    }

Code: [Select]
    if((localStorage['gauseraccept'] && localStorage['gauseraccept'] == 'accepted') || (sessionStorage['gauseraccept'] && sessionStorage['gauseraccept'] == 'accepted')){
          g_a_user_accept();
    } else {
       
        $('#gaaccept').show();
    }
« Last Edit: May 11, 2018, 06:49:10 pm by marius-ciclistu »

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #235 on: May 12, 2018, 12:29:56 am »
Solution for dumping data about user account and items


1. Create a new static page in admin with slug 'export' and DO NOT SHOW THE LINK in the footer.
2. Create 'page-export.php' in oc-content/themes/bender/
EDIT

   osc_query_item("author=$userId");

    $items=View::newInstance()->_get('customItems');
This retrieves only 10 items. Does anyone know the solution to get them all?

Solved

Code: [Select]
<?php
    
/*
     *      Osclass – software for creating and publishing online classified
     *                           advertising platforms
     *
     *                        Copyright (C) 2014 OSCLASS
     *
     *       This program is free software: you can redistribute it and/or
     *     modify it under the terms of the GNU Affero General Public License
     *     as published by the Free Software Foundation, either version 3 of
     *            the License, or (at your option) any later version.
     *
     *     This program is distributed in the hope that it will be useful, but
     *         WITHOUT ANY WARRANTY; without even the implied warranty of
     *        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *             GNU Affero General Public License for more details.
     *
     *      You should have received a copy of the GNU Affero General Public
     * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
     */

    // meta tag robots
    
osc_add_hook('header','bender_nofollow_construct');

    
bender_add_body_class('page');
    
osc_current_web_theme_path('header.php') ;
?>

<h1><?php echo osc_static_page_title(); ?></h1>
<?php echo osc_static_page_text(); 

if(
osc_is_web_user_logged_in()) {
    
$baseUrl=osc_base_url();
    
$userId=osc_logged_user_id();
    
$user User::newInstance()->findByPrimaryKey($userId);

    unset(
$user['s_secret']);
    unset(
$user['s_password']);
    echo 
'<br/>*For download, save this page (if you are using a computer press CTRL+S).<br/><br/><h2>Summary account data:</h2><br/><br/>';
    foreach(
$user as $k => $v)
    {   
        if(!
is_array($v)){
            if(
$v) {echo "<b>$k: </b>$v,<br>";}
        }
        else
        {
            echo 
"<b>$k: </b><br/>";
            foreach(
$v as $country => $locale){
                echo 
" ****<b>$country:</b><br/>";
                foreach(
$locale as $lk => $lv){
                    if(
$lv) {
                        echo 
" ********<b>$lk: </b>$lv,<br/>";
                        
                    }
                    
                    
                }
                
            }

        }
        
    }
        
osc_query_item(array('author' => $userId'results_per_page' => 10000));

    echo 
'<br/><br/><h2>Summary items:</h2><br/><br/>';
    
$items=View::newInstance()->_get('customItems');

    foreach(
$items as $item)
    {   unset(
$item['s_secret']);

        foreach(
$item as $k => $v)
        {
            if(!
is_array($v)) {
                if(
$v) {
                    echo 
"<b>$k: </b>$v,<br/>";
                }
            }
            else
            {
                echo 
"<b>$k: </b><br/>";

                foreach(
$v as $country => $locale){
                    echo 
" ****<b>$country:</b><br/>";

                    foreach(
$locale as $lk => $lv){

                        if(
$lv) {
                            echo 
" ********<b>$lk: </b>$lv,<br/>";
                            
                        }
                        
                        
                    }
                    
                }

            }
            
        }

        
View::newInstance()->_exportVariableToView('metafields'Item::newInstance()->metaFields($item['pk_i_id']) );
        
$custom_fields=View::newInstance()->_get('metafields');

        foreach (
$custom_fields as $custom_field){
            echo 
'"' $custom_field['s_name'] . '": "' $custom_field['s_value'] . '"' ",<br/>";
        }
        
        
View::newInstance()->_exportVariableToView('resources'ItemResource::newInstance()->getAllResourcesFromItem($item['pk_i_id']) );
        
$pictures=View::newInstance()->_get('resources');

        foreach(
$pictures as $picture){
            echo 
'<img src="' $baseUrl $picture['s_path'] . $picture['pk_i_id'] . '.' $picture['s_extension'] . '">';
            
        }
        echo 
"<hr/>";
    }
    
} else {
    
header('Location: 'osc_base_url() . 'user/login');
}

?>


<?php if( osc_get_preference('homepage-728x90''bender') != '') { ?>
<!-- homepage ad 728x60-->
<div class="ads_728">
    <?php echo osc_get_preference('homepage-728x90''bender'); ?>
</div>
<!-- /homepage ad 728x60-->
<?php ?>
<?php osc_current_web_theme_path('footer.php') ; ?>

3. in bender's functions.php
(replaces this https://forums.osclass.org/general-help/gdpr-compliance-and-osclass/msg161276/#msg161276)

Code: [Select]
function mc_export_html_info_user($usr) {

echo '<br/><br/><span class="ui-button" onclick="window.location = \'' . osc_base_url() . 'export-pXX' . '\';">Export personal data</span>';

}
osc_add_hook('user_form', 'mc_export_html_info_user');
REPLACE XX with export's page id

Is there a way to get custom fields to show in this loop?


EDIT: Code fixed by @marius-ciclistu, custom fields now showing.

Regards.
« Last Edit: May 12, 2018, 03:53:26 pm by patrickFromCroatia »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1623
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: GDPR Compliance and Osclass script
« Reply #236 on: May 12, 2018, 09:02:25 am »
Yes. I forgot about them :))

Add

Code: [Select]
        View::newInstance()->_exportVariableToView('metafields', Item::newInstance()->metaFields($item['pk_i_id']) );
        $custom_fields=View::newInstance()->_get('metafields');

        foreach ($custom_fields as $custom_field){
            echo '"' . $custom_field['s_name'] . '": "' . $custom_field['s_value'] . '"' . ",<br/>";
        }
You can replace s_name with s_slug if you want.

I edited the main answer. Can you delete the initial answer from your quotes to make it clear.
« Last Edit: May 12, 2018, 10:41:29 am by marius-ciclistu »

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #237 on: May 12, 2018, 03:56:01 pm »
Thanks, it works. I edited the quotes.
BTW, is there any documentation for using "View" class? I see it used in many examples on this forums, but I actually have no idea how it works.

Regards.

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1623
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: GDPR Compliance and Osclass script
« Reply #238 on: May 12, 2018, 04:03:59 pm »
I used it first with phalcon framework. I did not found documentation for osclass.

WEBmods

  • Hero Member
  • *****
  • Posts: 840
  • aka patrickFromCroatia | Osclass Dev Services
Re: GDPR Compliance and Osclass script
« Reply #239 on: May 12, 2018, 04:16:49 pm »
Hmm, okay then. I will probably create a new topic to ask, maybe someone could explain it to me.



Solution to show custom plugin attributes in @marius-ciclistu's export code:

Code: [Select]
<?php
        
// ATTRIBUTES PLUGINS
        
$carAttr ModelCars::newInstance()->getCarAttr($item['pk_i_id']); // Modify model name and function by your plugin.
        
if(!empty($carAttr)) {
           foreach(
$carAttr as $k => $v) {
               if(empty(
$v)) {
                   continue;
               }
               echo 
"<tr>"// Used to show data in table, can be easily changed.
               
echo "<td>".$k."</td> <td>".$v."</td>";
               echo 
"</tr>";
           }
        }
?>


Regards.