vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Would this work? (https://vborg.vbsupport.ru/showthread.php?t=152417)

cheat-master30 07-16-2007 01:58 PM

Would this work?
 
As in, be possible to make, be secure and be a good idea? Because I have an idea that would require both a custom profile field and an if statement, and it seems like a clever way to allow users to define who can access their profile.

What it would do is add an if statement into their profile which checks if those accessing the page are of a group the individual user defined in a custom profile field. For example, something like:

<if condition=[insert code for usergroup identification here]
Show content
else
whatever or something, and would use something like $post[fieldX] with X having the usergroup ids allowed to access their profile (of course, it would still allow the admin to access the profiles) such as allowing users to decide if members, mods, custom usergroups, guests etc could view their own profile.

Now, I'm sure the modification I am already using has this for friends/totally private/everyone settings, but would allowing a user to define usergroups able to access his/her profile other than the admin be a good idea, or secure, or helpful?

EnIgMa1234 07-17-2007 02:19 PM

PHP Code:

<if condition="is_member_of($bbuserinfo$userinfo[fieldx])">
ALLOWED CODE
<else />
NOT ALLOWED CODE
</if> 

Add that into your memberinfo template

Kirk Y 07-17-2007 02:48 PM

It'd probably be smarter to use a plugin and then return a permission error, rather than having to deal with entire template-sized conditionals.

EnIgMa1234 07-17-2007 02:50 PM

My way was the really basic way but Kirk is right, it would be smarter to use a plugin


All times are GMT. The time now is 05:29 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01028 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete