]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Make email domain checking optional, as some statusnet installations (such as those...
authorCraig Andrews <candrews@integralblue.com>
Mon, 26 Oct 2009 14:31:12 +0000 (10:31 -0400)
committerCraig Andrews <candrews@integralblue.com>
Mon, 26 Oct 2009 14:31:12 +0000 (10:31 -0400)
systems, and this check will always fail.

actions/emailsettings.php
actions/invite.php
actions/register.php
config.php.sample
lib/default.php
plugins/OpenID/finishopenidlogin.php
plugins/OpenID/openid.php

index 6eff06c0d667b66fc6056ed706a83a7141efb89a..67b991cdc8b3d09afffe2349c3f9d925d2719898 100644 (file)
@@ -326,7 +326,7 @@ class EmailsettingsAction extends AccountSettingsAction
             $this->showForm(_('Cannot normalize that email address'));
             return;
         }
-        if (!Validate::email($email, true)) {
+        if (!Validate::email($email, common_config('email', 'check_domain'))) {
             $this->showForm(_('Not a valid email address'));
             return;
         } else if ($user->email == $email) {
index 788130c5825e4989a9e7f93fc6baf0270fe184bd..3015202e9e69b39fcc59563bd16f42c34d0a727f 100644 (file)
@@ -68,7 +68,7 @@ class InviteAction extends CurrentUserDesignAction
 
         foreach ($addresses as $email) {
             $email = trim($email);
-            if (!Validate::email($email, true)) {
+            if (!Validate::email($email, common_config('email', 'check_domain'))) {
                 $this->showForm(sprintf(_('Invalid email address: %s'), $email));
                 return;
             }
index 100ab74242c74a4244739a3fcc46a56ca937c027..a6c1a903aab33811e019176ae88d011aa79e056d 100644 (file)
@@ -191,7 +191,7 @@ class RegisterAction extends Action
             if (!$this->boolean('license')) {
                 $this->showForm(_('You can\'t register if you don\'t '.
                                   'agree to the license.'));
-            } else if ($email && !Validate::email($email, true)) {
+            } else if ($email && !Validate::email($email, common_config('email', 'check_domain'))) {
                 $this->showForm(_('Not a valid email address.'));
             } else if (!Validate::string($nickname, array('min_length' => 1,
                                                           'max_length' => 64,
index 997c9d6b0bccb971157c6cc50f5689fc17419f87..9fccb84f3b76f3816130759e74dac69b15d11c7f 100644 (file)
@@ -104,6 +104,10 @@ $config['sphinx']['port'] = 3312;
 // $config['site']['timezone'] = 'Pacific/Auckland';
 // $config['site']['language'] = 'en_NZ';
 
+// When validating user supplied email addresses, validate if the domain
+// is running an SMTP server.
+// $config['mail']['check_domain'] = true;
+
 // Email info, used for all outbound email
 // $config['mail']['notifyfrom'] = 'microblog@example.net';
 // $config['mail']['domain'] = 'microblog.example.net';
index 30e43eefbd65394762bd0a5d4d447603b75997a3..9f64cc9e48b2d870e0b501600dd8d20dcc2deacd 100644 (file)
@@ -84,7 +84,8 @@ $default =
               'image' => 'http://i.creativecommons.org/l/by/3.0/80x15.png'),
         'mail' =>
         array('backend' => 'mail',
-              'params' => null),
+              'params' => null,
+              'domain_check' => true),
         'nickname' =>
         array('blacklist' => array(),
               'featured' => array()),
index 50a9c15c87a8730e2b9fb7ce11f415e97cb93d32..ff0b451d30e28e4e1b367e666df9894750d99b4a 100644 (file)
@@ -265,7 +265,7 @@ class FinishopenidloginAction extends Action
             $fullname = '';
         }
 
-        if (!empty($sreg['email']) && Validate::email($sreg['email'], true)) {
+        if (!empty($sreg['email']) && Validate::email($sreg['email'], common_config('email', 'check_domain'))) {
             $email = $sreg['email'];
         } else {
             $email = '';
index 0944117c00fc5e0b2a62401184ac7ea2ac3db822..b76497c28aaedcd9dc0229ad2ff7193fdca2cf1d 100644 (file)
@@ -241,7 +241,7 @@ function oid_update_user(&$user, &$sreg)
 
     $orig_user = clone($user);
 
-    if ($sreg['email'] && Validate::email($sreg['email'], true)) {
+    if ($sreg['email'] && Validate::email($sreg['email'], common_config('email', 'check_domain'))) {
         $user->email = $sreg['email'];
     }