vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   WebTemplates 3.5.x: VB Integrated CMS (Content Management System) (https://vborg.vbsupport.ru/showthread.php?t=103076)

Logician 01-15-2006 04:00 PM

Quote:

Originally Posted by Kurisu
Didn't work either... Same error.

Could it have something to do with my PHP version (5.0.5)? I read that PHP 5 handles arrays different...

Yes sounds very possible.. I never tested it with PHP 5.x..

apleschu 01-16-2006 04:43 PM

Seriously I was desperate after discovering that 3.5 doesn;t seem to have a portal system available (yet)

But even so, I like the concept of webtemplates MUCH better.

THANKS

Reef 01-17-2006 05:51 AM

Excellent mod and support Logician, Thanks

I missed this somehow when released. I just saw it listed in the H/O/M poll .. Hmm, I think I'm gonna run back over there and vote :D

tidy_boy 01-17-2006 01:46 PM

Hey guys can anyone post a link to pages they have made with this hack so i can see the power of it :D


Thanks

RaceJunkie 01-17-2006 03:21 PM

Quote:

Originally Posted by tidy_boy
Hey guys can anyone post a link to pages they have made with this hack so i can see the power of it :D


Thanks


Here you go

here

tidy_boy 01-17-2006 03:56 PM

Nice anyone else got any other examples then can show me :D

WAR 01-17-2006 05:07 PM

Quote:

Originally Posted by Logician
Edit wt_wt.php, find:

PHP Code:

print_membergroup_row("Disallowed Usergroups <br><font size='1'>Mark usergroups who can <b>NOT</b> display this page</font>"'webtemplate[banusergroupids]'2""); 

replace it as:
PHP Code:

  $usergroups $vbulletin->db->query_read("SELECT usergroupid,title FROM " TABLE_PREFIX "usergroup ORDER BY title");
  while (
$usergroup $vbulletin->db->fetch_array($usergroups))
  {
             
$usergrps_with_space .= $usergroup[usergroupid]." ";
  }
   
$webtemplatebanusergroups[membergroupids] = convert_WTfield_to_usergroup_array($usergrps_with_space);
  

  
print_membergroup_row("Disallowed Usergroups <br><font size='1'>Mark usergroups who can <b>NOT</b> display this page</font>"'webtemplate[banusergroupids]'2,  $webtemplatebanusergroups); 



Run this query and see if it will help:
PHP Code:

ALTER TABLE `wt35_webtemplateCHANGE `banusergroups` `banusergroupsMEDIUMTEXT NOT NULL ,
CHANGE `logvisitors` `logvisitorsMEDIUMTEXT NOT NULL ,
CHANGE `editors` `editorsMEDIUMTEXT NOT NULL 


Logician,

Thanks for the quick reply and the fix. It worked as far as it was designed, but unfortunately my original request was flawed.

I have 12 "Primary" usergroups. All members belong to at least one of these groups. I also have a couple hundred "Secondary" usergroups, most members belong to several of these each. Using the "Opt-out" paradigm you have here, it is impossible for me to allow access to secondary usergroups without also granting access to entire primary usergroups

Example: If a user is a member of primary group 1 and secondary group A, If I try and block access to Primary Group 1 and allow access to Secondary Group A then the user will still not be allowed access because the way you have it written all users that are in primary group 1 are denied access.

So I re-wrote your permissions function in your include file to switch the whole system to an "Opt-in" paradigm so that it better matches how vbulletin usually treats permissions. Can you take a look at this and let me know if it looks ok? I have tested it out and it seems to work fine. The only thing I needed to disable was the "Restrict individual users" function that you had, other wise granting access to a user with userid = 20 also grants access to the usergroup with usergroupid = 20.

PHP Code:

function WT_UsergroupPermission($userinfo$return10 1$usergroupname '')
{
    global 
$WT;  

    
$permitted 0;

    
$WT['banusergroups'] = trim($WT['banusergroups']);

    if (
$WT['banusergroups'])
    {
        
$WT_banusergroups explode(" "$WT['banusergroups']);
        
        if (
WTis_member_of($userinfo$WT_banusergroups)) 
        {
            
$permitted 1;
        } 
        else 
        {
            
$permitted 0;
        }
        
    
/*    if ($userinfo[userid] > 0 AND in_array('('.$userinfo[userid].')', $WT_banusergroups)) 
        {
            $permitted = 0;
        } */
    
}


    
    if (
$WT['draft'] == AND !WTis_member_of($userinfo, array("6"))) //draft webtemplate
    
{
        
$permitted 0;
    }

    if (
$return10//return 1 or 0
    
{
        return 
$permitted;
    }
    else 
//return usergroup name with color (permitten green, banned red)
    
{
        if (
$permitted
        {
            return 
'<font color="#006600">'.$usergroupname.'</font>';
        }
        else 
        {
            return 
'<font color="#C40000">'.$usergroupname.'</font>';
        }
    }




Logician 01-17-2006 07:41 PM

Quote:

The only thing I needed to disable was the "Restrict individual users" function that you had, other wise granting access to a user with userid = 20 also grants access to the usergroup with usergroupid = 20.
I really don't think so. Individual user info is kept between paranthesis () and checked this way too. So if you grant access to userid 20, the DB record is (20) but if you grant access to usergroupid, the record is just 20.

The section you commented out checks for paranthesis too so I wouldn't think it is allowing usergroupid 20 when you allowed userid 20.

Quote:

Example: If a user is a member of primary group 1 and secondary group A, If I try and block access to Primary Group 1 and allow access to Secondary Group A then the user will still not be allowed access because the way you have it written all users that are in primary group 1 are denied access.
I see what you are saying but this algorithm matches with its logic. Because this section of the hack is for marking "banned" usergroups so when you mark a usergroup, this means the hack shouldn't give access to any user who is part of this group. If the hack would give access due to that users belonging to another usergroup, it would be impossible to ban primary usergroups as their users might get access due to secondary usergroups which they join themselves.

I'm sure you'll agree that most of the admin's permission system would depend on "primary usergroups", not "secondary usergroups" so IMO how it is designed is make sense. :)

WAR 01-17-2006 08:38 PM

I never meant to imply that it worked any way other than what you intended. It is an exceptionally well-written hack. For my own purposes though, I need it to work a different way, I just wanted to have you look over what I did above for a sanity check.

Thanks for clarifying the issue with the ()'s and the individually specified users, it makes much more sense that what I had assumed was going on.

Quote:

If the hack would give access due to that users belonging to another usergroup, it would be impossible to ban primary usergroups as their users might get access due to secondary usergroups which they join themselves.
This is why vbulletin lets you designate a primary usergroup to not allow inherited permissions from any secondary groups for its in-built group permissions.

Again, this is an incredible hack, many thanks for sharing!

Bluestrike2 01-18-2006 01:38 AM

I hate to be a bother, but I'm in need of some help. I searched through the support document, and I've skimmed most of this thread. I'm sorry if this has been asked before.

BUT - I was wondering how could I use the two column theme, but have the content of the one column user-editable while keeping it "moron proof." Actually, if there was a way for them to enter the number (its for scrim record) in a text box, that would be grande (and then another text box to enter the teams they scrimmed).

Also, is it possible to add another user editable field (editor I mean) that would show up another main table (for lack of a better word). If you need clarification, I'll post it. Thank you so much!


All times are GMT. The time now is 01:53 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.01843 seconds
  • Memory Usage 1,778KB
  • 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
  • (4)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete