Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
CES Parser Permissions Details »»
CES Parser Permissions
Version: 2.2.3, by thincom2000 thincom2000 is offline
Developer Last Online: Sep 2022 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.x Rating:
Released: 02-04-2007 Last Update: 11-07-2010 Installs: 59
DB Changes Uses Plugins Auto-Templates
Additional Files  
No support by the author.

CES Parser Permissions
vBulletin 3.6.x, 3.7.x, 3.8.x, 4.0.x supported
Version: 2.2.3

If you encounter what you think may be a bug, please include your vBulletin version number when reporting it, since code and fixes differ greatly from 3.6.4 - 3.8.x.

*** NEWS ***
11/8/2010 - 2.2.3 released
5/15/2010 - 2.2.2 released
4/12/2009 - 3.6.x thread separated

Known Issues:
- If you are using the Advanced BB-Code Permissions hack, conflicts can arise when profile fields are parsed in the postbit, causing nothing be parsed. The fix is described here: https://vborg.vbsupport.ru/showthread.php?p=1252480

What It Does:
Allows you to grant only certain usergroups the ability to use HTML, BB-code, smilies, and IMG-code in their profile fields, posts, PMs, and in Project Tools.

Mod Features:
- parse profile fields on user profiles using Usergroup Permissions
- parse profile fields in postbits using Usergroup Permissions
- parse posts using Usergroup Permissions
- parse calendar events using Usergroup Permissions
- parse private messages using Usergroup Permissions
- parse Project Tools issues and replies using Usergroup Permissions
- parse Social Messages and usernotes using Usergroup Permissions
- complete Forum Rules integration
- disallow certain HTML tags

Products to Install: 1
Files to Upload: 3
Files to Edit: 0
Template Edits: 0

*** Changelog ***
As of Version 2.2.3
  • non-forum messages don't parse
  • poll options don't parse

As of Version 2.2.2
  • several bug fixes
  • compatible with VaultWiki 2.5.7 PL 1 & 3.0.0 RC 3

* This mod is offered for free here. Please donate if you like this mod *

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #122  
Old 02-22-2008, 12:26 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well if this next build of mine still has issues for you, then I would probably have to see your code to know for sure.
Reply With Quote
  #123  
Old 02-22-2008, 04:59 PM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Strangely enough, I still have this problem if I disable my mod and just use the standard About Me. The problem seems to be that when the bbcode_parse_start hook is called, class_bbcode.pl, the $bbfoo variables are undefined because of these lines:

PHP Code:
            default:
                if (
intval($forumid))
                {
                    
$forum fetch_foruminfo($forumid);
                    
$dohtml $forum['allowhtml'];
                    
$dobbimagecode $forum['allowimages'];
                    
$dosmilies $forum['allowsmilies'];
                    
$dobbcode $forum['allowbbcode'];
                }
                
// else they'll basically just default to false -- saves a query in certain circumstances
                
break; 
... because $forumid is set to 'ces_profile' (not an intval), so as the comment says, they default to false. So then when we hit this part of ces_permissions_parse():

PHP Code:
        $dobbcode = ($check_ugp['can_bbcode_' $parser->ces_options['check_type']] AND $dobbcode);
        
$dosmilies = ($check_ugp['can_smilies_' $parser->ces_options['check_type']] AND $dosmilies);
        
$dobbimagecode = ($check_ugp['can_imgcode_' $parser->ces_options['check_type']] AND $dobbimagecode);
        
$dohtml = ($check_ugp['can_html_' $parser->ces_options['check_type']] AND $dohtml); 
... they of course all end up false, because none of the $bbfoo variables are true.

I'm puzzled how this could be working for anybody, unless I somehow have an older version of the code?

-- hugh
Reply With Quote
  #124  
Old 02-22-2008, 05:55 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Because $forumid is set to 'ces_profile', yes you are correct that $dofoo all default to false. However, the permissions for 'ces_profile' are cached before entering $bbcode->parse, so the CES Permissions skips the entire $dofoo = ($checkugp AND $dofoo) branch (see function ces_permissions_customfields to verify).

PHP Code:
$pf_parser->ces_options['ces_profile'][$userinfo['userid']] = convert_bits_to_array($userinfo['permissions']['ces_parser_permissions'], $vbulletin->bf_ugp['ces_parser_permissions']); 
This is then caught in ces_permissions_parse by:
PHP Code:
if (!empty($parser->ces_options["$forumid"][$parser->ces_options['current_userid']])) 
and refills $bbfoo with the appropriate values.
Reply With Quote
  #125  
Old 02-22-2008, 07:46 PM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Which would be OK, if these lines:

PHP Code:
    if ($post['userid'] AND $parser->ces_options['current_userid'] != $post['userid'])
    {
        
$parser->ces_options['current_userid'] = $post['userid'];
    } 
... weren't resetting current_userid to the id of whoever happened to post the last Visitor Message.

So the code after that is looking for the wrong cached permissions, not finding them, and executing the wrong branch (the stuff that AND's with the $bbfoo's).

EIDT ... changing that 'if' to this seems to fix it.

PHP Code:
    if ($forumid != 'ces_profile' AND $post['userid'] AND $parser->ces_options['current_userid'] != $post['userid']) 
Although as before, I haven't done any corner case testing, so who knows if that'll break something else ...

-- hugh
Reply With Quote
  #126  
Old 02-23-2008, 02:02 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah thank you. Fixed in next build.
Reply With Quote
  #127  
Old 02-23-2008, 06:39 AM
cheesegrits's Avatar
cheesegrits cheesegrits is offline
 
Join Date: May 2006
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem. I really like this mod, and I want to make my AboutMe stuff "CES Permissions aware", so I look forward to the next build. If you'd like me to do some pre-release testing, PM me and I'll give you my email.

-- hugh
Reply With Quote
  #128  
Old 02-24-2008, 11:59 AM
Caerydd's Avatar
Caerydd Caerydd is offline
 
Join Date: Mar 2006
Location: UK
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This looks great. However, as you have to enable html for all forums - the posting rules will show html 'on' for usergroups that don't have permission to post html. Anyway around this, save hiding posting rules?
Reply With Quote
  #129  
Old 02-24-2008, 04:06 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is a plugin in the product that should take care of the posting rules. Is this just speculation of yours or can you confirm that the posting rules are not updated?
Reply With Quote
  #130  
Old 02-24-2008, 09:15 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A number of plugins had to be added in order to circumvent the default VM restrictions, and I believe I had to break the "bb-code X is not allowed" error system, but I have made the VM system flexible so that individual BB-Codes can be disabled and simply won't parse (or appear in the editor).

@ cheesegrits, I made some small changes to the forumrules plugin since I sent you the test version.
Reply With Quote
  #131  
Old 02-25-2008, 02:33 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, for the users who experience a blank page on member.php, this has been confirmed to be a result of running PHP 4 when there is a call to a function that didn't exist until PHP 5. Until the next update, you can fix this issue by adding the following code under the header of the includes/ces_permissions.php file:
PHP Code:
if (!function_exists('htmlspecialchars_decode'))
{
    function 
htmlspecialchars_decode($string$quote_style ENT_COMPAT)
    {
        return 
strtr($stringarray_flip(get_html_translation_table(HTML_SPECIALCHARS$quote_style)));
    }

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 12:03 AM.


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.09019 seconds
  • Memory Usage 2,337KB
  • Queries Executed 25 (?)
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
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete