MyBB Community Forums

Full Version: How to create Custom Admin Premissions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
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
That's a highly needed modification on many forums. Congratulations on a great tutorial!
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?
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!!
Ok thanks but when a member is submitting a thread its in awaiting why? How can I change this permission
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.
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
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
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
Pages: 1 2