Exemplo n.º 1
0
function getUser($email = '*****@*****.**')
{
    if (DB\countRows('users', "email = ?", array($email)) == 0) {
        return newUser($email, 'big-joe-' . time(), 'something');
    } else {
        return User::loadFromEmailAddr($email);
    }
}
Exemplo n.º 2
0
 function testOneEmailAddressMayNotBeAssociatedWithMultipleAccounts()
 {
     newUser($email = '*****@*****.**', $username = '******', $password = '******');
     $this->get('/account/signup');
     $this->submitFormExpectingErrors($this->getForm(), array('username' => 'bigkid', 'email' => '*****@*****.**', 'password1' => 't0pS33cret', 'password2' => 't0pS33cret'));
     $this->assertContains("//div[contains(., 'already have an account')]");
     assertEqual(1, DB\countRows('users', 'email = ?', array('*****@*****.**')));
 }
Exemplo n.º 3
0
function isValidCode($code)
{
    return DB\countRows('confirmation_codes', 'code = ? AND expires >= NOW()', array($code)) > 0;
}