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

Wiz

  • ****
  • 153 posts
[Suggestion] Allow chat access after verification
« on: March 11, 2023, 05:47:42 AM »
Hello,

Please consider adding chat access to the plugin's verification restriction list which is currently:

- Publish page
- User pages
- Instant Messenges
- OSP

Thank you!

Wiz

*

MB Themes

Re: [Suggestion] Allow chat access after verification
« Reply #1 on: March 11, 2023, 12:46:39 PM »
Why not to allow to logged-in users and require phone verification for registered?
Sounds easier
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Wiz

  • ****
  • 153 posts
Re: [Suggestion] Allow chat access after verification
« Reply #2 on: March 11, 2023, 07:38:31 PM »
Unless I missed something, the chat plugin can be accessed and used from the homepage which is not restricted by the SMS plugin's phone verification restriction list.

Try it, you can access the homepage and browse anywhere without verification even if it was enabled and user is logged in except for user/publish/instant messages/osp sections.


I'm all for simple solutions  ;)
« Last Edit: March 11, 2023, 08:05:27 PM by Wiz »

*

Wiz

  • ****
  • 153 posts
Re: [Suggestion] Allow chat access after verification
« Reply #3 on: March 11, 2023, 07:50:40 PM »
This is what I see after logging in with phone verification and chat enabled but phone not verified.

Edit: added another screenshot of homepage with logged in user and without phone being verified.
« Last Edit: March 11, 2023, 08:10:31 PM by Wiz »

*

MB Themes

Re: [Suggestion] Allow chat access after verification
« Reply #4 on: March 14, 2023, 09:14:57 PM »
You would need to condition button that's shown in front.
You could use:
Code: [Select]
<?php
if(sms_phone_verify($logged_user_phone)) {
... 
show chat button ...
}
?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on March 16, 2023, 11:30:07 AM
*

MB Themes

Re: [Suggestion] Allow chat access after verification
« Reply #5 on: March 14, 2023, 09:19:14 PM »
Created one function (will be added later to plugin):
Code: [Select]
// CHECK IF USER IS VERIFIED
function sms_check_user_verified($user_id = NULL) {
  if($user_id === NULL) {
    $user_id = osc_logged_user_id();
  }

  if($user_id > 0) {
    $user = User::newInstance()->findByPrimaryKey($user_id);

    if(isset($user['s_phone_mobile']) && trim((string)$user['s_phone_mobile']) != '' && sms_phone_verify($user['s_phone_mobile'])) {
      return true;
    }
  }
 
  return false;
}

You can use it to check if user is verified as well ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Wiz

  • ****
  • 153 posts
Re: [Suggestion] Allow chat access after verification
« Reply #6 on: March 15, 2023, 08:00:07 PM »
Nice!! Thank you  8)

*

Wiz

  • ****
  • 153 posts
Re: [Suggestion] Allow chat access after verification
« Reply #7 on: April 02, 2023, 08:36:20 AM »
Hi,

If I wanted to enforce sms verification for all logged in sessions, not only chat, how would I hook the function you created above? I just realized unverified accounts are able to view masked phone numbers as well.

So basically, registered and unverified users can't view masked numbers, use chat or any site service that requires signing in to interact with other users.

Thanks
« Last Edit: April 02, 2023, 08:38:00 AM by Wiz »

*

MB Themes

Re: [Suggestion] Allow chat access after verification
« Reply #8 on: April 03, 2023, 10:23:31 AM »
@Wiz
By default when verification is enabled, then users need to verify their account if they access user area.
You would only need to change this to trigger verification on listing page as well.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Wiz

  • ****
  • 153 posts
Re: [Suggestion] Allow chat access after verification
« Reply #9 on: April 03, 2023, 06:39:01 PM »
Alright, thank you!