remove extra spaces
Signed-off-by: Christopher Guindon <chris.guindon@eclipse.org>
diff --git a/site_login/createaccount.php b/site_login/createaccount.php
index a632f82..e5789b0 100755
--- a/site_login/createaccount.php
+++ b/site_login/createaccount.php
@@ -16,7 +16,7 @@
$pageAuthor = "Eclipse Foundation, Inc.";
header("Content-type: text/html; charset=utf-8");
header("Cache-Control: no-cache, must-revalidate");
-
+
$username = $App->getHTTPParameter("username", "POST");
$submit = $App->getHTTPParameter("submit", "POST");
$fname = $App->getHTTPParameter("fname", "POST");
@@ -28,11 +28,11 @@
$stage = $App->getHTTPParameter("stage");
$token = $App->getHTTPParameter("t");
$p = $App->getHTTPParameter("p");
-
+
$error = "";
$reset_error = "";
-
-
+
+
# Sanitize for XSS
$username = preg_replace($xss_patterns, '', $username);
$fname = preg_replace($name_regexp, '', $fname);
@@ -40,28 +40,28 @@
$password1 = preg_replace($xss_patterns, '', $password1);
$password2 = preg_replace($xss_patterns, '', $password2);
$token = preg_replace("/[^a-zA-Z0-9]/", "", $token);
-
+
if($token != "" && $stage == "") {
$stage = "confirm";
}
-
+
if($token != "" && $p == "p") {
$stage = "reset2";
}
if($token != "" && $password1 != "") {
$stage = "reset3";
}
-
+
$includefile = "content/en_" . $App->getScriptName();
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$password1 = stripslashes($password1);
}
-
+
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/friends/friend.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/session.class.php");
require_once '/home/data/httpd/eclipse-php-classes/system/ldapconnection.class.php';
$Friend = new Friend();
-
+
if($stage == "create") {
if($username != "" && $fname != "" && $lname != "" && $password1 != "") {
# Create an account. Check to ensure this IP address hasn't flooded us with requests
@@ -80,14 +80,14 @@
$error = "<b>That account already exists. If you cannot remember your password, please use the password reset option below.</b> (8725s)";
# Jot this down to avoid repetitively polling ldap
$App->eclipse_sql("INSERT INTO account_requests VALUES (" . $App->returnQuotedString($App->sqlSanitize($username)) . ",
- '',
- " . $App->returnQuotedString($App->sqlSanitize($fname)) . ",
+ '',
+ " . $App->returnQuotedString($App->sqlSanitize($fname)) . ",
" . $App->returnQuotedString($App->sqlSanitize($lname)) . ",
- '',
- " . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
+ '',
+ " . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
NOW(),
" . $App->returnQuotedString("CREATE_FAILED") . ")");
-
+
$EventLog = new EvtLog();
$EventLog->setLogTable("__ldap");
$EventLog->setPK1($username);
@@ -100,18 +100,18 @@
if($agree != 1) {
$error .= "- You must agree to the terms and contitions of use<br />";
}
-
+
if(!preg_match($email_regexp, $username)) {
$error .= "- Your email address is not formatted correctly<br />";
}
-
+
if($skill != 16) {
$error .= "- You haven't answered the mathematical question correctly<br />";
}
if(!preg_match("/(?=^.{6,}$)(?=.*[\d|\W])(?=.*[A-Za-z]).*$/", $password1)) {
$error .= "- Your password does not meet the complexity requirements. It must be at least 6 characters long, and contain one number or one symbol.<br />";
}
-
+
# Houston, we have a problem.
if($error != "") {
$error = "<b>Your request could not be processed for the following reason(s):<br/>" . $error . "</b>";
@@ -121,14 +121,14 @@
$token = $App->getAlphaCode(64);
mysql_set_charset('utf8');
$App->eclipse_sql("INSERT INTO account_requests VALUES (" . $App->returnQuotedString($App->sqlSanitize(trim($username))) . ",
- '',
- " . $App->returnQuotedString($App->sqlSanitize(trim($fname))) . ",
+ '',
+ " . $App->returnQuotedString($App->sqlSanitize(trim($fname))) . ",
" . $App->returnQuotedString($App->sqlSanitize(trim($lname))) . ",
'" . $App->sqlSanitize($password1) . "',
" . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
NOW(),
" . $App->returnQuotedString($token) . ")");
-
+
$EventLog = new EvtLog();
$EventLog->setLogTable("__ldap");
$EventLog->setPK1($token);
@@ -145,9 +145,9 @@
$mail .= " -- Eclipse webmaster\n";
$headers = 'From: Eclipse Webmaster (automated) <webmaster@eclipse.org>' . "\n" . 'Content-Type: text/plain; charset=UTF-8';
mail($username, "Eclipse Account Registration", $mail, $headers);
-
+
$includefile = "content/en_createsuccess.php";
- }
+ }
}
ldap_close($ds);
}
@@ -172,19 +172,19 @@
$ldap = new LDAPConnection();
$token = $App->getAlphaCode(64);
$App->eclipse_sql("INSERT IGNORE INTO account_requests VALUES (" . $App->returnQuotedString($App->sqlSanitize($username)) . ",
- '',
- " . $App->returnQuotedString("RESET") . ",
+ '',
+ " . $App->returnQuotedString("RESET") . ",
" . $App->returnQuotedString("RESET") . ",
'" . $App->sqlSanitize($password1) . "',
" . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
NOW(),
" . $App->returnQuotedString($token) . ")");
-
+
if(!preg_match($email_regexp, $username)) {
$reset_error = "<b>Your email address is not formatted correctly.</b><br />";
}
elseif($ldap->checkEmailAvailable($username)) {
- $reset_error = "<b>We were unable to determine your identity with the information you've supplied.</b> Perhaps you don't have an Eclipse.org account, or your account is under a different email address.(8x27s)";
+ $reset_error = "<b>We were unable to determine your identity with the information you've supplied.</b> Perhaps you don't have an Eclipse.org account, or your account is under a different email address.(8x27s)";
}
else {
# Send mail to dest
@@ -220,8 +220,8 @@
# If we can't find a record, insert a record preventing this dude from bombing us
$token = $App->getAlphaCode(64);
$App->eclipse_sql("INSERT INTO account_requests VALUES (" . $App->returnQuotedString($App->sqlSanitize($token)) . ",
- '',
- 'token_failed',
+ '',
+ 'token_failed',
'token_failed',
'token_failed',
" . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
@@ -239,10 +239,10 @@
$EventLog->setLogAction("PASSWD_RESET_CONF");
$EventLog->insertModLog($myrow['email']);
# Update this row, change IP address to reflect that of the person who successfully confirmed this email to avoid bombing
- # $SQL = "UPDATE account_requests SET token = 'CONFIRM_SUCCESS', ip = " . $App->returnQuotedString($App->sqlSanitize($_SERVER['REMOTE_ADDR']))
+ # $SQL = "UPDATE account_requests SET token = 'CONFIRM_SUCCESS', ip = " . $App->returnQuotedString($App->sqlSanitize($_SERVER['REMOTE_ADDR']))
# . " WHERE token = " . $App->returnQuotedString($App->sqlSanitize($token));
#$rs = $App->eclipse_sql($SQL);
- }
+ }
}
}
if($stage == "reset3") {
@@ -257,14 +257,14 @@
# If we can't find a record, insert a record preventing this dude from bombing us
$token = $App->getAlphaCode(64);
$App->eclipse_sql("INSERT INTO account_requests VALUES (" . $App->returnQuotedString($App->sqlSanitize($token)) . ",
- '',
- 'token_failed',
+ '',
+ 'token_failed',
'token_failed',
'token_failed',
" . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
NOW(),
'TOKEN_FAILED')"
- );
+ );
}
else {
if(!preg_match("/(?=^.{6,}$)(?=.*\d)(?=.*[A-Za-z]).*$/", $password1)) {
@@ -272,23 +272,23 @@
}
else {
# Update this row, change IP address to reflect that of the person who successfully confirmed this password to avoid bombing
- $SQL = "UPDATE account_requests SET token = 'PASSWORD_SUCCESS', password='" . $App->sqlSanitize($password1) . "', ip = " . $App->returnQuotedString($App->sqlSanitize($_SERVER['REMOTE_ADDR']))
+ $SQL = "UPDATE account_requests SET token = 'PASSWORD_SUCCESS', password='" . $App->sqlSanitize($password1) . "', ip = " . $App->returnQuotedString($App->sqlSanitize($_SERVER['REMOTE_ADDR']))
. " WHERE token = " . $App->returnQuotedString($App->sqlSanitize($token));
$rs = $App->eclipse_sql($SQL);
-
+
$bzpass = &generateBugzillaSHA256Password($password1);
$SQL = "UPDATE profiles SET cryptpassword='" . $App->sqlSanitize($bzpass) . "' WHERE login_name = " . $App->returnQuotedString($App->sqlSanitize($myrow['email'])) . " LIMIT 1";
$App->bugzilla_sql($SQL);
$App->ipzilla_sql($SQL);
-
+
$EventLog = new EvtLog();
$EventLog->setLogTable("__ldap");
$EventLog->setPK1($token);
$EventLog->setPK2($_SERVER['REMOTE_ADDR']);
$EventLog->setLogAction("PASSWD_RESET_SUCCESS");
- $EventLog->insertModLog($myrow['email']);
+ $EventLog->insertModLog($myrow['email']);
}
- }
+ }
}
}
if($stage == "confirm") {
@@ -309,8 +309,8 @@
# If we can't find a record, insert a record preventing this dude from bombing us
$token = $App->getAlphaCode(64);
$App->eclipse_sql("INSERT INTO account_requests VALUES (" . $App->returnQuotedString($App->sqlSanitize($token)) . ",
- '',
- 'token_failed',
+ '',
+ 'token_failed',
'token_failed',
'token_failed',
" . $App->returnQuotedString($_SERVER['REMOTE_ADDR']) . ",
@@ -326,28 +326,28 @@
}
else {
# Update this row, change IP address to reflect that of the person who successfully confirmed this email to avoid bombing
- $SQL = "UPDATE account_requests SET token = 'CONFIRM_SUCCESS', ip = " . $App->returnQuotedString($App->sqlSanitize($_SERVER['REMOTE_ADDR']))
+ $SQL = "UPDATE account_requests SET token = 'CONFIRM_SUCCESS', ip = " . $App->returnQuotedString($App->sqlSanitize($_SERVER['REMOTE_ADDR']))
. " WHERE token = " . $App->returnQuotedString($App->sqlSanitize($token));
$rs = $App->eclipse_sql($SQL);
-
+
$EventLog = new EvtLog();
$EventLog->setLogTable("__ldap");
$EventLog->setPK1($App->sqlSanitize($token));
$EventLog->setPK2($_SERVER['REMOTE_ADDR']);
$EventLog->setLogAction("ACCT_CREATE_CONFIRM_SUCCESS");
$EventLog->insertModLog($myrow['email']);
- }
+ }
}
else {
$error = "<b>We were unable to validate your request. The supplied token is invalid. Please contact webmaster@eclipse.org.</b>";
}
}
}
-
+
include($includefile);
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
-
+
function generatePassword($_num_chars) {
global $App;
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1023456789,.;:/@#$%^&*()-_=+";
@@ -371,6 +371,6 @@
}
return $rValue;
}
-
+
?>
\ No newline at end of file