by
nsy » Fri Oct 30, 2015 6:46 am
- Code: Select all
<cms:member_check_login />
<cms:if k_member_logged_in >
<cms:redirect k_site_link />
</cms:if>
<cms:set success_msg="<cms:get_flash 'success_msg' />" />
<cms:if success_msg >
<div class="notice">
<cms:if success_msg='1' >
Your account registration has been sent!<br>
You will receive an email once your account has been created.
<cms:else />
Activation was successful! You can now log in!<br />
<a href="table-lamps.php#modal-login">Login</a>
</cms:if>
</div>
<cms:else />
<cms:set action="<cms:gpc 'act' method='get'/>" />
<cms:if action='activate' >
<h1>Activate account</h1>
<cms:member_process_activation />
<cms:if k_success >
<cms:set_flash name='success_msg' value='2' />
<cms:redirect k_page_link />
<cms:else />
<cms:show k_error />
</cms:if>
<cms:else />
<cms:form enctype="multipart/form-data" method='post' anchor='0'>
<cms:if k_success >
<cms:send_mail from=k_email_from to=k_email_to subject='New account registration'>
The following is an email sent by a user who registered for an account on xyz.com:
<cms:show k_success />
</cms:send_mail>
<cms:member_process_registration_form
company_name=frm_company_name
/>
<cms:member_process_registration_form
_send_mail='0'
/>
<cms:if k_success >
<cms:set_flash name='success_msg' value='1' />
<cms:redirect k_page_link />
</cms:if>
</cms:if>
<cms:if k_error >
<p class="notice"><font color='red'>
<cms:each k_error >
<cms:if item='<b>Name:</b> Page already exists by this name' >
<cms:set item='<b>Login Username:</b> Login Username already exists' />
</cms:if>
<cms:show item /><br />
</cms:each>
</font></p>
</cms:if>
<div class="member-form">
<p>* All fields must be filled in. *</p>
<label>Your Name</label>
<cms:input name='member_displayname' Label='Your Name' type='text' required='1' /><br />
<label>Login Username</label>
<cms:input name='member_name' Label='Login Username' type='text' required='1' /><br />
<label>New Password</label>
<cms:input name='member_password' Label='Password' type='password' required='1' /><br />
<label>Repeat Password</label>
<cms:input name='member_password_repeat' Label='Repeat Password' type='password' required='1' /><br />
<label>Email</label>
<cms:input name='member_email' Label='Email' type='text' required='1' /><br />
<label>Company Name</label>
<cms:input name='company_name' Label='Company Name' type='text' required='1' /><br />
<button type="submit" name="submit" value="Create" class="submit">Create</button>
<button type="button" ONCLICK="window.location.href='../html/ourproducts.php'" value="Back" class="submit">Back</button>
</div>
</cms:form>
</cms:if>
</cms:if>
I tried this code, most of it did worked. But there are some part of the code is incorrect.
1. The mail that contain verification link still being sent. I need to remove the verification link in the mail as it will be manually activated by site owner.
2. As you can seen from code above, the username and login name cannot repeatedly created, it will prompt message to show that they are existed. Here is my problem, the system will send notification mail to site owner about the awaiting approval even though the registration process wasn't passed.
ex:
first user:
name: nsy
username: nsy
password: 123456
company name: test
second user:
name: nsy
username: nsy
password: 789012
company name: bbbb
The first user already takes the name of nsy, it already in the system. And the second user attempt to use the same name, nsy, the system prompt message about this name already existed. Once the second user clicked on submit, the system will sent notification to the site owner about approval before the second user do any edit on name. The register procedure is not complete, yet system already sent out old info.
The site owner keep receiving the same mail if I keep pressing on the submit button even though the system prompted the message of existed input field. For example:
second user:
name: nsy
username: nsy
password: 789012
company name: bbbb
If I press submit 10 times on same data above, the message prompted about existed input field and user need to change it, the registration process is not complete, yet the site owner will receive 10 of this notification about same data.