Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#31 2009-10-20 12:50:17
- kevinpotts
- Member

- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: bot_privs: edit user level privileges
Oops sorry that’s not true. I wrote this plugin many months ago and I forgot some of the problems I faced at the time.
Now I remember there was a problem with dots (notation used by privileges in admin_config.php) and underscores (notation used with function names). So, to make it short, I’m sorry but I think the best way (at least for now) is to directly modify the code, as you are already doing.
Great plugin; very useful. So in order to hide specific Extensions tabs from users, I need to look for this line:
add_privs('bot_privs_tab', '1,2');
The above will display the bot_privs tabs to anyone with the level of Publisher or Managing Editor, and if I add a “3” into the string, Copy Editors would be able to see it? I just want to make sure I understand it correctly.
Kevin
(graphicpush)
Offline
#32 2009-10-20 13:42:08
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
kevinpotts wrote:
Great plugin; very useful.
Thank you!
So in order to hide specific Extensions tabs from users, I need to look for this line…
Kevin, this line determines only which user levels can see the “bot_privs” tab, not other “extensions” sub-tabs.
IIRC you don’t have to modify the code because you can set this directly in the plugin preferences (see the last item of the list).
Please note that I have access to a slightly modified version of the plugin now so I hope I’m not mistaken.
In case I’ll upload the last version (which I updated then lost on my computer… I’m very untidy).
Conversely, if what you are looking for is the ability to add other privileges to the plugin (for example regarding the other “extensions” sub-tabs – which I didn’t include because they are dependant on the installed plugins) you should be able to do it by just adding one line to the code: if this is what you want I’ll show you how (sorry I have to re-examine the code – I forgot what I have written)
The above will display the bot_privs tabs to anyone with the level of Publisher or Managing Editor, and if I add a “3” into the string, Copy Editors would be able to see it? I just want to make sure I understand it correctly.
See the answer above – you just have to set preferences to do it.
Offline
#33 2009-10-20 13:58:22
- kevinpotts
- Member

- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: bot_privs: edit user level privileges
Kevin, this line determines only which user levels can see the “bot_privs” tab, not other “extensions” sub-tabs.
Understood. I just meant looking for that specific call in other admin-side plugins to show/hide from different user levels.
Conversely, if what you are looking for is the ability to add other privileges to the plugin (for example regarding the other “extensions” sub-tabs – which I didn’t include because they are dependant on the installed plugins) you should be able to do it by just adding one line to the code: if this is what you want I’ll show you how (sorry I have to re-examine the code – I forgot what I have written)
This is what I was looking for. And I do not see anything in preferences to make the modification.
Kevin
(graphicpush)
Offline
#34 2009-10-20 14:27:23
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
kevinpotts wrote:
I just meant looking for that specific call in other admin-side plugins to show/hide from different user levels.
Ok, I was confused by the snippet you posted (add_privs('bot_privs_tab', '1,2');).
So – if this time I understood it correctly – the answer is yes, you can choose to show/hide specific plugin tabs by modifying that line in each plugins code (but this has nothing to do with bot_privs) . Of course the code varies depending on the plugin, so for example for hak_tinymce you’ll write add_privs('hak_tinymce_prefs', '1,2,3'); in hak_tinymce code
In my previous answer I thought you wanted to achieve this functionality directly in the bot_privs preferences tab (and in this case you have to add one line in the bot_privs code).
Offline
#35 2009-10-20 15:08:19
- kevinpotts
- Member

- From: Ghost Coast
- Registered: 2004-12-07
- Posts: 370
Re: bot_privs: edit user level privileges
redbot wrote:
In my previous answer I thought you wanted to achieve this functionality directly in the bot_privs preferences tab (and in this case you have to add one line in the bot_privs code).
That would be great if you could share that.
Kevin
(graphicpush)
Offline
#36 2009-10-20 16:23:50
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
Ok, try version 0.3.2.
This doesen’t introduce new ‘official’ features but let’s you easily hack the plugin to add new privileges (go to “plugins” tab > bot_privs > edit and look around line 62 for a brief explanation)
Offline
#37 2009-11-16 08:55:05
- Ldx
- Member
- Registered: 2009-10-24
- Posts: 15
Re: bot_privs: edit user level privileges
redbot, thank you for this useful plugin!
Aldo
Offline
Re: bot_privs: edit user level privileges
Is there hope that this level of admin rights can be added to TxP native?
…. texted postive
Offline
#39 2010-02-26 19:05:03
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
bici wrote:
Is there hope that this level of admin rights can be added to TxP native?
Hi Giovanni,
which level? Sorry I don’t understand your request…
edit
Ah ok, now I see your other post. But, again, I can’t answer your question because I’m not a developer.
Last edited by redbot (2010-02-26 19:08:29)
Offline
#40 2010-07-04 19:01:21
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: bot_privs: edit user level privileges
Hi redbot, after installing the plugin and clicking ‘Install’ in the bot_privs tab in Extensions, I just see this:
bot_privs upgrade
bot_privs must be upgraded. Use the button below to add the new fields to the preferences table.
with a button ‘Upgrade’. But nothing happens if I click it, any idea what the problem could be? Using v. 0.3.2.
Offline
#41 2010-07-04 19:11:33
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
Els wrote:
… But nothing happens if I click it, any idea what the problem could be? Using v. 0.3.2.
Hi Els,
I’m not playing with this plugin from a lot of time so I don’t remember perfectly his inner workings.
Anyway is there any chance you installed it before (maybe with an older txp version) and than removed it without following the uninstalling procedure (which removes the bot_privs table)?
If you don’t see an uninstall button can you try to delete the table in phpmyadmin and see if it changes something (it should)?
Offline
#42 2010-07-04 19:25:19
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: bot_privs: edit user level privileges
This was the first time ever I installed the plugin ;) I don’t see an ‘Uninstall’ button, so I dropped the bot_privs table, and tried to install again. No change… :( It doesn’t add columns to the txp_prefs table, and it keeps telling me that bot_privs must be upgraded.
Offline
#43 2010-07-04 22:06:50
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
That’s so strange, can’t find a reason for this.
More specifically, the function which outputs the upgrade message first checks if there is a table called ‘txp_bot_privs’.
If it is true, then checks again for the existance of the entry ‘file.edit’ in the ‘pref_name’ column.
This is because this privilege was added with txp 4.2 so, if such an entry doesen’t exist, it implies the table was created with a previous version and the upgrade message appears (I hope its clear enough).
So in your case it detects the existance of the table but can’t find ‘file.edit’ entry. It seems like you are trying to install it in a pre-txp4.2 site, which of course is not the case…
Just out of curiosity, do you see entries such ‘file.edit’ or ‘image.edit’ in the ‘txp_bot_privs’ table?
Offline
#44 2010-07-04 22:17:28
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: bot_privs: edit user level privileges
redbot wrote:
It seems like you are trying to install it in a pre-txp4.2 site, which of course is not the case…
OMG, this is embarrassing… I must have forgotten to upgrade this particular site, it’s still on 4.0.8 :( I’m really sorry that I wasted your time!
(…rushing off trying to become invisible, and to upgrade…)
Offline
#45 2010-07-04 22:21:51
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_privs: edit user level privileges
Els wrote:
OMG, this is embarrassing… I must have forgotten to upgrade this particular site, it’s still on 4.0.8 :( I’m really sorry that I wasted your time!
(…rushing off trying to become invisible, and to upgrade…)
;-)
BTW if you don’t want to upgrade you can always use v. 0.2
Offline