|
- In this lesson you will learn the following concepts
- Overview
- Integrating the User Groupware
- Configuring the User Groupware
- Including the customer section in the site
- Site test
- Creating users and groups
- Defining rights
- Site test
- Disabling the User Groupware
Lesson 5.4. User login: User Groupware In this lesson you will learn the following concepts - What is the User Groupware?
- Integrating the User Groupware.
- Configuring the User Groupware.
- Testing the User Groupware.
A site can be used by different contributors with different profiles. It is sometimes necessary to define different access levels according to the user (customer, salesman, manager, etc.). Let's take a simple example: an e-commerce website that allows users to do the following: - View prices,
- Modify prices,
- Enter orders,
- Manage customers.
Accesses are different according to the user. For example: - customers can see the price list and place orders.
- salesmen can see the price list, place orders and create new customers.
- managers have access to all the options.
WEBDEV allows you to manage these different access levels via the User Groupware. We will enable the User Groupware in our "Full_WEBDEV_Site" site and configure it to limit the access to the page for adding products. - Open the project you worked on in the previous lesson.
- Go to the WEBDEV home page (Ctrl + <).
- On the home page, click "Tutorial", then in "Parts 3 to 6", double-click "Full WEBDEV Site (Exercise)".
- A dialogue box prompts you to open the project you worked on in the previous lesson. You can open the local copy or the original project. Select "Open the local copy".
| | |  | Answers | A completed project is available. This project allows you to follow this lesson. To open the completed project, go to the home page and click "Tutorial", then in "Parts 3 to 6", double-click "Full WEBDEV Site (Answers)". |
Integrating the User Groupware - To enable the User Groupware in the "Full_WEBDEV_Site" project:
- On the "Project" tab, in the "Project" group, click "User Groupware". The configuration window of the current platform opens on the "GPU / Private Store" tab.
| | |  | Note | The User Groupware can be set up for only one of your project configurations. When testing the project, the User Groupware connection window will only be displayed when testing the platform for which the groupware has been enabled. |
- In "User Groupware", click "Change".
- The User Groupware configuration window is displayed. Enable the User Groupware by clicking "Enabled".
- Select "Standard User Groupware" and "Manual start via a control template".
| | |  | Note | When the User Groupware is in "Automatic start" mode, a standard log in page appears. If users enter their usernames and passwords, they are allowed to access the site. When the User Groupware is in "Manual start via a control template" mode, the developer can use a specific control template. This control template can be used to insert a link into the page to allow users to log in. We will present this solution in this lesson since it is easy to use and adapt. |
- Validate. A message is displayed, indicating that an administrator account is created by default.
| | |  | Note | The supervisor is the default user. The first time you log in to the site, enter: "supervisor" as username and password. |
- Validate this message.
- Validate the project configuration window. The User Groupware has been enabled in the project.
| | |  | Note | In this example, we will keep all the default options. Several options can also be configured. For more details, see User Groupware: Options and settings. |
Configuring the User Groupware The User Groupware is configured when running the site. This configuration consists in defining the different users as well as their rights on the site pages and controls. | | |  | Note | The users can be configured:- when developing the application. The necessary data files (regarding the users and their rights) can be installed with the site.
- when the administrator installs the site.
|
Including the customer section in the site In this example, we will add the log in link to "PAGE_List_of_products". The log in link is provided as a control template. | | |  | Note | A control template is a specific page containing several controls. This page can contain all types of controls. Control templates use the "WDT" file extension. The main advantage of using a control template is that it can be easily reused. A control template can be reused in any page of the project. You only need to make changes once and WEBDEV automatically applies them on all the pages that use the control template. Control templates can be overridden: code can be added, the controls can be moved in the page that uses the control template. Controls can also be modified. |
- To add the log in link:
- Open the "PAGE_List_of_products" page in the editor.
- Go to the "Project explorer" pane, "Internal components", and expand "WDGPU_WB_CNT". This internal component was included in the project when enabling the Groupware. It contains all the necessary elements, especially the control template used to log in.
- Then, expand "WEBDEV control templates".
- Select the TPLC_GPU_WB_Login control template and drop it onto PAGE_List_of_products. Drop the control template above the menu bar.
- The control template is successfully included. The "Log in" link appears.
Site test - Let's test our site:
- Test the project (click
in the quick access buttons). - The page corresponding to the list of products is displayed.
- Click the "Log in" link. The log in page is displayed.
- Log in as supervisor:
- Username: supervisor
- Password: supervisor
- Validate.
- The Groupware configuration page appears.
Creating users and groups To configure the User Groupware, we are going to create a "Product Management" group. This group will include the users who are allowed to modify and add products in the site. Then, we will create a user named Alison and associate it with the "Product Management" group.
- To create a new group of users:
- Click the "Groups" tab.
- Click "Add a group". The screen for entering a new group is displayed.
- Type the group name: "Product Management".
- Click "Save". The "Product Management" group appears in the list of groups defined in the User Groupware.
- To create a user:
- Click on the "Users" tab.
- Click on "Add a user". The screen for entering a new user is displayed.
- Enter the following information:
- Username: Alison
- First name: Alison
- Select "Force the following password" and enter the password: Alison.
Remark: You can also let users choose their passwords the first time they log in.
| | |  | Note | User information:- In the user information, only the username is mandatory.
- You can also set a user as Groupware supervisor. In this case, the supervisor will be able to modify users, groups and rights.
|
- Click "Save". "Alison" appears in the list of users defined in the User Groupware.
- To associate "Alison" with the "Product Management" group:
- Select "Alison" in the page.
- Check the box at the beginning of the row: the buttons "User groups" and "Delete user" appear.
- Click "User groups".
- In the popup that appears, check "Product Management" and click "OK".
- The association is completed. The name of the group to which "Alison" is associated appears in the list of users.
Defining rights We will now define the access rights to the menu for adding a product. It is recommended to refuse default access and allow selected groups only. - We will define the rights for users who haven't logged in (i.e., not identified by the Groupware). These rights will be used by default when starting the site, as long as the user isn't logged in.
- Define the rights:
- To prevent all users from accessing the page used to add products, select the "Visitor (not connected)" user. Any user who is not logged in is automatically associated with this user.
- Click
to set the rights. - The page that appears allows you to select each page, page template or report of the application.
- For each page, page template or report, it is possible to specify whether or not the element will be accessible to the user or group previously selected.
- For each page or page template, you can define whether the controls will have the site behavior (default) or whether they will be inactive, invisible or grayed.
- In our case, the "Add a product" link is in the "PAGETPL_Menu" page template:
- Select the "PAGETPL_Menu" page template from the list. The rights defined on the page template will be applied to all the pages that use the template.
- The names of the different page controls appear on the right.
- For "Menu option Option_2", select "Grayed" in the "State" combo box.
- Close the browser.
Site test - We will test the site.
- Test the project (click
in the quick access buttons). - By default, the "ADD A PRODUCT" option is grayed out.
- Click "Log in" and enter "Alison" in the username and password fields. Validate.
- The "ADD A PRODUCT" option is no longer grayed out.
- Close the browser.
Disabling the User Groupware The User Groupware will no longer be used in the rest of this tutorial. You can disable the management of user rights in this project and remove the control template we used: - On the "Project" tab, in the "Project" group, click "User Groupware".
- The platform configuration window appears.
- In "User Groupware", click "Change".
- In the window that appears, click "Disabled".
- Validate.
- If necessary, open "PAGE_List_of_products".
- Delete the "Log in" control template we added previously.
- Save and close the page.
- Recompile the project: on the "Project" tab, in the "Project" group, expand "Recompile and synchronize" and select "Recompile project and generate HTML pages".
- Go to the "Project explorer" pane, expand "Internal components" and select "WDGPU_WB_CNT". Right-click to open the context menu and select "Remove and delete from disk".
- Validate the message that appears.
The User Groupware is removed from the project.
|
|
|
|
|
|
|