diff --git a/Rocksolid_Light/common/register.php b/Rocksolid_Light/common/register.php
index 49f7c32..ed259b1 100644
--- a/Rocksolid_Light/common/register.php
+++ b/Rocksolid_Light/common/register.php
@@ -1,3 +1,4 @@
+
';
-/* Generate email */
- $no_verify=explode(' ', $CONFIG['no_verify']);
- foreach($no_verify as $no) {
- if (strlen($_SERVER['HTTP_HOST']) - strlen($no) === strrpos($_SERVER['HTTP_HOST'],$no)) {
- $CONFIG['verify_email'] = false;
- }
- }
-
-if($CONFIG['verify_email']) {
-
-# Log email address attempts to avoid abuse
- if(file_exists($email_registry)) {
- $tried_email = unserialize(file_get_contents($email_registry));
- }
- $tried_email[$user_email]['time'] = time();
- file_put_contents($email_registry, serialize($tried_email));
+ echo 'Create account: '.$_POST['username'].'
';
+ /* Generate email */
+ # only check for no verification is the field has been populated
+ if (!empty($CONFIG['no_verify']))
+ {
+ $no_verify=explode(' ', $CONFIG['no_verify']);
+ foreach($no_verify as $no) {
+ if (strlen($_SERVER['HTTP_HOST']) - strlen($no) === strrpos($_SERVER['HTTP_HOST'],$no)) {
+ $CONFIG['verify_email'] = false;
+ }
+ }
+ }
+ if($CONFIG['verify_email']) {
+ # Log email address attempts to avoid abuse
+ if(file_exists($email_registry)) {
+ $tried_email = unserialize(file_get_contents($email_registry));
+ }
+ $tried_email[$user_email]['time'] = time();
+ file_put_contents($email_registry, serialize($tried_email));
-$mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
-);
+ $mail->SMTPOptions = array(
+ 'ssl' => array(
+ 'verify_peer' => false,
+ 'verify_peer_name' => false,
+ 'allow_self_signed' => true
+ )
+ );
-$mail->IsSMTP();
-$mail->CharSet = 'UTF-8';
-$mail->Host = $mailer['host'];
-$mail->SMTPAuth = true;
+ $mail->IsSMTP();
+ #uncomment below to enable debugging
+ #$mail->SMTPDebug = 3;
-$mail->Port = $mailer['port'];
-$mail->Username = $mailer['username'];
-$mail->Password = $mailer['password'];;
-$mail->SMTPSecure = 'tls';
+ $mail->CharSet = 'UTF-8';
+ $mail->Host = $mailer['host'];
+ $mail->SMTPAuth = true;
-$mail->setFrom($mail_user.'@'.$mail_domain, $mail_name);
-$mail->addAddress($user_email);
+ $mail->Port = $mailer['port'];
+ $mail->Username = $mailer['username'];
+ $mail->Password = $mailer['password'];;
+ $mail->SMTPSecure = 'tls';
+
+ $mail->setFrom($mail_user.'@'.$mail_domain, $mail_name);
+ $mail->addAddress($user_email);
-$mail->Subject = "Confirmation code for ".$_SERVER['HTTP_HOST'];
+ $mail->Subject = "Confirmation code for ".$_SERVER['HTTP_HOST'];
-foreach($mail_custom_header as $key => $value) {
- $mail->addCustomHeader($key, $value);
-}
+ foreach($mail_custom_header as $key => $value) {
+ $mail->addCustomHeader($key, $value);
+ }
-$mycode = create_code($username);
-$msg="A request to create an account on ".$_SERVER['HTTP_HOST'];
-$msg.=" has been made using ".$user_email.".\n\n";
-$msg.="If you did not request this, please ignore and the request will fail.\n\n";
-$msg.="This is your account creation code: ".$mycode."\n\n";
-$msg.="Note: replies to this email address are checked daily.";
-$mail->Body = wordwrap($msg,70);
+ $mycode = create_code($username);
+ $msg="A request to create an account on ".$_SERVER['HTTP_HOST'];
+ $msg.=" has been made using ".$user_email.".\n\n";
+ $msg.="If you did not request this, please ignore and the request will fail.\n\n";
+ $msg.="This is your account creation code: ".$mycode."\n\n";
+ $msg.="Note: replies to this email address are checked daily.";
+ $mail->Body = wordwrap($msg,70);
+
+ if (!$mail->send())
+ {
+ echo 'The message could not be sent.';
+ echo '
Error: ' . $mail->ErrorInfo;
+ }
+ else
+ {
+ echo 'An email has been sent to '.$user_email.'
';
+ echo 'Please enter the code from the email below:
';
+ }
+ }
-$mail->send();
-
- echo 'An email has been sent to '.$user_email.'
';
- echo 'Please enter the code from the email below:
';
- }
- echo '