Fix silly mistake.
authorCameron Ball <c.ball1729@gmail.com>
Wed, 22 Oct 2014 15:51:03 +0000 (23:51 +0800)
committerCameron Ball <c.ball1729@gmail.com>
Wed, 22 Oct 2014 15:51:03 +0000 (23:51 +0800)
Controllers/UserAuthController.php
DataAccess/DataMapper/DataMapper.php
public_html/index.php

index 1b66204..c85988a 100644 (file)
@@ -48,7 +48,7 @@ class UserAuthController implements IDivineController
         
         $this->_facebookSession = $this->isSessionLongLived($facebookSession) ? $facebookSession->getLongLivedSession() : $facebookSession;
         $this->_facebookRequest = (new FacebookRequest($this->_facebookSession, 'GET', '/me?fields=hometown,first_name,last_name'))->execute();
-        
+
         $id = $this->_facebookRequest->getGraphObject(GraphUser::className())->getId();
         
         // If the user is not in the DB, create them.
@@ -77,7 +77,7 @@ class UserAuthController implements IDivineController
     private function registerUser()
     {
         $userProfile = $this->_facebookRequest->getGraphObject(GraphUser::className());    
-        
+
         $homeTownPageId = $userProfile->getProperty('hometown')->getProperty('id');
         $pageRequest = (new FacebookRequest($this->_facebookSession, 'GET', '/' . $homeTownPageId ))->execute();
         $pageLocation = $pageRequest->getGraphObject(GraphLocation::className())->getProperty('location')->cast(GraphLocation::className());
@@ -86,7 +86,7 @@ class UserAuthController implements IDivineController
         $firstName = $userProfile->getFirstName();
         $lastName = $userProfile->getLastName();
         $facebookId = $userProfile->getId();
-        
+
         //TODO: Is insantiating the VO classes here a good idea?
         $newUser = $this->_userStepByStepBuilder->With_Country(new \Domain\VOs\Country($country))
                                                 ->With_DisplayName($firstName)
@@ -94,11 +94,9 @@ class UserAuthController implements IDivineController
                                                 ->With_Tags(array())
                                                 ->With_FacebookId($facebookId)
                                                 ->build();
-        
-        $newUser->setAuthToken($this->_facebookSession->getToken());
-        
+                
         $this->_userRepository->save($newUser);
-        
+
         return $newUser;
     }
     
index 2a8c9e6..e37d377 100644 (file)
@@ -56,21 +56,19 @@ class DataMapper implements IDataMapper
     public function save(IDivineEntity $entity)\r
     {\r
         $queries = AbstractPopulationHelper::generateUpdateSaveQuery($this->_maps, $entity, $entity->getId(), $this->_db);\r
-        \r
+\r
         $flattened = array();\r
         $flattened_tables = array();\r
         foreach($queries as $index => $query)\r
         {\r
             $this_table = $query['table'];\r
             $this_columns = $query['columns'];\r
-            $add = false;\r
             \r
             for($i = $index+1; $i<count($queries); $i++)\r
             {\r
-                if($queries[$i]['table'] == $this_table && !in_array($queries[$i]['table'], $flattened_tables) && isset($query['id'])) //only merge create queries, updates are fine to run multiple times\r
+                if($queries[$i]['table'] == $this_table && !in_array($queries[$i]['table'], $flattened_tables) && !isset($query['id'])) //only merge create queries, updates are fine to run multiple times\r
                 {\r
                     $this_columns = array_merge($this_columns, $queries[$i]['columns']);\r
-                    $add = true;\r
                 }\r
             }\r
             \r
index 692cfd4..56627e8 100644 (file)
@@ -3,6 +3,7 @@
 //TODO: Config this\r
 header("Access-Control-Allow-Origin: http://172.17.12.110:8000");\r
 header("Access-Control-Allow-Origin: http://roll.divinelegy.meeples:8000");\r
+header("Access-Control-Allow-Origin: http://roll.divinelegy.dev:8000");\r
 \r
 require_once('../vendor/autoload.php');\r
 \r