WebLoginPE Examples
IN PROGRESS... sorry...
This zend php review page hosts examples of setting up WebLoginPE including what your page(s) have to look like, your Snippet calls, and your Chunk code. For more detail about a particular topic, please see the other pages in the WebLoginPE category.
Contents |
Wireframes
How might you actually use WebLoginPE?
Simplest Example
You can run WebLoginPE using the simplest function call:
[!WebLoginPE? &type=`simple`!]
You can do this to test whether the Snippet and its functions are working. Simply place that Snippet call on a page and preview the page; try logging in and updating your profile. It won't be pretty, but it should work. If you have trouble, have a look in the forums or check out the WebLoginPE Errors page.
Use a Login Page
The following wireframe outlines a site where you have a dedicated page with the login form. This example uses all of the default templates with all the default fields.
- You need to create a new Web User Group : goto Security→Web Permissions→Web User groups. In this example, I created a user group named "Logged In Users" -- you will reference this in the &groups parameter (I think the image references the wrong group name).
- You need to create a Document Group -- don't go anywhere! Still in the Web access permissions area of the manager, create a new document group, e.g. "Private Pages".
- Associate the User Group with the Document Group -- still in the web access permissions area, go to the User/Document group links and make sure the user group and the document group are associated.
- You need to create 7 pages:
1. The page containing the login form. It should contain a call to the WebLoginPE snippet (contained in one line):
[!WebLoginPE? &type=`simple` &liHomeId=`2` ®HomeId=`3` &profileHomeId=`4` &loHomeId=`6` !]
2. The Welcome page. This is the page users see after logging in. It should belong to a special user group, e.g. "Private Pages" -- that way it is not publicly available. 3. Registration page. This should contain a call to the WebLoginPE snippet using the &type=`register` parameter:
[!WebLoginPE? &type=`register` ®SuccessId=`5` ®SuccessPause=`1` &groups=`Logged In Users`!]
4. Profile page. Belongs to the "Private Pages" group so it's not publicly accessible. The Snippet call looks like this:
[!WebLoginPE? &type=`profile` !]
5. Registration success page. This contains a message seen after a user registers. If you emailed the user a password, then the page should say that. It should also contain a link back to the login page. 6. Goodbye page. This is the page that users see after logging out. It can contain links back to the rest of the site. 7. You should also create a designated HTTP 500 page. This is the page that is shown if a public user tries to view a private page. Create the page, preferably with a link back to the login page, and be sure to denote it in the control panel under Tools→Configuration→Site under "Unauthorized page".
Strengths and Limitations
This setup is simple to understand (ha... relatively speaking), so it's easier to debug and it helps you get a feel for how these pieces work together. However, it has the following limitations:
- it uses only the default forms (none of the template chunks are used for customized forms)
- it doesn't use the more common layout where the login appears in a sidebar.
- The link to the login page will always say "login", even when the user is already logged in. No dynamic handling of this link is presented in this wireframe.
Types
This list includes options you add to WebLoginPE's &type parameter.
simple
[!WebLoginPE? &type=`simple`!]
This is the simplest to use, but as for understanding what's going on under the hood, this is the most complex option because all 4 functions (login, register, profile, logout) are encapsulated in a single page and are triggered by the value passed in the "service" variable (i.e. the value in $_POST['service']). Links between the different "pages" are automatically generated.
By default, the page shows a login form (or a welcome message if user is already logged in). It has links (buttons) to Login, Forgot Password, Register.
See the official documentation for "Views (Templates)"
register
profile
users
manager
taconite
Email Verification; Profile Editing
You first need a place where a visitor to your site can register to become a web user.
The registration page should contain a call to the Snippet:
[!WebLoginPE? &type=`register` ®Type=`verify`!]
Note that the form does not require a user to enter a name; only email and username are required by default. The fullname field can be blank. If you want to require the fullname field, use the ®Required parameter:
[!WebLoginPE? &type=`register` ®Type=`verify`®Required=`username`!]
But this configuration lacks a logout button.
