WebLoginPE: Шаблоны
- Дополнения
- WebLoginPE
- Шаблоны
WebLoginPE: Шаблоны
Every view that is presented to the user can be customized using MODx chunks.
The snippet changes between views based on a post-back system. It looks for the value of $_POST['service'] to determine which view to display. In the case of the default view for a logged in user, a form is presented with two submit buttons. The buttons each have the name attribute set to "service", but a different value
If the "Log Out" button is pressed, the $_POST['service']
value is "logout" and WebLoginPE executes the code in the case 'logout': block.
The services in WebLoginPE are:
&messageTpl
WebLoginPE will display many messages, either confirmations or errors. The message will be placed in a placeholder ([+wlpe.message+]) which you can put anywhere in your custom form or anywhere on the page.
When creating the chunk for &messageTpl you should place "[+wlpe.message.text+]" wherever you want the actual message to show up in the template.
Default:
<div><p>[+wlpe.message.text+]</p></div>
&loginFormTpl
The view presented to the user asking for their "username" and "password". Required form field names are "username" and "password". Optional inputs are a checkbox named "rememberme" which sets a 5 year cookie, or a select named "stayloggedin" which sets a cookie for the number of seconds specified in each options value. The cookie name is "WebLoginPE" and the value is a MD5 hash of the username and password (usernames and passwords should never be set in the open because cookies are saved in plain text. That is why WebLoginPE converts them to a hash). When the user returns to your site, WebLoginPE grabs the cookie, uses an algorithm to decode the username and password, then automatically logs the user in.
Default: defaultLoginFormTpl
[+wlpe.message+]
&successTpl
The view presented to the user asking for their "username" and "password". Required form field names are "username" and "password". Optional inputs are a checkbox named "rememberme" which sets a 5 year cookie, or a select named "stayloggedin" which sets a cookie for the number of seconds specified in each options value. The cookie name is "WebLoginPE" and the value is a MD5 hash of the username and password (usernames and passwords should never be set in the open because cookies are saved in plain text. That is why WebLoginPE converts them to a hash). When the user returns to your site, WebLoginPE grabs the cookie, uses an algorythm to decode the username and password, then automatically logs the user in.
Default: defaultLoginSuccessTpl
[+wlpe.message+]<img id="wlpeMyProfileImg" src="[+user.photo+]" alt="[+user.username+]" title="[+user.username+]" height="30" width="30">Welcome back [+user.username+]!
You have logged into [(site_name)] [+user.logincount+] times now.
Your last login was [+user.lastlogin+][+user.comment+]
®isterTpl
The view presented to the user to register for a new account. You can have a form input for every field in the database table "web_user_attributes" and all the fields set in &customFields*. When setting up your form, the input name attribute should be the same as the field name in the table. For example, the form input asking for the users mobile phone number (table field "mobilephone") should be:
<input type="text" name="mobilephone" value="[+post.mobilephone+]" />
Placeholders for values in the $_POST array are available for use in your forms so that if there is an error, all the information that the user entered in your form is not lost. As you can see in the example for "mobilephone" above, the placeholder "[+post.inputname+]" is set for each input name attribute.
If you specified form fields in &inputHandler, you could also use the [+form.fieldname+] placeholder here.
*It is advised against providing inputs for id, internalKey, role, blocked, blockedunitl, blockedafter, failedlogincount, and sessionid as that can SERIOUSLY corrupt your entire MODx installation. Those fields should only be edited by the web master from the back end.
Default Instant: defaultRegisterInstantFormTpl
[+wlpe.message+]
Default Verify: defaultRegisterVerifyFormTpl
[+wlpe.message+]
®isterSuccessTpl
The view presented to the user to after successfully registering for a new account. If you want this custom view to be displayed after registration, DO NOT put the ®SuccessId parameter in your call. The default is the whatever is specified in &loginFormTpl so the user can log in after registering.
Default: defaultLoginFormTpl
[+wlpe.message+]
&tosChunk
In your registration form, you may want your users to agree to your "Terms Of Service / Privacy Policy" before you accept their registration. You specify your terms of service chunk with this parameter, then in your registration form, use the placeholder [+tos+] (which is set by WebLoginPE to hold your tosChunk) where you want your Terms of Service to be displayed and put a checkbox with the name attribute set to "tos". You should also specify "tos" in the ®Required parameter to make sure that if they don't check it (signifying that they agree) they will not be allowed to register.
Terms of Service/Privacy Policy
[+tos+]
The default terms of service were generated by Kinky Solution's Terms Of Service / Privacy Policy Document Generator.
Default: defaultTosTpl
tosChunk
Web Site Terms and Conditions of Use
1. Terms
By accessing this web site, you are agreeing to be bound by these web site Terms and Conditions of Use, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this web site are protected by applicable copyright and trade mark law.
2. Use License
- Permission is granted to temporarily download one copy of the materials (information or software) on [MODX] Guru's web site for personal, non-commercial transitory viewing only. This is the grant of a license, not a transfer of title, and under this license you may not:
- modify or copy the materials;
- use the materials for any commercial purpose, or for any public display (commercial or non-commercial);
- attempt to decompile or reverse engineer any software contained on [MODX] Guru's web site;
- remove any copyright or other proprietary notations from the materials; or
- transfer the materials to another person or "mirror" the materials on any other server.
- This license shall automatically terminate if you violate any of these restrictions and may be terminated by [MODX] Guru at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format.
3. Disclaimer
- The materials on [MODX] Guru's web site are provided "as is". [MODX] Guru makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties, including without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights. Further, [MODX] Guru does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials on its Internet web site or otherwise relating to such materials or on any sites linked to this site.
4. Limitations
In no event shall [MODX] Guru or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption,) arising out of the use or inability to use the materials on [MODX] Guru's Internet site, even if [MODX] Guru or a [MODX] Guru authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you.
5. Revisions and Errata
The materials appearing on [MODX] Guru's web site could include technical, typographical, or photographic errors. [MODX] Guru does not warrant that any of the materials on its web site are accurate, complete, or current. [MODX] Guru may make changes to the materials contained on its web site at any time without notice. [MODX] Guru does not, however, make any commitment to update the materials.
6. Links
[MODX] Guru has not reviewed all of the sites linked to its Internet web site and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by [MODX] Guru of the site. Use of any such linked web site is at the user\'s own risk.
7. Site Terms of Use Modifications
[MODX] Guru may revise these terms of use for its web site at any time without notice. By using this web site you are agreeing to be bound by the then current version of these Terms and Conditions of Use.
8. Governing Law
Any claim relating to [MODX] Guru's web site shall be governed by the laws of the State of New York without regard to its conflict of law provisions.
General Terms and Conditions applicable to Use of a Web Site.
Privacy Policy
Your privacy is very important to us. Accordingly, we have developed this Policy in order for you to understand how we collect, use, communicate and disclose and make use of personal information. The following outlines our privacy policy.
- Before or at the time of collecting personal information, we will identify the purposes for which information is being collected.
- We will collect and use of personal information solely with the objective of fulfilling those purposes specified by us and for other compatible purposes, unless we obtain the consent of the individual concerned or as required by law.
- We will only retain personal information as long as necessary for the fulfillment of those purposes.
- We will collect personal information by lawful and fair means and, where appropriate, with the knowledge or consent of the individual concerned.
- Personal data should be relevant to the purposes for which it is to be used, and, to the extent necessary for those purposes, should be accurate, complete, and up-to-date.
- We will protect personal information by reasonable security safeguards against loss or theft, as well as unauthorized access, disclosure, copying, use or modification.
- We will make readily available to customers information about our policies and practices relating to the management of personal information.
We are committed to conducting our business in accordance with these principles in order to ensure that the confidentiality of personal information is protected and maintained.
&profileTpl
The form presented to the user which allows them to modify their attributes stored in the databse. Like ®isterTpl, this form can contain as many or as few of the table fields from web_user_attributes AND the extended user attributes table as you want. The difference in this form is that you can set the value of the form fields to one of the placeholders. For example the "Full Name" input would look like:
If you specified form fields in &inputHandler, you could also use the [+form.fieldname+] placeholder here and the users selections and checks would be remembered and pre-selected or pre-checked.
Default: defaultProfileTpl
[+wlpe.message+]
&userOuterTpl
The template that works as a "wrapper" for each of your lists in type=`users`.
Default: defaultUserOuterTpl
[+wlpe.message+][+view.title+]
[+view.list+]
&usersTpl
When you have called WebLoginPE with &type=`users`, each user in the databases is listed and (in the default template) their user image and username are links to a separate area that can list more details about the user and give other users a form to contact that user. Since this view may contain privileged data, you may want to use "Access Permissions" on this page. The &usersTpl paramter chunk should define the structure of the block for EACH user on this page. It will loop through each user, one at a time, exchange the placeholders for their info, add it to the que, then go to the next user. When it has finished looping over each user, it will return the entire que to the page. This view has access to the [+user.age+] placeholder that calculates the user's age based on their DOB.
If you specified form fields in &customFields parameter for register and profile, you should also specify them here to make sure placeholders are set for them.
Default: defaultUsersTpl
[+wlpe.message+]<a href="[~[*id*]~]?service=viewprofile&username=[+view.username+]"> <img src="[+view.photo+]" alt="[+view.photo+]" title="[+view.username+]" height="100" width="100"> </a> <a href="[~[*id*]~]?service=viewprofile&username=[+view.username+]">[+view.username+]
</a>Username: [+view.username+]
Age: [+view.age+]
Last Login: [+view.thislogin+]
[+view.comment+]
&viewProfileTpl
When you have called WebLoginPE with &type=`users`, each user in the databases is listed and (in the default template) their user image and username are links to a separate area that can list more details about the user and give other users a form to contact that user. As with &usersTpl, this view may contain privileged data, you may want to use "Access Permissions" on the calling page. The &viewProfileTpl paramter chunk should define the structure of this separate area to view more details on an individual user. This view has access to the [+view.age+] placeholder that calculates the user's age based on their DOB.
If you specified form fields in &customFields parameter for register and profile, you should also specify them here to make sure placeholders are set for them.
Default: defaultViewProfileTpl
[+wlpe.message+]
Viewing the profile of "[+view.username+]": |
|
Username: | [+view.username+] |
Full Name: | [+view.fullname+] |
Email: | [+view.email+] |
Phone Number: | [+view.phone+] |
Mobile Phone Number: | [+view.mobilephone+] |
Fax Number: | [+view.fax+] |
State: | [+view.state+] |
Country: | [+view.country+] |
Age: | [+view.age+] |
Gender: | [+view.gender+] |
Signature: | [+view.comment+] |
Photo: | <img src="[+view.photo+]" alt="[+view.photo+]" title="[+view.username+]"> |
&profileDeleteTpl
The form presented to the user to confirm that they actually want to delete their account. This is presented after the user has clicked the "Delete My Profile" button on the profile page. We want to make sure they didn't click it by accident!
Default: defaultProfileDeleteTpl
[+wlpe.message+]
&manageOuterTpl
The template that works as a "wrapper" for each of your lists in type=`manager`. The default is the same as the default &userOuterTpl.
Default: defaultUserOuterTpl
[+wlpe.message+][+view.title+]
[+view.list+]
&manageTpl
The template (chunk) that will be applied to each user in type=`manager`.
Default: defaultManageTpl
&manageProfileTpl
The Form (chunk) that will be displayed when editing a user's attributes in type=`manager`.
Default: defaultManageProfileTpl
[+wlpe.message+]
&manageDeleteTpl
The Form (chunk) that will be displayed asking for confirmation of intention to delete after clicking the "Delete Profile" button for a user in type=`manager`.
Default: defaultManageDeleteTpl
[+wlpe.message+]
&resetTpl
The form presented when a user clicks the "Forgot Password" button. This form has only one input ("email"). They enter their email address, WebLoginPE sets a random password and key in the web_users table's cachepwd field and sends them a link to the URL of the page that this was called from with the string "?service=activate&userid=3&activationkey=kl3tW5rtDi where "3" would be the users internalKey and "kl3tW5rtDi" would be the randomly generated activation key which is a 10 character string.
Default: defaultResetFormTpl
[+wlpe.message+]
&activateTpl
This form is presented when the user clicks the link in the email that was sent from the &resetTpl form. It is the view for service=activate. The user is asked for the temporary password that was emailed to them and they are given the option to set a new password. WebLoginPE then checks that the temporary password and the activationkey match what was stored in the cachepwd field for the internalKey in the web_users table. If everything checks out, the new password that the user entered is activated. The default form has three input fields with the name attributes "activationpassword", "newpassword", and "newpassword.confirm".
Default: defaultActivationFormTpl
[+wlpe.message+]
¬ifyTpl
This is not a view presented to the user, but a template format for the email message that will be sent to the addresses in ¬ify. It uses all the placeholders that are available in the Tools > Configuration > User > Web signup email template, with the addition of [+uem+] for the user's email address. The user's password will NOT be available in this template.
Default: defaultNotifyTpl
Hello, my name is [+ufn+] and I just signed up at [+sname+] as "[+uid+]" using WebLoginPE. My email address is [+uem+]. P.S. This message was auto generated by WebLoginPE and PHPMailer.
¬ifySubject
This is also not a view presented to the user, but a definition of the subject line for the email message that will be sent to the addresses in ¬ify.
Default:
New Web User for [(site_name)].