PDA

View Full Version : Add-On Releases - CMS Disabler


Trek
12-17-2009, 10:00 PM
Reason why I wrote this mod

When vB4 gold comes out, I'd like to switch to it, get my forums working first and foremost. While that work is going on, I have content authors that need to create content, but I don't want this done on a live site where my users can see them working. I also need to skin the CMS, etc.

Once things are skinned, content is written, all of that. I want to simply "turn it on" and everything is live and ready to go.

What this mod does
Allows you to set usergroups that can access your CMS.
If a user is not of this usergroup, they are forwarded to the forums.php page.
It will not display the "Home" button on the tabnav if the user is not in the allowed usergroups list as well.Notes

Thanks


BirdOPrey5, for updating the mod to work with vb 4.2 as well as fixing some other issues. I'm no longer supporting the mod and the code is reusable and I've updated the download to reflect his code/changes.

To Lynne for telling me what I needed to do when I asked the question, but not specifically telling me how to do it (doing it for me). Learning is fun, sometimes. ;)


Installation:

Install the XML as you would any other vB mod.

Trek
12-18-2009, 09:39 PM
This is a simple mod, but I figured maybe someone else could use it. Please let me know if you have any issues with it or suggestions. I'm a rookie at this so polite suggestions are welcome. =)

Added a quick update, no functionality changes, just made the settings pages look a little cleaner/understandable.

Trek
12-18-2009, 10:43 PM
Ouch, 1 star... what's wrong with it? heh

Is it not working or something?

cosy
12-18-2009, 11:04 PM
i dont know if is needed because u can have a forum section for that and then when the content is ready just copy+paste

Trek
12-18-2009, 11:11 PM
i dont know if is needed because u can have a forum section for that and then when the content is ready just copy+paste

Right, but this way the entire CMS doesn't show up, ever, for those without access to it. So you can skin it, etc all behind the scenes.

Not really a big deal, I wrote it for myself as I find it useful, but... a 1 star... OUCH! heh

Merjawy
12-18-2009, 11:31 PM
Haven't really looked around 4.0 that much.
I didn't know you can't disable/close CMS while the forum is open.. if that is the case then by all means, this is a needed mod.. I will install... Thanks


Don't worry,, be happy !!! you got 2 now :)

halkum
12-19-2009, 12:05 AM
I like the mod as it makes it easier to disable then going into the plugins and sort through them to disable it manually.

Alfa1
12-19-2009, 01:12 AM
Its actually pretty strange that you cant disable the CMS. What if you only want to run forum, groups and blog? I think this mod is a great idea.

sebaldus
12-19-2009, 02:41 AM
Its actually pretty strange that you cant disable the CMS. What if you only want to run forum, groups and blog? I think this mod is a great idea.

Yes you can do that in the Config.php script.

Maybe a great mod, but when you are upgrade to Gold you shall remember to disable the Config.php script using: define('DISABLE_HOOKS', true);

And then you are sure that all mods are disabled when upgrade.

Otherwise is it a great mod, to disable the CMS only.

That's for sure.

I will also install it, so I easy can disable only the CMS.

Thanks.
Sebaldus.

sebaldus
12-19-2009, 03:02 AM
It's only one problems and I was shore that you could turn of the CMS using this mods.

But I can't turn it of using this mods.

Have I misunderstand something?

Regards from
Sebaldus.

sebaldus
12-19-2009, 03:05 AM
Edited of me, because I can't get the the mod works as I thought it would?

Still can still access CMS, without double click.

So I must had misunderstand it totally.
Sebaldus

Trek
12-19-2009, 03:44 AM
Edited of me, because I can't get the the mod works as I thought it would?

Still can still access CMS, without double click.

So I must had misunderstand it totally.
Sebaldus

Sebaldus, how are you attempting to access the CMS page?

By default I've set the mod to allow admins (usergroup 6), so unless you change that, you'll be able to get in by default.

buontaiviem
12-19-2009, 05:33 AM
Default setting of CMS had a permision setting to do that. Didn't need this mod!

sebaldus
12-19-2009, 05:53 AM
Sebaldus, how are you attempting to access the CMS page?

By default I've set the mod to allow admins (usergroup 6), so unless you change that, you'll be able to get in by default.

Hi
I use Admin who are user group 6 as default.

So if U are Admin, you don't have to double click for getting access?

Maybe I shall send U a PM little later and let you get access to my forum so U can see if there maybe are other mod who make problems with this?

I have fellow your instruction total and are driving a Norwegian support forums for install, support, design and such things.

This are the first mod as I have had problems with or really don't understand.

So it's enough me who not understand the meaning of this mod.. :D

Have a really wonderful Christmas my forums friend.

All the best from Sebaldus.:up:

Merjawy
12-19-2009, 05:55 AM
As I said before, I haven't looked around 4.0 much so I didn't know if you could or not

I did check the permission and yes you can use permissions to close CMS indeed

Vaupell
12-19-2009, 10:39 AM
Yes you can do that in the Config.php script.

Maybe a great mod, but when you are upgrade to Gold you shall remember to disable the Config.php script using: define('DISABLE_HOOKS', true);

And then you are sure that all mods are disabled when upgrade.

Thanks.
Sebaldus.

Disable hooks does not disable this, cause by editing the .php files.
So your hardcodeing it.

Trek, in mod settings remove the "template edit" templates are editied through admincp,
cant remember if there is a file edit selection :D

but if your upgrading, you are "overwriting" this mod, so if you want to use it
after a upgrade, remember to change the require again..

SillyAlien
12-19-2009, 06:15 PM
If they haven't sorted something like this out natively by the time Gold comes out, I'm sold on this mod. Thanks!

To a couple of the previous posters... yes you can "close" the CMS to groups, in the sense that they can't read articles, they'll just see a "No content" notice. What this mod does is prevent anyone unauthorised from accessing the CMS page at all. This gives you all the time you need to work on it behind curtains, modifying content, layout, themes, whatever.

TalkVirginia
12-19-2009, 06:21 PM
Trek, Thank you for taking the time to make this addon. Works great!

*installed*

merk_aus
12-21-2009, 06:11 AM
I have voted one star because you can do this in the ACP - disable the entire plugin or using permissions make it only that your staff/contributors can see it for everyone else it doesn't show.

A nice mod but it's already part of out of the box vb publishing suite.

radmoose
12-21-2009, 06:49 AM
If it is in the ADMIN CP, can someone specifically say what needs to be done?

When I disable all the sections for everyone but Admin, when someone who is not logged in shows up, they see "There is no content in this section" on the "Front Page" instead of not seeing the CMS at all.

I want everyone except admins and moderators to go directly to forums and not see the CMS at all.

It sounds like this mod does this while the Admin CP doesn't (unless I am missing something.)

Trek
12-21-2009, 07:23 AM
What radmoose said, that's why I wrote the mod. If you're ok with everyone seeing annoying "you don't have permission" messages, no content and potentially an unskinned CMS (like in my case, it's getting done last), go right ahead and use the out of the box stuff.

If you don't want them to even know about the CMS or if they have a link to it, to then auto redirect to your forums, well... this mod does the trick for that.

radmoose
12-21-2009, 07:54 AM
Trek =)

I installed this Mod and it does work as mentioned for the most part (see question below.)

Two suggestions:

1. Set the Product URL to this thread.

2. Setup the Version Check URL as well.

One question:

Is it possible to have it just redirect to the forum automatically without posting the "Access to this page is restricted, redirecting you to our forums." message when someone clicks on the "HOME" tab? (I think this is a limitation of vB, but I wasn't sure.)

Because of these I rated it 4 stars, but I would probably re-rate it 5 once the two suggestions are implemented.

PPUS
12-21-2009, 02:02 PM
Nice work! Thank you for sharing it. I have a ton of things to do on the cms side and this eliminates one of the massive headaches that I was planning. Will mark installed once I get the Gold.

Trek
12-21-2009, 08:39 PM
Two suggestions:

1. Set the Product URL to this thread.

2. Setup the Version Check URL as well.

One question:

Is it possible to have it just redirect to the forum automatically without posting the "Access to this page is restricted, redirecting you to our forums." message when someone clicks on the "HOME" tab? (I think this is a limitation of vB, but I wasn't sure.)


I can do steps 1 and 2 for sure (never did the version check, but I remember seeing an article on it a while back, I'll reread that soon).

The redirect I'm not sure about, I tried to fool around with redirecting and such without the internal VB functions, but you run into things like headers already being sent and such.

Ideally, people won't even be hitting that URL because they won't have it cached in their browser history and such (assuming you start Vb4 with this installed and CMS off). I'll check into it again, but no promises on this one. =)

Dr.osamA
12-22-2009, 02:01 AM
thanxx man

I"ll try it

installed

transleted to arabic if you gev me promition i "ll add as attach here

weting you
________
MEDICAL MARIJUANA (http://medicalmarijuana.us/)

Trek
12-22-2009, 05:06 PM
thanxx man

I"ll try it

installed

transleted to arabic if you gev me promition i "ll add as attach here

weting you

No problem at all, post it! Thanks!

Axel Foley
12-27-2009, 11:30 PM
I don't need the CMS for my forum (not yet), so I simply did this:

1. Edited index.php in the forum root, commenting require('content.php'); and uncommenting require('forum.php');

2. Went to ACP->Plugins & Products->Manage Products and disabled the vBulletin CMS product.

Now the CMS disappeared, the button on the navbar too. ;)

Hope it helps someone else with my same need. I'll tag this mod and see how it evolves.

Trek
12-28-2009, 03:07 AM
I don't need the CMS for my forum (not yet), so I simply did this:

1. Edited index.php in the forum root, commenting require('content.php'); and uncommenting require('forum.php');

2. Went to ACP->Plugins & Products->Manage Products and disabled the vBulletin CMS product.

Now the CMS disappeared, the button on the navbar too. ;)

Hope it helps someone else with my same need. I'll tag this mod and see how it evolves.

That works, but that also prevents you from working on the CMS in the meantime. What my mod does is allows you to keep it running for those you want to access it and those you don't... don't know it exists, even if they happened to know the URL it'll redirect them to your forums.

Granted, not everyone needs this mod and just wants the CMS gone, etc... but for those that want it enabled, but limited in access, this'll do that.

Replicators
12-28-2009, 04:34 AM
Are so many Vb users so arrogant, that they actually have to try and find what they "think" to be a better method than what the mod is trying to achieve? I read through this all, and it seems to me trek has brought you guy's something useful and specifically handles something that should be in vbulletin by default. Show some appreciation for the effort people, cause it's attitude which makes modders come and go!

Axel Foley
12-28-2009, 06:42 PM
First of all, let me start by saying that I really appreciate Trek's effort in making this mod.

I was looking for a way to completely disable the CMS and I stumbled into this mod, but it was not exactly what I was looking for because my needs are different.

I thought other users could be in my same situation so I thought it was helpful to post what I found out in order to disable the CMS without any hack/mod, that's it.

Replicator, if this is arrogance from your point of view then we have a different way of defining it. ;)

Thanks again Trek, and keep up the great job. :D

Old-Git
12-28-2009, 08:29 PM
Trek this is exactly what I'm looking for. I want my forums to load first when my Vb4 is accessed, I want only the admins to see the CMS and I want the Home button removed from the Navbar so that non-admins don't / can't find their way to the CMS until I'm ready to let them.

This is a great mod and I shall be installing it forthwith! Thanks Man for working this out and thanks for posting it. Saved me from having to re-invent the wheel or even teach myself to code VB... I have enough to do right now without learning something new!

Rgds

Pete

cooltechie
12-29-2009, 05:19 PM
Sounds like just what we need to test. Thanks for providing this.

utahraves
12-29-2009, 08:41 PM
I'm an admin on my server and I set up the groups allowed and it told me I didn't have access to the content.php .... ?

Trek
12-29-2009, 09:16 PM
I'm an admin on my server and I set up the groups allowed and it told me I didn't have access to the content.php .... ?

There might be a bug in multiple usergroups. Do you have more than one listed in the settings?

Try just changing it to usergroup 6 (assuming you're in that group as normal). See if it works then.

If so, there's a problem with the multiple group checking and I'll look into it.

Alibass
12-30-2009, 02:40 AM
I'm an admin on my server and I set up the groups allowed and it told me I didn't have access to the content.php .... ?
I had the same problem until I logged out and back into my site.

Alibass
12-30-2009, 02:44 AM
Trek

Your mod seems to being working as you say, but I had one issue with it. When I turn it off and turn privileges on for all my groups, the Home button will not appear back on the navbar for the user groups who have been approved to view the CMS page.

Trek
12-30-2009, 03:18 AM
Trek

Your mod seems to being working as you say, but I had one issue with it. When I turn it off and turn privileges on for all my groups, the Home button will not appear back on the navbar for the user groups who have been approved to view the CMS page.

Ok, I'll look into that, thanks!

linkasaur
01-03-2010, 06:42 AM
Thanks for this handy product! It works like a charm!

UpFriends
01-03-2010, 02:36 PM
Excellent mod! Just what I needed.

Verionia
01-04-2010, 01:16 AM
Great, thanks soooo much!

Brother Malachi
01-14-2010, 04:00 AM
I don't need the CMS for my forum (not yet), so I simply did this:

1. Edited index.php in the forum root, commenting require('content.php'); and uncommenting require('forum.php');

2. Went to ACP->Plugins & Products->Manage Products and disabled the vBulletin CMS product.

Now the CMS disappeared, the button on the navbar too. ;)

Hope it helps someone else with my same need. I'll tag this mod and see how it evolves.

Do you understand the PURPOSE of this mod?
As of right now when the CMS is enabled EVERYONE sees it.
The purpose of this mod is to allow the admin to pick only CERTAIN USERGROUPS to see it...hence effectively disabling it :D

Your method TURNS off the cms. This method allows the admin to develop the cms without anyone actually knowing it is enabled.
Without this mod there is no built in way (in vb) to hide the cms from users if it is enabled.

Brother Malachi
01-14-2010, 04:43 AM
Oh by the way, this mod doesn't work correctly.
In the adminCP options page for this mod it says:
"Enter user groups that you want to have access to your CMS.

Separate usergroups with a comma.
Example: 6,5"

However, it is not coded correctly to work w/ more than one usergroup so inputting more than usergroup id will beak the board.

is_member_of() requires you to input usergroup ids, not an array. So you can't use this:
<vb:if condition="is_member_of($vbulletin->userinfo, $vbulletin->options['cms_disabler_usergroups'])">


Here's what I did to fix the issue. In the plugin titled "CMS - Redirector" add the following to the top:
// Generate an array w/ all the usergroups
$cms_disabler_usergroups = explode(",", $vbulletin->options['cms_disabler_usergroups']);

// Get rid of white spaces
function trim_value(&$value) {
$value = trim($value);
}
array_walk($cms_disabler_usergroups, 'trim_value');




then replace this line:
if (!is_member_of($vbulletin->userinfo, $vbulletin->options['cms_disabler_usergroups'])) {
with this line:
if ( !in_array($vbulletin->userinfo['usergroupid'], $cms_disabler_usergroups) ) {

Trek
01-14-2010, 04:57 AM
Thanks for that fix, I'll try and get it into an updated release shortly. Just been pressed for time on other projects. But again, thank you!

Brother Malachi
01-14-2010, 05:24 AM
No problem.

...i've actually been trying to figure out how to make the change to the template lol.
I guess with the new vb version you can't put in_array($bbuserinfo[usergroupid], $some_array) in a template. It keeps spitting out an error saying that $some_array isn't an array.

Brother Malachi
01-14-2010, 05:34 AM
Ok, to fix the template replace

<vb:if condition="is_member_of($vbulletin->userinfo, $vbulletin->options['cms_disabler_usergroups'])">
with:
<vb:if condition="$cms_disabler">

then add a new plugin.
Hook location: global_start
Code:

// Generate an array w/ all the usergroups
$cms_disabler_usergroups = explode(",", $vbulletin->options['cms_disabler_usergroups']);
$cms_disabler = in_array($vbulletin->userinfo['usergroupid'], $cms_disabler_usergroups);
vB_Template::preRegister('vbcms_navbar_link',array ('cms_disabler' => $cms_disabler));


and that should take care of it :)

Axel Foley
01-14-2010, 02:16 PM
Do you understand the PURPOSE of this mod?
As of right now when the CMS is enabled EVERYONE sees it.
The purpose of this mod is to allow the admin to pick only CERTAIN USERGROUPS to see it...hence effectively disabling it :D

Your method TURNS off the cms. This method allows the admin to develop the cms without anyone actually knowing it is enabled.
Without this mod there is no built in way (in vb) to hide the cms from users if it is enabled.

Have you even bothered to read what I wrote in my post (#30)?

I explained that I was looking for a way to COMPLETELY disable the CMS, and I stumbled upon this mod but it was not exactly what I needed; since I thought that other people could have my same requirement I thought it was useful to post what I discovered.

I thanked the dev, and I explained why I posted those instructions; I really don't see why you wrote your post...completely useless.

Anyway...no problem...forums unfortunately are full of posts like yours. ;)

Take care.

radmoose
01-15-2010, 01:40 AM
One item for the documentation.

Make sure you set vBCms Comments forum permissions to only allow the selected usergroups to have access to the comments as by default (at least in my case) everyone could see the comments.

Old-Git
01-20-2010, 07:52 PM
Hi Brother Malachi, Re the user ID array. Thanks for the code update. I got around the problem quickly by setting the Moderators group as the group with access and then adding the mod groups as a secondary user group on the Admin's account. This way I get all my mods and my admins on the CMS. I guess I could also have set-up another user group called CMSviewers and then added that as a secondary group to everyone I wanted to see the CMS, probably a bit tidier and easier to delete when I'd finished. Either way it's allowed me to do what I needed to do....But thanks all the same for the code update, I really appreciate you getting this done and adding to the thread, it's certainly a much tidier way of doing it.

Rgds

Pete

sportsfroma2
05-25-2010, 01:17 PM
now that my forums are all set for a little bit I have some time to finally work on the CMS thanks to this mod.. I used impex to port over all the stuff from the old CMS, but it wasn't a completely clean transfer. This mod allows me to begin formatting everything correctly at my pace so it doesn't inconvenience anyone else/nobody else needs to know anything is changing until it's ready for all to see :)

thanks a lot!

Boofo
05-25-2010, 01:26 PM
Why not just disable the plugin for it?

sportsfroma2
05-25-2010, 01:29 PM
Why not just disable the plugin for it?

because that just killls the whole thing... doesn't allow you to work on the CMS while the plug-in is disabled.


pretty much this add-on allows us to put the CMS in a type of "maintenance mode" for a specific usergroup (ex: admins).. So Admins can see it to work on it, while everyone else just bypasses it automatically/wouldn't know the CMS exists

(useful for those of us upgrading to the suite from the forums only, for example)

Boofo
05-25-2010, 01:35 PM
Good point. I hadn't thought of that. ;)

Trek, why not include the file and template edits in a readme file in the hack? That way they have it for future reference.

UpFriends
07-23-2010, 06:25 PM
Great mod. Very helpful.

Lqd
09-14-2010, 10:49 PM
Why not disable the CMS product? Isn't that a lot easier?

cagbaazee
09-21-2010, 12:18 PM
just include forum.php in the site tab url of content management settings. its working perfect.

Trek
09-21-2010, 06:12 PM
Why not disable the CMS product? Isn't that a lot easier?

just include forum.php in the site tab url of content management settings. its working perfect.

The reason why is that the mod still made the CMS available to admins or whoever so that they could get content added to the system, have it configured, look and feel, etc... all behind the scenes. If there are other better ways to do this now, go for it. The mod was written when vB was released and is no longer supported anyway.

barakuda
11-15-2010, 02:05 PM
installed...thanks

gabs
04-19-2011, 05:04 PM
Nice!
Thank you, just what I was looking for :)

cheers,
.g

togotutor
05-16-2011, 06:51 PM
Installed, but need to test it.

Old-Git
07-18-2012, 02:55 PM
Has the new Navigator Manager broken this addon?

EDIT: having just had a look, it would appear that the template ''vbcms_navbar_link', which is part of the dit process for this addon, has been deleted in the 4.2.0 upgrade.

BirdOPrey5
07-24-2012, 09:42 PM
Since this is Re-Usable code here is an update for 4.2.0.

It also fixes a bug where for me at least it wasn't working with multiple allowed usergroups. Now it does.

I upped the version number to 2.0.

You can install like any other upgrade (allow overwrite = yes).

NO MANUAL EDITS NEEDED.

The OP can feel free to re-edit this code and/or put this in the first post.

Old-Git
07-25-2012, 09:33 AM
Outstanding, thanks for taking this on BOP5, It's great to have this available for 4.2.0! Also, thanks for fixing the problem with multiple user groups. I had gotten around this by creating a CMS-Users usergroup and assinging to it only the people who needed to see it but it's nice that I now no longer need to do that!

Trek
07-25-2012, 03:36 PM
I've updated the OP with the new XML and removed the manual edits in the installation instructions. Thanks BirdOPrey5 for updating/fixing the mod as I no longer support it/remember much about vB modding. =)

BirdOPrey5
07-25-2012, 04:38 PM
You're Welcome but Just FYI the one I released is only for VB 4.2.0 and above, it won't work on older versions. I suggest you keep your original version available as well.