Disabled email check
authorBernhard Fröhlich <bernhard@cacert.org>
Thu, 3 Jan 2019 22:11:11 +0000 (23:11 +0100)
committerBernhard Fröhlich <bernhard@cacert.org>
Thu, 3 Jan 2019 22:11:11 +0000 (23:11 +0100)
includes/account.php
includes/general.php
stamp/report.php
www/index.php

index fda748c..6c844d7 100644 (file)
@@ -136,7 +136,7 @@ function buildSubjectFromSession() {
                        showfooter();
                        exit;
                }
-               $checkemail = checkEmail($_REQUEST['newemail']);
+               $checkemail = checkEmailDummy($_REQUEST['newemail']);
                if($checkemail != "OK")
                {
                        showheader(_("My CAcert.org Account!"));
@@ -642,7 +642,7 @@ function buildSubjectFromSession() {
                        showfooter();
                        exit;
                }
-               $checkemail = checkEmail($authaddy);
+               $checkemail = checkEmailDummy($authaddy);
                if($checkemail != "OK")
                {
                        showheader(_("My CAcert.org Account!"));
index 785eed6..c5c96db 100644 (file)
                @unlink($tmpfname);
        }
 
+    /* This function is used on testservers to replace the email address check, so you can create accounts
+       for arbitraty mail addresses. It only roughly checks the syntax of the address.
+       Do not use this on a production server! " */
+       function checkEmailDummy($email)
+       {
+               $myemail = mysql_real_escape_string($email);
+               if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\+\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email))
+               {
+                       $line = "250 No address check on testserver.";
+                       $query = "insert into `pinglog` set `when`=NOW(), `email`='$myemail', `result`='$line'";
+                       if(is_array($_SESSION['profile'])) $query.=", `uid`='".intval($_SESSION['profile']['id'])."'";
+                       mysql_query($query);
+
+                       if(substr($line, 0, 3) != "250")
+                               return $line;
+                       else
+                               return "OK";
+           }
+           return "Invalid mail address";
+       }
+
        function checkEmail($email)
        {
                $myemail = mysqli_real_escape_string($_SESSION['mconn'], $email);
index 2bc55af..356ae67 100644 (file)
@@ -40,7 +40,7 @@
 
        if($process != "")
        {
-               $checkemail = checkEmail($email);
+               $checkemail = checkEmailDummy($email);
                if($checkemail != "OK")
                {
                        $errmsg = $checkemail;
index 8449749..4f787ba 100644 (file)
@@ -427,7 +427,7 @@ if ($oldid == 52 )
 
                if($id == 2)
                {
-                       $checkemail = checkEmail($_SESSION['signup']['email']);
+                       $checkemail = checkEmailDummy($_SESSION['signup']['email']);
                        if($checkemail != "OK")
                        {
                                $id = 1;