PDA

View Full Version : Disable CMS, but only for users, not admins


Trek
12-16-2009, 03:19 AM
What I want to do is get the forums working first, then enable the CMS later. But I don't want to enable the CMS and have to skin it while it's live. I want to be able to skin it and whatnot, then enable it when it's completed so the end user experience isn't total crap. =)

Anyone know if this is possible?

Someone suggested removing perms to the CMS from people, but then everyone will get a "You do not have permssion" message when accessing the main page of the site. Not what I would consider an acceptable solution for it as this would still show the unskinned site somewhat too.

Anyone have any other ideas?

Lynne
12-16-2009, 03:28 AM
I'd first turn off the tab in the navbar or put a condition around it to only show to the admins. Then I'd create a plugin that checks what page and the usergroup and if it isn't an admin on THIS_SCRIPT == vbcms, then give them no permission. Something like that should work although I've never tried it.

Trek
12-16-2009, 03:58 AM
Hmm, that might work. I gotta figure out HOW to do it, but.... sounds like it would work. Instead of no permissions, I guess I could just forward them to the forums somehow? (I don't want them to see a no permissions anything)

Lynne
12-16-2009, 04:35 AM
If they have no link to the page (since the tab is gone), then you shouldn't have to forward them because they really should never end up there in the first place.

Anyway, I plan on doing this on my site - having the CMS there only for the mods and admins so I can set it up after we go live with the upgrade - and that is how I plan on going about it.

Trek
12-16-2009, 05:01 AM
Ok, I have the tab removed unless you're an admin now.

If they have no link to the page (since the tab is gone), then you shouldn't have to forward them because they really should never end up there in the first place.

Not sure what you mean here?

By default when you goto the website the CMS page is loaded, right now the tab isn't there when I'm logged out, but I'm still on the main CMS "The Front Page". If I don't forward someone to the forums page, what would I do?

Sorry, I just don't get how the logic works. =)

How do I deny them permission? Maybe that's the part I'm missing? What I'd really like to do is just get them to the forums seamlessly.

I created a plugin as so:

if (THIS_SCRIPT == 'vbcms') {
if (is_member_of($user,6) == true) {
echo("<!-- Is admin! -- >");
}
else {
echo("<!-- Is NOT admin! -- >");
}
}

Which works fine I just don't know what to do on the NOT admin part of the condition.

odonel
12-16-2009, 01:36 PM
why not redirect to forum.php Trek ??

Lynne
12-16-2009, 03:04 PM
Open your index.php page and change the lines to this:
// Use the CMS as the default script
//require('content.php');

// Use the forum as the default script
require('forum.php');
That will make it so when users come to your index.php page, they are directed to the forums, not the cms.

Trek
12-16-2009, 03:35 PM
why not redirect to forum.php Trek ??

Wasn't sure how. :o

Open your index.php page and change the lines to this:
// Use the CMS as the default script
//require('content.php');

// Use the forum as the default script
require('forum.php');That will make it so when users come to your index.php page, they are directed to the forums, not the cms.

Thanks Lynne!

Old-Git
12-18-2009, 08:26 PM
I was going to ask this question myself... thanks guys!

Old-Git
12-23-2009, 09:31 PM
Lynne,

can you spell out for me how I should go about disabling the HOME button from the Nav Tab bar?

Old-Git
12-27-2009, 10:34 PM
bump

Trek
12-28-2009, 03:05 AM
I created a mod that disables the CMS cleanly, you can find it here in the vb4 mods section.

Old-Git
12-28-2009, 08:16 PM
Thanks Trek, I'll have a look at that. Hopefully, it will still allow Admin and Mods to see CMS but no-one else.