Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support email addresses as UIDs #55

Merged
merged 1 commit into from

2 participants

@mfairchild365

See #54

@saltybeagle saltybeagle merged commit 18ccf67 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2014
  1. @mfairchild365
This page is out of date. Refresh to see the latest.
View
2  src/SiteMaster/Core/DBTests/BaseTestDataInstaller.php
@@ -18,7 +18,7 @@ public function install() {
'last_name' => 'test1',
'email' => 'test1@test.com'
));
- $user2 = User::createUser(2, 'test', array(
+ $user2 = User::createUser('email@provider.com', 'test', array(
'first_name' => 'test2',
'last_name' => 'test2',
'email' => 'test2@test.com'
View
9 src/SiteMaster/Core/Registry/Query.php
@@ -101,11 +101,14 @@ public function getByUser($query)
{
$details = explode('@', $query);
- if (count($details) != 2) {
+ if (count($details) < 2) {
throw new InvalidArgumentException('Must provide a query in the format of uid@provider');
}
-
- if (!$user = User::getByUIDAndProvider($details[0], $details[1])) {
+
+ $provider = array_pop($details);
+ $uid = implode('@', $details);
+
+ if (!$user = User::getByUIDAndProvider($uid, $provider)) {
return array();
}
View
4 tests/SiteMaster/Core/Registry/QueryDBTest.php
@@ -14,7 +14,7 @@ public function getByUser()
$this->setUpDB();
$query = new Query();
- $result = $query->query('2@test');
+ $result = $query->query('email@provider.com@test');
$sites = array();
foreach ($result as $site) {
@@ -26,7 +26,7 @@ public function getByUser()
'http://www.test.com/test/'
);
- $this->assertEquals($expected, $sites, '2@test should have 2 accepted sites');
+ $this->assertEquals($expected, $sites, 'email@provider.com@test should have 2 accepted sites');
$result = $query->query('1@test');
$sites = array();
Something went wrong with that request. Please try again.