How do i get the User information for a LoginPage in Sulu?

132 views Asked by At

im new to Sulu and Symfony. I want to build a site where the admin adds Useres in the adminpage and then the registerd User can login in the Page. It looks like thats what the User and Role System is for but i can't figure out how to build a login page thats not the admin page but for the website. Any Suggestions for Documentation would help! Thanks!

I tried to create a Page but i dont know how to accsess the User Data thats on the Database. https://docs.sulu.io/en/2.5/cookbook/securing-your-application.html I tried with this guied but i still dont understand how you would authenticate someone through the login page.

That is my simple Login Form

<form action="" method="post">
        <label for="username">Email:</label>
        <input type="text" id="username" name="_username">

        <label for="password">Password:</label>
        <input type="password" id="password" name="_password">

        <button type="submit">login</button>
    </form>

The SuluCommunityBundle looks like what i want but im not able to install it

1

There are 1 answers

2
Alexander Schranz On BEST ANSWER

The security System in Sulu is Role based not User based. On the permissions tab when your webspace has security configured you can say which User Roles can access which page.

Sulu Pages are always cached so to get security work on the website you need to enable first User Context Based Caching:

https://docs.sulu.io/en/2.5/cookbook/user-context-caching.html

The "Securing your application docs" is for "custom admin entities" not for website users.