Secured section for partners |
Top Previous Next |
Kentico CMS allows you to create secured site sections that can be accessed only by users who have a valid user name and password. We will create a simple page for partners that can be accessed only by registered users.
Go to CMS Desk -> Content, click root and click New. Choose to create a new Page. Enter page name Partners and choose to use the page template Templates with editable regions/Simple text. Click Save. Click the Down arrow in the main toolbar until you move the Partners page at the end of the list.
Click the Page tab and enter the following text: This is a secured page for partners. Click Save.
Click Propeties -> Security. In the Access section of the dialog, click Yes in the Requires authentication field and click OK. This will ensure that the page can be accessed only by authenticated users.
Configuring the logon page
Now we need to create the logon page. We will use a pre-defined page template that you can further customize if necessary. Click root and click New. Choose to create a new Page (menu item). Enter page name Logon and choose the page template Membership and security/Log-on page with registration form. Click Save.
Click Properties -> Menu and uncheck boxes Show in navigation and Show in sitemap. Click Save and use the Down button to move the Logon page at the end of the document list in the content tree..
We will also need to configure the system so that it uses our new logon page. Go to Site Manager -> Settings, choose My web site in the drop-down list, click Security and set the value Secured areas logon page to ~/logon.aspx, which is the relative URL of our logon page (from the web application root). Click Save.
Configuring the Sign out button
Go to CMS Desk -> Content -> select the root document -> click Design, add the following web parts to the zoneMain web part zone and set their properties:
Membership/Current user
Membership/Sign out button
Then sort the web parts in the zoneMain zone in the following order (you can drag and drop web parts using mouse):
Sign out from Kentico CMS Desk. Click Partners in the main menu. You are redirected to the logon page:
Now you need either to sign in as administrator or register as a new user. After you sign in successfully, you will see the Partners page content together with Sign out button:
You have learned how to secure part of the web site so that it's only accessible for registered users.
You have just finished the sample web site. |