MyBB Community Forums
How to create Custom Admin Premissions - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Resources (https://community.mybb.com/forum-8.html)
+--- Forum: Tutorials (https://community.mybb.com/forum-38.html)
+--- Thread: How to create Custom Admin Premissions (/thread-7843.html)

Pages: 1 2


How to create Custom Admin Premissions - MMouse - 2006-03-28

Hi on my board I added custom admin premissions! Here I will show you how.

Difficulty: Moderate
Time Required: About 15 minutes if you know what you are doing
Tech Requirements: A text editor, phpMyAdmin, and access to your web host

In this tutorial we will show you have to make an Admin Premission that will disallow or allow Admins to ban users. Things in blue is what you would like the premission to be (such as: can edit bad words). This may get confusing at times so pay attention and if necessairy ask questions on this thread.

To begin open up ./admin/adminoptions.php

Find this code:
"canedithelp" => addslashes($newperms['canedithelp']),

After that add:

"canbanusers" => addslashes($newperms['canbanusers']),

Find:

makeyesnocode($lang->can_manage_helpdocs, "newperms[canedithelp]", $permissions['canedithelp']);

After that add:

makeyesnocode($lang->can_ban_users, "newperms[canbanusers]", $permissions['canbanusers']);

Save that...

***Pay attention here***

Open up ./admin/users.php

Go to the end of the admin function you want to add the new premission for and add:
checkadminpermissions("canbanusers");

Then go to phpMyAdmin

Click on your MyBB database, then click on the Table "mybb_adminoptions"

Then click on Add 1 Fields twoards the botom of the page.
Click "Go"

For the name of the new table put "canbanusers"
Type: Char
Length/Values: 3

Click Save

If everything went ok you should have a new admin premission!

If you had any trouble try again if you still cant get it post here,

Good Luck and enjoy Smile


RE: How to create Custom Admin Premissions - asa_201 - 2006-05-15

Very nice and although i have no idea what today as i have no knowledge well i have text editor, access to the files and phpmyadmin so i will give it a try as i would like to stop my admins doign some things, so lets just hope i do not ruin my forum Toungue


RE: How to create Custom Admin Premissions - methulah - 2006-05-28

That's a highly needed modification on many forums. Congratulations on a great tutorial!


RE: How to create Custom Admin Premissions - tristan/SMM - 2006-07-04

So if I do this, than if I give someone access to the adminCP and I set all permissions including can manage users (which includes banning) to no except for the can ban users permission which is the only one set to yes, the person will only be able to ban and everything will be fine?


Question about a modification. Can't get an answer anywhere else! - tristan/SMM - 2006-07-06

Was just wondering about a mod posted in the user submitted tutorials section. It was adding custom admin permissions (http://community.mybboard.net/showthread.php?tid=7843). Here's what I was wondering, I wanted to do what was demonstrated which was making can ban users a custom admin permission, if I follow all instructions, here's what I'm wondering about: Banning is covered under the "can manage users" permisson which I don't want people below me doing but I want them to be able to ban. If all permissions are set to "No" with the exception of the new "can ban users" permission, would the "no" set in can manage users which banning is part of interfere? Or if you say they can ban users but nothing else, there won't be problems. Click on the link I provided in this paragraph for more detail so I can finally get an answer to my question.

Thanks!!


RE: How to create Custom Admin Premissions - tamilparks - 2006-08-21

Ok thanks but when a member is submitting a thread its in awaiting why? How can I change this permission


RE: How to create Custom Admin Premissions - Christian - 2006-08-21

tamilparks Wrote:Ok thanks but when a member is submitting a thread its in awaiting why? How can I change this permission

This has nothing to do with members, this is a admin permission that only applys to the acp.


RE: How to create Custom Admin Premissions - DiageoLiam - 2006-08-27

I get this: Parse error: syntax error, unexpected '[', expecting T_STRING or T_VARIABLE or '{' or '$' in /home/unique/public_html/forum/admin/adminoptions.php on line 131


RE: How to create Custom Admin Premissions - Christian - 2006-08-27

DiageoLiam, please start over with the following tutorial. I have removed the [color] mycode.
Quote:Hi on my board I added custom admin premissions! Here I will show you how.

Difficulty: Moderate
Time Required: About 15 minutes if you know what you are doing
Tech Requirements: A text editor, phpMyAdmin, and access to your web host

In this tutorial we will show you have to make an Admin Premission that will disallow or allow Admins to ban users. Things in blue is what you would like the premission to be (such as: can edit bad words). This may get confusing at times so pay attention and if necessairy ask questions on this thread.

To begin open up ./admin/adminoptions.php

Find this code:
"canedithelp" => addslashes($newperms['canedithelp']),

After that add:

"canbanusers" => addslashes($newperms['canbanusers']),

Find:

makeyesnocode($lang->can_manage_helpdocs, "newperms[canedithelp]", $permissions['canedithelp']);

After that add:

makeyesnocode($lang->can_ban_users, "newperms[canbanusers]", $permissions['canbanusers']);

Save that...

***Pay attention here***

Open up ./admin/users.php

Go to the end of the admin function you want to add the new premission for and add:
checkadminpermissions("canbanusers");

Then go to phpMyAdmin

Click on your MyBB database, then click on the Table "mybb_adminoptions"

Then click on Add 1 Fields twoards the botom of the page.
Click "Go"

For the name of the new table put "canbanusers"
Type: Char
Length/Values: 3

Click Save

If everything went ok you should have a new admin premission!

If you had any trouble try again if you still cant get it post here,

Good Luck and enjoy Smile



RE: How to create Custom Admin Premissions - Kodaks - 2006-08-27

Christian Wrote:DiageoLiam, please start over with the following tutorial. I have removed the [color] mycode.
Quote:Hi on my board I added custom admin premissions! Here I will show you how.

Difficulty: Moderate
Time Required: About 15 minutes if you know what you are doing
Tech Requirements: A text editor, phpMyAdmin, and access to your web host

In this tutorial we will show you have to make an Admin Premission that will disallow or allow Admins to ban users. Things in blue is what you would like the premission to be (such as: can edit bad words). This may get confusing at times so pay attention and if necessairy ask questions on this thread.

To begin open up ./admin/adminoptions.php

Find this code:
"canedithelp" => addslashes($newperms['canedithelp']),

After that add:

"canbanusers" => addslashes($newperms['canbanusers']),

Find:

makeyesnocode($lang->can_manage_helpdocs, "newperms[canedithelp]", $permissions['canedithelp']);

After that add:

makeyesnocode($lang->can_ban_users, "newperms[canbanusers]", $permissions['canbanusers']);

Save that...

***Pay attention here***

Open up ./admin/users.php

Go to the end of the admin function you want to add the new premission for and add:
checkadminpermissions("canbanusers");

Then go to phpMyAdmin

Click on your MyBB database, then click on the Table "mybb_adminoptions"

Then click on Add 1 Fields twoards the botom of the page.
Click "Go"

For the name of the new table put "canbanusers"
Type: Char
Length/Values: 3

Click Save

If everything went ok you should have a new admin premission!

If you had any trouble try again if you still cant get it post here,

Good Luck and enjoy Smile
I updated the first post. Smile