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, Ed, biapar, Willr, Ingo, swaiba

Admin Permissions

Go to End

6 Posts   1953 Views


Community Member, 5 Posts

17 August 2009 at 11:57pm

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.


Community Member, 253 Posts

18 August 2009 at 2:01am

Edited: 18/08/2009 2:02am

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!



Community Member, 5 Posts

18 August 2009 at 11:10pm

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...


Community Member, 253 Posts

18 August 2009 at 11:42pm

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.


Community Member, 5 Posts

19 August 2009 at 1:20am

Ha haaaaa,

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


Community Member, 130 Posts

29 May 2014 at 2:49am

This just saved my bacon
Thanks Pigeon!