Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-10-2016, 12:52 PM
MGO_TOM MGO_TOM is offline
 
Join Date: Nov 2009
Location: Michigan
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Tapatalk Conditional Use Based on Usergroup

It seems that Tapatalk removed the AdminCP function of restricting its use to specific usergroups a few revs ago. My co-admin just did an update, and now anybody is able to login via Tapatalk (which we do NOT want…ONLY our paid members).

How and where can I put an "if" condition that allows logging-in via Tapatalk ONLY if the member is in a specific (42) usergroup?

Ideally, I would like the fault message to say "At this time, Tapatalk use is only available for paid members. Please see our home page for information on how to become a paid member."

vBulletin version 4.2.3
PHP version 5.4.45
MySQL version 5.6.28

Thanks!
Reply With Quote
  #2  
Old 02-12-2016, 04:33 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I downloaded Tapatalk v5.5.2 from May (2015), and I oddly enough can't find this usergroup limitation feature. Are you sure it was there? I remember something similar, but now I'm not too sure.
Reply With Quote
  #3  
Old 02-12-2016, 06:15 PM
MGO_TOM MGO_TOM is offline
 
Join Date: Nov 2009
Location: Michigan
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Skyrider View Post
I downloaded Tapatalk v5.5.2 from May (2015), and I oddly enough can't find this usergroup limitation feature. Are you sure it was there? I remember something similar, but now I'm not too sure.
Oh yes! I am 100% sure! We had it enabled since implementing Tapatalk and it worked FINE for all of this time.

We restrict use of Tapatalk since it bypasses forum permissions on things like signature lines (we have a number of commercial members that would like to "advertise" their businesses in their signature lines for free).

Also, Tapatalk users automatically bypass our banner advertisers, so that reduces our "appeal" to banner advertisers since any forum user using Tapatalk complete bypasses any paid advertising via banner advertisement (paid member or not).

On top of that, Tapatalk users do not see our marquee messages (usually focused on important matters pertaining to the organization) and vBulletin "notices", as well.

The impact of allowing "anyone" to log-into our forums via Tapatalk is huge due to these issues. Up until this point, we restricted it to ONLY paid members?but since this change/update?ANYBODY using Tapatalk can bypass these things, which has a huge financial impact on the organization providing the forums.

If we cannot identify a way to reinstate the usage limitations to ONLY paid members, we will be forced to uninstall Tapatalk.

Since I really don't want to do that, I am simply looking for a place to put some conditional code to assure that ONLY paid members (usergroup 42) are allowed to use Tapatalk.
Reply With Quote
  #4  
Old 02-12-2016, 06:25 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Have you checked the file "\mobiquo\config\config.php"? It has a setting called "allowed_usergroup".
Reply With Quote
  #5  
Old 02-12-2016, 06:35 PM
MGO_TOM MGO_TOM is offline
 
Join Date: Nov 2009
Location: Michigan
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dave View Post
Have you checked the file "\mobiquo\config\config.php"? It has a setting called "allowed_usergroup".
Yes?it did nothing (although I did confirm that Tapatalk "looks at" this file by creating syntax errors which stops ANY login). However, proper syntax (specifying specific usergroups) does not do anything.
Reply With Quote
  #6  
Old 02-12-2016, 09:33 PM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seeing the config files are clearly being ignored (I've disabled guest mode in it, not being used at all).. I took a little peak at the conf_init.php file. allowed_usergroup is not being used in it, but I assume a IF / ELSE can be used with:

Code:
$config['allowed_usergroup'] == xx
I'm not a PHP coder, but that's where I would start.

I think it's important that one or more of these codes:

Code:
defined('IN_MOBIQUO') or exit;
class mobiquo_config
function get_config()
global $vbulletin;
$config = array();
$mobiquo_config = $config;
return $mobiquo_config;
Should be in the custom PHP code if people are going to do that. But I'll take it edit the conf_init file directly "should" take effect as well.

EDIT
I've altered the conf_init.php file to set open forum to 0, and it took effect right away in the tapatalk app. As such, get the proper if / else statement in combination with:
Code:
$config['allowed_usergroup']
And in theory, it should work. But like I said, I'm not a PHP coder.. but I have some idea what to look for.


EDIT 2
config.php (in mobiquo) is not being ignored, it's tied up with conf_init.php and I already got some working code already! (newbie code though!)

For example, I used allowed_usergroup in combination with open forums mode allowed yes or no.. Open up config.php and edit the line:

Code:
'allowed_usergroup'       => '42',
Then, go to conf_init.php and add the following line (for example, below // $config['can_unread'] = 0:

Code:
if ($config['allowed_usergroup'] == 42){
            $config['is_open'] = 1;
        } else {
            $config['is_open'] = 0;
        }
And tada.. if the user on tapatalk is not part of usergroup 42, he or she will see "no topic" message. Not much familiar with what tapatalk allows or can show with custom code, but it's actually a good start to block non-usergroup 42 members on your forums.

This code is not 100% though! It still shows all the sections that are usually allowed for everyone to see, however! Every section will show "no topics" for those are are not in usergroup 42. Most likely best to combine the allowed_usergroup with hide_forum_id.

You can use every single code shown in config.php to use as a if/else statement in conf_init.php. With an advanced/expert php coder, you'll get what you want in no time. My 'code' so to speak merely helps you out a little bit.

EDIT 3:
I have the feeling that allowed_usergroup only applies and works on default vB usergroups. For some reason it doesn't work on custom groups (for me), while it works for eg, registered group, etc.
Reply With Quote
2 благодарности(ей) от:
Kane@airrifle, MarkFL
  #7  
Old 02-15-2016, 02:37 PM
MGO_TOM MGO_TOM is offline
 
Join Date: Nov 2009
Location: Michigan
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Skyrider View Post
Seeing the config files are clearly being ignored (I've disabled guest mode in it, not being used at all).. I took a little peak at the conf_init.php file. allowed_usergroup is not being used in it, but I assume a IF / ELSE can be used with:

Code:
$config['allowed_usergroup'] == xx
I'm not a PHP coder, but that's where I would start.

I think it's important that one or more of these codes:

Code:
defined('IN_MOBIQUO') or exit;
class mobiquo_config
function get_config()
global $vbulletin;
$config = array();
$mobiquo_config = $config;
return $mobiquo_config;
Should be in the custom PHP code if people are going to do that. But I'll take it edit the conf_init file directly "should" take effect as well.

EDIT
I've altered the conf_init.php file to set open forum to 0, and it took effect right away in the tapatalk app. As such, get the proper if / else statement in combination with:
Code:
$config['allowed_usergroup']
And in theory, it should work. But like I said, I'm not a PHP coder.. but I have some idea what to look for.


EDIT 2
config.php (in mobiquo) is not being ignored, it's tied up with conf_init.php and I already got some working code already! (newbie code though!)

For example, I used allowed_usergroup in combination with open forums mode allowed yes or no.. Open up config.php and edit the line:

Code:
'allowed_usergroup'       => '42',
Then, go to conf_init.php and add the following line (for example, below // $config['can_unread'] = 0:

Code:
if ($config['allowed_usergroup'] == 42){
            $config['is_open'] = 1;
        } else {
            $config['is_open'] = 0;
        }
And tada.. if the user on tapatalk is not part of usergroup 42, he or she will see "no topic" message. Not much familiar with what tapatalk allows or can show with custom code, but it's actually a good start to block non-usergroup 42 members on your forums.

This code is not 100% though! It still shows all the sections that are usually allowed for everyone to see, however! Every section will show "no topics" for those are are not in usergroup 42. Most likely best to combine the allowed_usergroup with hide_forum_id.

You can use every single code shown in config.php to use as a if/else statement in conf_init.php. With an advanced/expert php coder, you'll get what you want in no time. My 'code' so to speak merely helps you out a little bit.

EDIT 3:
I have the feeling that allowed_usergroup only applies and works on default vB usergroups. For some reason it doesn't work on custom groups (for me), while it works for eg, registered group, etc.
Thank you very much for your effort!

I tried it, but as I suspected, it appears that the actual vbulletin usergroup is never being referenced, rather, it is simply looking to the config.php file and evaluating a match or mismatch of the allowed_usergroup line. In other words, you could put:
Code:
'allowed_usergroup'       => '999999',
And as long as the if ($config['allowed_usergroup'] == 999999) statement matches (even though there is no such usergroup, it will treat the if/else statement as a match and process accordingly.

What is missing is an actual vbulletin database query to lookup the sign-in member's usergroup.
Reply With Quote
  #8  
Old 02-15-2016, 02:42 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try something like:

PHP Code:
if(!in_array($vbulletin->userinfo['usergroupid'], explode(","$config['allowed_usergroup']))){
    
$config['is_open'] = 0;

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:21 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04859 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (11)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (2)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete