This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

7ala

  • ****
  • 144 posts
The problem of sending messages to users without registration
« on: January 08, 2022, 12:44:26 PM »
Many messages are sent to users without registration
When you block the sender it is blocked
When I search for the email in user accounts, it is not found
How was this message sent even though it was not registered?
You can only reply after registering
It is already activated
« Last Edit: January 08, 2022, 12:46:20 PM by 7ala »

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #1 on: January 08, 2022, 02:01:41 PM »
Do you have it via settings in plugin?
In theory it is possible that mailing function is not secured  ::)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #2 on: January 09, 2022, 09:23:57 AM »
Do you have it via settings in plugin?
In theory it is possible that mailing function is not secured  ::)

Where is the postal job secured? :P

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #3 on: January 10, 2022, 08:05:23 AM »
@7ala
In functions.php find this code:
Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {

Replace it with:
Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {
  if(im_param('only_logged') == 1 && !osc_is_web_user_logged_in()) {
    return false;
  }

That should do it, plugin does not contains other methods for creating/sending messages.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #4 on: January 10, 2022, 10:11:03 AM »

found this
Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file ) {
   $thread = ModelIM::newInstance()->getThreadById( $thread_id );
   $item = Item::newInstance()->findByPrimaryKey( $thread['fk_i_item_id'] );
after change
Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {
   if(im_param('only_logged') == 1 && !osc_is_web_user_logged_in()) {
$thread = ModelIM::newInstance()->getThreadById( $thread_id );
     $item = Item::newInstance()->findByPrimaryKey( $thread['fk_i_item_id'] );
     return false;
   }

Is this correct
Thank you all
« Last Edit: January 10, 2022, 10:49:27 AM by 7ala »

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #5 on: January 10, 2022, 11:05:24 AM »
@7ala
Does not look to be correct.
You should escape function in case it fails that condition.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #6 on: January 19, 2022, 09:28:36 AM »
@7ala
In functions.php find this code:
Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {

Replace it with:
Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {
  if(im_param('only_logged') == 1 && !osc_is_web_user_logged_in()) {
    return false;
  }

That should do it, plugin does not contains other methods for creating/sending messages.

Where can I find the location of this file?
jobs.php

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #7 on: January 19, 2022, 01:30:20 PM »
@7ala
oc-content/plugins/instant_messenger/function.php    :-\
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #8 on: January 19, 2022, 02:53:57 PM »
@7ala
oc-content/plugins/instant_messenger/function.php    :-\

please
What is the correct structure of the code?  :'( :(

Code: [Select]
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {
  if(im_param('only_logged') == 1 && !osc_is_web_user_logged_in()) {
    return false;
  }

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #9 on: January 19, 2022, 09:31:16 PM »
It looks clear, there is just new block of code inside function.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #10 on: January 20, 2022, 09:34:31 AM »
 ;D ;D

Thank you very much
For the capacity of your hearts
And the speed of your response

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #11 on: January 20, 2022, 01:30:49 PM »
@7ala
 ;D ;D
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #12 on: January 22, 2022, 08:50:44 AM »
Unfortunately
There are still messages being sent without registration
I did this and same problem

Quote
// MANAGE MESSAGE INSERT INTO DATABASE
function im_insert_message($thread_id, $message, $type, $file, $notify = true ) {
  if(im_param('only_logged') == 1 && !osc_is_web_user_logged_in()) {
    return false;
  }
  $thread = ModelIM::newInstance()->getThreadById( $thread_id );
  $item = Item::newInstance()->findByPrimaryKey( $thread['fk_i_item_id'] );

Also there is a strange problem
If a message is sent from a registered user to another user
A letter arrives in the mail
In the mail there is a direct link to the conversation
Supposedly when you click on the direct link
If you are not logged into the site before, you will be directed to the login page
Unfortunately, this link opens the conversation even if you are not logged in  :'(
Thank you all

*

MB Themes

Re: The problem of sending messages to users without registration
« Reply #13 on: January 24, 2022, 09:21:23 AM »
@7ala
plugin allows conversation for non-logged as well. In url you should see secret code that authenticates user.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Re: The problem of sending messages to users without registration
« Reply #14 on: March 21, 2022, 07:03:05 AM »
I find the problem here in this code
Code: [Select]
<?php if(osc_is_web_user_logged_in() && $item['fk_i_user_id'] <> osc_logged_user_id() || !osc_is_web_user_logged_in()) { ?>
  <h2 class="im-head"><?php _e('Start conversation''instant_messenger'); ?></h2>

Messages are still coming from unregistered users

Also, how can the user be directed to the login page?
« Last Edit: March 21, 2022, 12:27:26 PM by 7ala »