vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Post Icons Permission (https://vborg.vbsupport.ru/showthread.php?t=168520)

ZomgStuff 01-23-2008 12:41 AM

Post Icons Permission
 
I have this in posting.php in the "start do open / close thread" section.
PHP Code:

//Change threadicon to "locked"
    
if ($action == $vbphrase['closed']) {
        
$threadman =& datamanager_init('Thread'$vbulletinERRTYPE_STANDARD'threadpost');
        
$threadman->set_existing($threadinfo);
        
$threadman->set('iconid''65');
        
$threadman->save();
    } else if (
$action == $vbphrase['opened']){
        
$threadman =& datamanager_init('Thread'$vbulletinERRTYPE_STANDARD'threadpost');
        
$threadman->set_existing($threadinfo);
        
$threadman->set('iconid''31');
        
$threadman->save();
    } 

I force thread/post icons, and I have two different sets, one set for normal users, and another set for admins and mods. I have a "locked" thread/posticon that only admins and mods can select.

When I try to open any thread the icon changes just fine to the appropriate one (icon #31). But when I try to close a thread, it will set the thread icon to locked only if the thread starter was an admin or mod (who are the only ones allowed to select it when creating a thread), and for the others who aren't mods the threadicon is just blank and in the database it becomes "0" as opposed to 65, which is the locked icon id.


Any idea where this permission checking is coming from, and how I can get around it?

Thanks!

Antivirus 01-23-2008 11:21 AM

This is due to the verify icon function within the datamanager.

ZomgStuff 01-23-2008 11:55 AM

Is there a way to ignore it? Or should I just just do a SQL query?

Antivirus 01-23-2008 05:22 PM

You need to override the icon permission check within the DM. Check out post #5 in this thread.

I just had a similar issue and this worked for me.

ZomgStuff 01-23-2008 07:28 PM

Quote:

Originally Posted by Antivirus (Post 1427484)
You need to override the icon permission check within the DM. Check out post #5 in this thread.

I just had a similar issue and this worked for me.

ZomgStuff, you do not have permission to access this page. This could be due to one of several reasons:

1. Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Antivirus 01-24-2008 07:23 PM

You need to override the permission check within the thread datamanager by reassigning the value of the $validfields array like this...

PHP Code:

if ($myhack)
{
     
$this->validfields['iconid']    = array(TYPE_UINTREQ_NO);


So you need to create a plugin in the threaddata_start hook with the above code.

You need to use a conditional however (replace $myhack) with your own conditional which will ensure that the override is only executed when you want it to, and not all the time.

ZomgStuff 01-25-2008 12:54 AM

Thank you so much!


All times are GMT. The time now is 07:42 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.01045 seconds
  • Memory Usage 1,735KB
  • 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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