Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Admin Permissions


Reply

6 Posts   1408 Views

Avatar
chrisco_7

17 August 2009 at 11:57pm Community Member, 5 Posts

Hi all,

Hate to use the term, but absolute noob here that has made a very rookie mistake with my site permissions.

I was adding a new user to the site with restricted permissions. That worked, but I've also managed to duplicate the admin permissions to the same settings - now I can't change the site myself.

I've had a bit of a look around the forums, but really appreciate some help if anyone knows how to reset the admin settings if I can't access the administrators/users section of the backend.

Avatar
Pigeon

18 August 2009 at 2:01am (Last edited: 18 August 2009 2:02am), Community Member, 243 Posts

Hi chrisco_7,

Don't worry, we all have made this mistake somewhere (or a similar one at least).

In your /mysite/_config.php:

Security::setDefaultAdmin($username, $password)

And that should allow you to login as an administrator with full privileges. If not... well, then you're a bit buggered, I fear!

See: http://doc.silverstripe.com/doku.php?id=security#system_configuration

Avatar
chrisco_7

18 August 2009 at 11:10pm Community Member, 5 Posts

Thanks Pigeon.

I gave that a shot but kept getting "Notice: Undefined variable: username in C:\wamp\www\SilverStripe-v2.3.2\mysite\_config.php on line 30" (line 30 or anywhere else I place it) when testing if it worked. The massage appeared instead of the control panel along the top of the backend display, replacing the buttons with this message repeated.

Please forgive the ignorance, but should it be as simple as copying and pasting that code (with no changes) inside that config.php file? I've had a read and it doesn't state where to drop the line of code, or if it needs anything extra added and I just keep getting the error regardless of where I place it.

Would really appreciate some words of wisdom with getting this train back on track...

Avatar
Pigeon

18 August 2009 at 11:42pm Community Member, 243 Posts

No worries,

$username and $password should be replaced with strings, such as "test" and "test" (respectively). Then you would log in with those credentials.

Sorry for the ambiguity.

Avatar
chrisco_7

19 August 2009 at 1:20am Community Member, 5 Posts

Ha haaaaa,

Worked like a charm. You're a legend Pigeon!

Avatar
ambient

29 May 2014 at 2:49am Community Member, 123 Posts

This just saved my bacon
Thanks Pigeon!