*

reflexus

  • ****
  • 146 posts
User banned
« on: April 17, 2017, 04:03:57 AM »
Hello, if the guest user blocked or banned, and listed on this page oc-admin/index.php?page=users&action=ban, he can still write messages, why?
« Last Edit: April 17, 2017, 04:45:49 AM by reflexus »

*

MB Themes

Re: User banned
« Reply #1 on: April 18, 2017, 02:53:50 PM »
@reflexus
Because ban is active for mails only, not for personal messages.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

reflexus

  • ****
  • 146 posts
Re: User banned
« Reply #2 on: April 19, 2017, 01:14:29 AM »
@reflexus
Because ban is active for mails only, not for personal messages.

But this is not entirely correct, how then can we protect personal correspondence from spammers?

We can use this code:

Code: [Select]
$banned = osc_is_banned($from_user_email);
                                        if($banned==1) {
                                            osc_add_flash_error_message( _m('Your current email is not allowed'));
                                            $this->redirectTo(osc_route_url( 'im-create-thread', array('item-id' => $item_id) ));
return;
                                        } else if($banned==2) {
                                            osc_add_flash_error_message( _m('Your current IP is not allowed'));
                                           redirectTo(osc_route_url( 'im-create-thread', array('item-id' => $item_id) ));
return;
                                        }

                                        $user = User::newInstance()->newInstance()->findByEmail($from_user_email);
                                        if(isset($user['b_active']) && ($user['b_active']==0 || $user['b_enabled']==0)) {
                                            osc_add_flash_error_message( _m('Your current email is not allowed'));
                                            redirectTo(osc_route_url( 'im-create-thread', array('item-id' => $item_id) ));
return;
        }



But this work not perfect. Perhaps you can tell me how to do better?

And maybe it would be nice to add this protection in the next update of the script?

*

MB Themes

Re: User banned
« Reply #3 on: April 19, 2017, 10:52:25 AM »
@reflexus
I will take a look on it in next release.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: User banned
« Reply #4 on: May 16, 2017, 11:07:47 AM »
@reflexus
We have just updated plugin and added functionality to block users.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots