コード例 #1
0
ファイル: ValidatorTest.php プロジェクト: nilamdoc/KYCGlobal
 public function testEmailDomainCheckBadMxrr()
 {
     Mocker::overwriteFunction('lithium\\util\\getmxrr', function ($host, &$mxhosts) {
         $mxhosts = array();
         return true;
     });
     $this->assertTrue(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
 }
コード例 #2
0
ファイル: ValidatorTest.php プロジェクト: WarToaster/HangOn
 /**
  * Tests email address validation, with additional hostname lookup
  *
  * @return void
  */
 public function testEmailDomainCheck()
 {
     $this->skipIf(dns_check_record("google.com") === false, "No internet connection.");
     $this->assertTrue(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
 }
コード例 #3
0
 /**
  * Tests email address validation, with additional hostname lookup
  *
  * @return void
  */
 public function testEmailDomainCheck()
 {
     $this->assertTrue(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
 }
コード例 #4
0
 /**
  * Tests email address validation, with additional hostname lookup
  */
 public function testEmailDomainCheck()
 {
     $message = "No internet connection established.";
     $this->skipIf(!$this->_hasNetwork(), $message);
     $this->assertTrue(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
     $this->assertFalse(Validator::isEmail('*****@*****.**', null, array('deep' => true)));
 }
コード例 #5
0
ファイル: User.php プロジェクト: nateabele/Minerva-Plugin
			if(Validator::rule('uniqueEmail', $params['data']['email']) === false) {
				$params['data']['email'] = ''; 
			}
			
		} else {
			// If the fields password and password_confirm both exist, then validate the password field too
			if((isset($params['data']['password'])) && (isset($params['data']['password_confirm']))) {
				if(Validator::rule('moreThanFive', $params['data']['password']) === true) {
					$params['data']['password'] = String::hash($params['data']['password']); // will be sha512
				}
			}
			
			// If the new_email field was passed, the user is requesting to update their e-mail, we will set it and send an email to allow them to confirm, once confirmed it will be changed
			if(isset($params['data']['new_email'])) {
				// Unique E-mail validation
				if((Validator::rule('uniqueEmail', $params['data']['new_email']) === false) || (Validator::isEmail($params['data']['new_email']) === false)) {
					// Invalidate
					$params['data']['new_email'] = '';
				} else {
					$params['data']['approval_code'] = Util::unique_string(array('hash' => 'md5'));
					Email::changeUserEmail(array('first_name' => $params['data']['first_name'], 'last_name' => $params['data']['last_name'], 'to' => $params['data']['new_email'], 'approval_code' => $params['data']['approval_code']));
				}
			}
		}
	
	}
	
	//$data = array($params['entity']->file);
	//Asset::save($data);
	
	return $chain->next($self, $params, $chain);