Jump to:

23486 Posts in 18995 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Admin Permissions

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

Page: 1
Go to End
Author Topic: 1394 Views
  • chrisco_7
    Avatar
    Community Member
    5 Posts

    Admin Permissions Link to this post

    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.

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Admin Permissions Link to this post

    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

  • chrisco_7
    Avatar
    Community Member
    5 Posts

    Re: Admin Permissions Link to this post

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

  • Pigeon
    Avatar
    Community Member
    243 Posts

    Re: Admin Permissions Link to this post

    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.

  • chrisco_7
    Avatar
    Community Member
    5 Posts

    Re: Admin Permissions Link to this post

    Ha haaaaa,

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

  • ambient
    Avatar
    Community Member
    123 Posts

    Re: Admin Permissions Link to this post

    This just saved my bacon
    Thanks Pigeon!

    1394 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.