FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Permissions in user-land group manager.
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Permissions in user-land group manager. [message #160756] Wed, 21 October 2009 17:52 Go to next message
nozafc is currently offline  nozafc   
Messages: 75
Registered: April 2009
Karma: 0
Member
If I wanted to add extra permissions in User Land manager what steps would need to be taken to achieve this

For example there is currently a permission that allows/disallows users from using the [img] tag etc. If I wanted to add an extra permission to allow/disallow users from using the [youtube] tag then how would I go about it ?

[Updated on: Wed, 21 October 2009 17:54]

Report message to a moderator

Re: Permissions in user-land group manager. [message #160757 is a reply to message #160756] Wed, 21 October 2009 18:17 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3772
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
I haven't done it myself, so I cannot help, but it would be great if you can document whatever you find out.

Best of luck!
Re: Permissions in user-land group manager. [message #160758 is a reply to message #160756] Wed, 21 October 2009 18:19 Go to previous messageGo to next message
nozafc is currently offline  nozafc   
Messages: 75
Registered: April 2009
Karma: 0
Member
Ok thanks, I'll start sifting through the existing code for the [img] tag
Re: Permissions in user-land group manager. [message #160759 is a reply to message #160756] Wed, 21 October 2009 20:21 Go to previous message
nozafc is currently offline  nozafc   
Messages: 75
Registered: April 2009
Karma: 0
Member
Ok so I'm making a little headway

Steps taken so far

Added the following line to the msg file

p_youtube:		Use Youtube Tags


Added the following to the groupmgr.tmpl

{SECTION: p_YOUTUBE}
{MSG: p_YOUTUBE}
{SECTION: END}


Added the following to groupmgr.php.t

Quote:
/* translated permission names */
$ts_list = array(
'p_VISIBLE'=>'{TEMPLATE: p_VISIBLE}',
'p_READ'=>'{TEMPLATE: p_READ}',
'p_POST'=>'{TEMPLATE: p_POST}',
'p_REPLY'=>'{TEMPLATE: p_REPLY}',
'p_EDIT'=>'{TEMPLATE: p_EDIT}',
'p_DEL'=>'{TEMPLATE: p_DEL}',
'p_STICKY'=>'{TEMPLATE: p_STICKY}',
'p_POLL'=>'{TEMPLATE: p_POLL}',
'p_FILE'=>'{TEMPLATE: p_FILE}',
'p_VOTE'=>'{TEMPLATE: p_VOTE}',
'p_RATE'=>'{TEMPLATE: p_RATE}',
'p_SPLIT'=>'{TEMPLATE: p_SPLIT}',
'p_LOCK'=>'{TEMPLATE: p_LOCK}',
'p_MOVE'=>'{TEMPLATE: p_MOVE}',
'p_SML'=>'{TEMPLATE: p_SML}',
'p_IMG'=>'{TEMPLATE: p_IMG}',
'p_YOUTUBE'=>'{TEMPLATE: p_YOUTUBE}',
'p_SEARCH'=>'{TEMPLATE: p_SEARCH}');


Added the following to groups.inc.t

Quote:
function group_perm_array()
{
return array(
'p_VISIBLE' => array(1, 'Visible'),
'p_READ' => array(2, 'Read'),
'p_POST' => array(4, 'Create new topics'),
'p_REPLY' => array(8, 'Reply to messages'),
'p_EDIT' => array(16, 'Edit messages'),
'p_DEL' => array(32, 'Delete messages'),
'p_STICKY' => array(64, 'Make topics sticky'),
'p_POLL' => array(128, 'Create polls'),
'p_FILE' => array(256, 'Attach files'),
'p_VOTE' => array(512, 'Vote on polls'),
'p_RATE' => array(1024, 'Rate topics'),
'p_SPLIT' => array(2048, 'Split/Merge topics'),
'p_LOCK' => array(4096, 'Lock/Unlock topics'),
'p_MOVE' => array(8192, 'Move topics'),
'p_SML' => array(16384, 'Use smilies/emoticons'),
'p_IMG' => array(32768, 'Use [img] tags'),
'p_YOUTUBE' => array(65536, 'Can use [youtube] tags'),
'p_SEARCH' => array(262144, 'Can Search')

);
}


This has so far got me the option ready and available to be selected

http://i35.tinypic.com/11iq26u.png

This is where things start get confusing (for me anyway)

The values (if yes) in the above array when added together seem to get stored in the fud30_group_cache table against a specific user ID. For example I have all options set as yes against my user ID and the value held in the table is 393215. This can be seen as the sum 1+2+4+8+16+32+64+128+256+512+1024+2048+4096+8192+16384+32768+65536+262144

My problem now appears to be that when I try and set the option to NO then nothing happens it just reverts back to Yes. Once that is solved I've no idea actually how to use the user options table

I'll update this as I find out more or if anybody has any suggestions
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ID of the destination topic
Next Topic: Start From Scratch?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 05 02:49:48 GMT 2024

Total time taken to generate the page: 0.02360 seconds