We saw how eZ Publish roles and policies work in Chapter 6, when we created a new section, and then in Chapter 8, when we added specific policies to a forum channel.
But we never talked about how the CMF manages users.
Every time that we have to deal with a user, we will find the relative content object inside the User accounts tab.
On the left-hand sidebar of this section of eZ Publish, we can see the user groups that have been created. Also, we can see in the main content area all of the information for the area.
If we click on a user group on the left, the central area will be expanded to show an Assigned roles box.
This contains all of the roles applied to the group, and specifies if there are any section or subtree limitations.
Within this box, we can find the Available policies box, as shown here:
This box is a drill-down of the first one, and all of the relative policies of the applied roles are shown in it.
The last box, called Sub items, is the container of all of the users that belong to the group.
As for the other content object, a user can be disabled by adding an 'invisible' tag, and edited, directly from here.
eZ Webin allows us to create users in two ways: via the predefined registration form in the frontend, or from the administration backend.
The following screenshot shows how the registration form on the frontpage of the site appears, using the predefined eZ Webin template with our CSS:
When the users register themselves via the frontend, they will be saved as Anonymous Users and the default roles will be applied.
Otherwise, in order to create a new user from the backend, we have to log in from the backend interface located at http://packtmediaproject/index.php/dev_panel
. Now, from the User accounts tab, we have to open the group into which we want to place the new user.
Here, we can use the drop-down menu at the bottom of the content area to create a new User or a User group content object.
The following screenshot shows the backend interface used to create a new user:
When we create a new user via the backend, we have to provide the same data as we do when creating a user via the frontend. The only difference is that, in this case, we can create the user in the exact group that we want.
It's very important to remember that eZ Publish checks for a unique username and email address. So two different users cannot have this information duplicated.
When we created the new user, we noticed that we can create only Users or User groups; but we defined our profile content class to manage the editors in Chapter 3. To add this content class to the User accounts content area, we will need to update it.
Open the Setup tab, and then click on the Classes link in the sidebar. Then, click on the Content class inside the Class group box, and select the Profile content class, in order to see its information. At the bottom of the page, we can see the Member of class groups box, as seen in the following screenshot:
In this box, select Users from the drop-down menu, and then click on the Add to class group button. From now on, we'll be able to create new profile editors inside the Editors user group.
Sometimes we may need to delete a user, for example, an employee who leaves our company, or an external user who wants to delete his own profile.
In this case, we can proceed in two ways. We can either delete the user permanently, or disable the user by maintaining the author's attributes on the content that he or she created.
To disable a user, we have to open the User accounts tab in the backend, and then browse in the categories for the user that we want to disable.
Open the user page, and in the Preview page, click on the Configure user account settings link. The following window will be displayed:
Deselect the Enable user account checkbox, and save your changes by clicking on the OK button.
As we saw when we created the new interface and content classes, the eZ Webin packages come with a handful of preconfigured features.
In this case, the package automatically creates five different groups, along with the relevant roles and privileges.
We can see these groups in the following table:
Administrator users |
The users who belong to this group are superusers, having access to all of the functionality of eZ Publish. |
Editors |
These users can manage the content of the CMF. |
Partners |
These are member users with the privileges necessary to use a reserved area of the frontend. |
Members |
These are anonymous users who have registered themselves. These members can manage their personal profile page. |
Anonymous users |
Visitors who are not logged in. They can read everything that is marked as public. |
3.21.46.78