blob: b1fc2d8926e29635e3362145a15243499e691813 [file] [log] [blame]
<?php
/*******************************************************************************
* Copyright (c) 2012 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Denis Roy (Eclipse Foundation)- initial API and implementation
*******************************************************************************/
ob_start();
?>
<div id="maincontent">
<div id="midcolumn" style="width: 678px;">
<h1><?= $pageTitle ?></h1>
<p>Welcome to the Eclipse.org community. Use the form below to create a new account to access our <a href="http://www.eclipse.org/forums">forums</a>, <a href="https://bugs.eclipse.org/bugs">Bugzilla</a>, <a href="http://wiki.eclipse.org">Wiki</a> and other Eclipse sites.</p>
<p><b style="font-size:150%;">Please note:</font></b> Eclipse is an open and transparent community. Most of what you submit on our site will be visible to everyone,
and your email address may be visible to users who use Bugzilla, Gerrit, Git, and our mailing lists. You may prefer to use an email account specifically for this purpose.</p>
<h3>Password recovery</h1>
<p>So you lost the sticky note that your password was written on? No worries -- just enter your email address and we'll send you instructions for resetting your password.</p>
<form name="passwd" method="post">
<table cellspacing="4">
<tr><td></td><td colspan="2" style="color:#900;"><?= $reset_error ?></td></tr>
<tr>
<td>E-mail address:</td><td><input type="text" name="username" value="<?= filter_var($username, FILTER_SANITIZE_EMAIL); ?>" size="42" maxlength="255" /></td>
<td id="msg_email" style='width:100px; color:red;'></td>
</tr>
<tr>
<td></td><td><input type="submit" name="submit" value="Reset my password!" /></td></tr>
</table>
<input type="hidden" name="stage" value="reset" />
</form>
<h3>Create a New Account</h1>
<form name="login" method="post">
<table cellspacing="4">
<tr><td></td><td colspan="2" style="color:#900;"><?= $error ?></td></tr>
<tr>
<td>E-mail&#160;address<font color="red">*</font>:</td><td><input type="text" name="username" value="<?= filter_var($username, FILTER_SANITIZE_EMAIL); ?>" size="32" maxlength="255" onBlur="fnCheckForm(this.name);" /></td>
<td id="msg_email" style='width:250px; color:red;'></td>
</tr>
<tr>
<td>First name<font color="red">*</font>:</td><td><input type="text" name="fname" value="<?= filter_var($fname, FILTER_SANITIZE_STRING); ?>" size="32" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td>
<td id="msg_fname" style='width:250px; color:red;'></td>
</tr>
<tr>
<td>Last name<font color="red">*</font>:</td><td><input type="text" name="lname" value="<?= filter_var($lname, FILTER_SANITIZE_STRING); ?>" size="32" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td>
<td id="msg_lname" style='width:250px; color:red;'></td>
</tr>
<tr>
<td>Password<font color="red">*</font>:</td><td><input type="password" name="password1" value="" size="16" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td>
<td id="msg_password1" style='width:250px; color:red;'></td>
</tr>
<tr>
<td>Password (again)<font color="red">*</font>:</td><td><input type="password" name="password2" value="" size="16" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td>
<td id="msg_password2" style='width:250px; color:red;'></td>
</tr><br />
<tr>
<td>(5 + 3) x 2 = ?<font color="red">*</font>:</td><td><input type="text" name="skill" value="" size="8" maxlength="255" onBlur="fnCheckForm(this.name);" /><br/></td>
<td id="msg_skill" style='width:250px; color:red;'></td>
</tr>
<tr>
<td></td><td><input type="checkbox" name="agree" value="1" onClick="fnCheckForm(this.name);" /> I agree to not create an account for the sole purpose of posting SPAM. I also agree to the Eclipse.org <a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a> and <a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a>.<font color="red">*</font></td>
<td id="msg_agree" style='width:250px; color:red;'></td>
</tr>
<tr>
<td></td><td><input id="btn_submit" disabled="disabled" type="submit" name="submit" value="Create account!" /></td></tr>
</table>
<input type="hidden" name="stage" value="create" />
</form>
</div>
</div>
<script language="javascript">
document.forms['passwd'].username.focus();
function fnCheckEmail(field) {
var rValue = false;
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if(!re.test(document.forms['login'].username.value)) {
if(field == "username") {
document.getElementById('msg_email').innerHTML = "<b>Your email address doesn't appear valid!</b>";
}
document.getElementById('btn_submit').disabled="disabled";
}
else {
document.getElementById('msg_email').innerHTML = "";
rValue = true;
}
return rValue;
}
function fnCheckFName(field) {
var rValue = true;
if(document.forms['login'].fname.value == "") {
rValue = false;
if(field == "fname") {
document.getElementById('msg_fname').innerHTML = "<b>Please enter your name.</b>";
}
}
else {
document.getElementById('msg_fname').innerHTML = "";
}
return rValue;
}
function fnCheckLName(field) {
var rValue = true;
if(document.forms['login'].lname.value == "") {
rValue = false;
if(field == "lname") {
document.getElementById('msg_lname').innerHTML = "<b>Please enter your name.</b>";
}
}
else {
document.getElementById('msg_lname').innerHTML = "";
}
return rValue;
}
function fnCheckSkill(field) {
var rValue = true;
if(document.forms['login'].skill.value != "16") {
rValue = false;
if(field == "skill") {
document.getElementById('msg_skill').innerHTML = "<b>That is not the right answer!</b>";
}
}
else {
document.getElementById('msg_skill').innerHTML = "";
}
return rValue;
}
function fnCheckAgree(field) {
var rValue = true;
if(!document.forms['login'].agree.checked) {
rValue = false;
if(field == "agree") {
document.getElementById('msg_agree').innerHTML = "<b>That is not the right answer!</b>";
}
}
else {
document.getElementById('msg_agree').innerHTML = "";
}
return rValue;
}
function fnCheckPasswords(field) {
var rValue = true;
if(document.forms['login'].password1.value == "" || document.forms['login'].password1.value != document.forms['login'].password2.value) {
rValue = false;
if(field == "password1") {
document.getElementById('msg_password1').innerHTML = "<b>Your passwords do not match!</b>";
}
}
else {
if (!document.forms['login'].password1.value.match(/(?=^.{6,}$)(?=.*[\d|\W])(?=.*[A-Za-z]).*$/)) {
rValue = false;
document.getElementById('msg_password1').innerHTML = "<b>Your password is too simple. It must be at least 6 characters, contain one character and one number.</b>";
}
}
if(rValue) {
document.getElementById('msg_password1').innerHTML = "";
}
return rValue;
}
function fnCheckForm(field) {
if(fnCheckEmail(field) && fnCheckFName(field) && fnCheckLName(field) && fnCheckPasswords(field) && fnCheckSkill(field) && fnCheckAgree(field)) {
document.getElementById('btn_submit').disabled="";
}
}
</script>
<?php
$html = ob_get_contents();
ob_end_clean();
?>