translate('Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!'), '', '', '', '', '', '') ?>
Search for new ways to make your favorite foods, or find new foods based on what you have in your house right now. It's fast and easy to find something according to your tastes.
translate('The community is working on developing a community site to serve as a repository and gallery for ZF2 modules. The project is available %son GitHub%s. The site is currently live and currently contains a list of some of the modules already available for ZF2.'), '', '') ?>
Ever found it hard to keep track of what you have on hand? With Food280 you can keep a constant log of the food you've used. Just enter it in and then filter your searches based on it.
translate('If you need any help or support while developing with ZF2, you may reach us via IRC: %s#zftalk on Freenode%s. We\'d love to hear any questions or feedback you may have regarding the beta releases. Alternatively, you may subscribe and post questions to the %smailing lists%s.'), '', '', '', '') ?>
You get home from work or school and wonder what you want to eat? Why do you want to eat it? I can't think of anything else to put here so just use this feature and GO!
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/module/Recipe/view/recipe/recipe/showcookbook.phtml b/app/module/Recipe/view/recipe/recipe/showcookbook.phtml
new file mode 100755
index 0000000..bb5e4d4
--- /dev/null
+++ b/app/module/Recipe/view/recipe/recipe/showcookbook.phtml
@@ -0,0 +1,92 @@
+headTitle($title);
+?>
+
+
+
+
\ No newline at end of file
diff --git a/app/module/RecipeOLD/view/recipe/recipe/edit.phtml b/app/module/RecipeOLD/view/recipe/recipe/edit.phtml
new file mode 100755
index 0000000..05cf291
--- /dev/null
+++ b/app/module/RecipeOLD/view/recipe/recipe/edit.phtml
@@ -0,0 +1,25 @@
+headTitle($title);
+ ?>
+
\ No newline at end of file
diff --git a/app/module/RecipeOLD/view/recipe/recipe/select.phtml b/app/module/RecipeOLD/view/recipe/recipe/select.phtml
new file mode 100755
index 0000000..1b4bdc5
--- /dev/null
+++ b/app/module/RecipeOLD/view/recipe/recipe/select.phtml
@@ -0,0 +1,29 @@
+headTitle($title);
+ ?>
+
+
diff --git a/app/module/Search/Module.php b/app/module/Search/Module.php
new file mode 100644
index 0000000..75bd19c
--- /dev/null
+++ b/app/module/Search/Module.php
@@ -0,0 +1,49 @@
+ array(
+ __DIR__ . '/autoload_classmap.php',
+ ),
+ 'Zend\Loader\StandardAutoloader' => array(
+ 'namespaces' => array(
+ __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
+ ),
+ ),
+ );
+ }
+
+ public function getConfig()
+ {
+ return include __DIR__ . '/config/module.config.php';
+ }
+ public function getServiceConfig()
+ {
+ return array(
+ 'factories' => array(
+ 'Recipe\Model\RecipeTable' => function($sm) {
+ $tableGateway = $sm->get('RecipeTableGateway');
+ $table = new RecipeTable($tableGateway);
+ return $table;
+ },
+ 'RecipeTableGateway' => function ($sm) {
+ $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
+ $resultSetPrototype = new ResultSet();
+ $resultSetPrototype->setArrayObjectPrototype(new Recipe());
+ return new TableGateway('recipe', $dbAdapter, null, $resultSetPrototype);
+ },
+ ),
+ );
+ }
+}
+
diff --git a/app/module/Search/autoload_classmap.php b/app/module/Search/autoload_classmap.php
new file mode 100644
index 0000000..d864ec9
--- /dev/null
+++ b/app/module/Search/autoload_classmap.php
@@ -0,0 +1,4 @@
+ array(
+ 'invokables' => array(
+ 'Search\Controller\Search' => 'Search\Controller\SearchController',
+ ),
+ ),
+ 'router' => array(
+ 'routes' => array(
+ 'search' => array(
+ 'type' => 'segment',
+ 'options' => array(
+ 'route' => '/search[/][:action][/:id]',
+ 'constraints' => array(
+ 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
+ 'id' => '[0-9]+',
+ ),
+ 'defaults' => array(
+ 'controller' => 'Search\Controller\Search',
+ 'action' => 'index',
+ ),
+ ),
+ ),
+ ),
+ ),
+ 'view_manager' => array(
+ 'template_path_stack' => array(
+ 'search' => __DIR__ . '/../view',
+ ),
+ ),
+);
+
diff --git a/app/module/Search/src/Search/Controller/SearchController.php b/app/module/Search/src/Search/Controller/SearchController.php
new file mode 100644
index 0000000..622cdb1
--- /dev/null
+++ b/app/module/Search/src/Search/Controller/SearchController.php
@@ -0,0 +1,112 @@
+luceneIndex = LuceneHelper::GetLuceneIndex();
+ }
+
+ public function indexAction()
+ {
+ return new ViewModel(array(
+ 'recipes' => $this->getRecipeTable()->fetchAll(),
+ ));
+ }
+
+ public function indexopsAction()
+ {
+
+ $this->luceneIndex = LuceneHelper::NewLuceneIndex(LuceneHelper::DEFAULT_LUCENE_PATH);
+ //Running this page will cause the site to be indexed.
+ //TODO break these out from here because having them here is NOOB TERRITRY
+
+ //Get all Recipes and index them (easy way but if this was a real site we would run out of memory doing it this way)
+ $recipes = $this->getRecipeTable()->fetchAll();
+
+ foreach($recipes as $recipe) {
+ $indexedDoc = new IndexedDocument();
+ $indexedDoc->setName($recipe->recName);
+ $indexedDoc->setAuthor("Test User"); //TODO user integration
+ $indexedDoc->setUrl("/recipe/permalink?id=".$recipe->recID);
+ $indexedDoc->setContent($recipe->instruct);
+ $indexedDoc->setType(IndexedDocumentType::Recipe);
+ $indexedDoc->setTags("test");
+ $this->luceneIndex->addDocument($indexedDoc);
+ }
+ return new ViewModel();
+ }
+
+ public function resultsAction() {
+
+
+ $this->luceneIndex = LuceneHelper::GetLuceneIndex();
+ $results = $this->luceneIndex->search($_GET['q']);
+ $viewmodel = new ViewModel(array(
+ 'results' => $results
+ ));
+ $viewmodel->setTerminal(true); //DO NOT load layout for this page
+
+ $hits = array();
+ foreach($results as $hit) {
+ $hit->document = IndexedDocument::extractDocument($hit);
+ array_push($hits, $hit);
+ }
+
+ header("Content-Type: application/json");
+ $json = Json::encode($hits);
+ echo Json::prettyPrint($json, array('indent' =>" "));
+ return $viewmodel;
+ }
+
+ public function resultAction() {
+
+ $startTime = microtime();
+
+ $this->luceneIndex = LuceneHelper::GetLuceneIndex();
+
+ $results = $this->luceneIndex->search($_GET['q']);
+
+ $hits = array();
+ foreach($results as $hit) {
+ $hit->document = IndexedDocument::extractDocument($hit);
+ array_push($hits, $hit);
+ }
+ $endTime = microtime();
+ $searchtime = ($endTime - $startTime);
+
+
+ $viewmodel = new ViewModel(array(
+ 'hits' => $hits,
+ 'searchtime' => $searchtime
+ ));
+
+ return $viewmodel;
+ }
+
+
+ //TODO THIS SHOULD NOT BE IN HERE
+ public function getRecipeTable()
+ {
+ if (!$this->recipeTable) {
+ $sm = $this->getServiceLocator();
+ $this->recipeTable = $sm->get('Recipe\Model\RecipeTable');
+ }
+ return $this->recipeTable;
+ }
+
+
+}
\ No newline at end of file
diff --git a/app/module/Search/src/Search/Helper/LuceneHelper.php b/app/module/Search/src/Search/Helper/LuceneHelper.php
new file mode 100644
index 0000000..96b1c53
--- /dev/null
+++ b/app/module/Search/src/Search/Helper/LuceneHelper.php
@@ -0,0 +1,25 @@
+addField(Document\Field::text('name', $this->getName()));
+ $doc->addField(Document\Field::text('type', $this->getType()));
+ $doc->addField(Document\Field::unIndexed('lastModified', $this->getLastModified()));
+ $doc->addField(Document\Field::text('url', $this->getUrl()));
+ $doc->addField(Document\Field::text('author', $this->getAuthor()));
+ $doc->addField(Document\Field::keyword('tags', $this->getTags()));
+ $doc->addField(Document\Field::unStored('content', $this->getContent()));
+ return $doc;
+ }
+
+ public static function extractDocument($hit) {
+ $doc = new IndexedDocument();
+ $doc->setName($hit->getDocument()->name);
+ $doc->setType($hit->getDocument()->type);
+ $doc->setLastModified($hit->getDocument()->lastModified);
+ $doc->setUrl($hit->getDocument()->url);
+ $doc->setAuthor($hit->getDocument()->author);
+ $doc->setTags($hit->getDocument()->tags);
+
+ return $doc;
+ }
+
+ public function toArray() {
+ $ret = array();
+ $ret['name'] = $this->getName();
+ return $ret;
+ }
+
+ /**
+ * @param mixed $content
+ */
+ public function setContent($content)
+ {
+ $this->content = $content;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getContent()
+ {
+ return $this->content;
+ }
+
+ /**
+ * @param mixed $author
+ */
+ public function setAuthor($author)
+ {
+ $this->author = $author;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+
+ /**
+ * @param mixed $lastModified
+ */
+ public function setLastModified($lastModified)
+ {
+ $this->lastModified = $lastModified;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getLastModified()
+ {
+ return $this->lastModified;
+ }
+
+ /**
+ * @param mixed $name
+ */
+ public function setName($name)
+ {
+ $this->name = $name;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * @param mixed $tags
+ */
+ public function setTags($tags)
+ {
+ $this->tags = $tags;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getTags()
+ {
+ return $this->tags;
+ }
+
+ /**
+ * @param mixed $type
+ */
+ public function setType($type)
+ {
+ $this->type = $type;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * @param mixed $url
+ */
+ public function setUrl($url)
+ {
+ $this->url = $url;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getUrl()
+ {
+ return $this->url;
+ }
+
+
+
+
+}
\ No newline at end of file
diff --git a/app/module/Search/src/Search/Model/LuceneIndex.php b/app/module/Search/src/Search/Model/LuceneIndex.php
new file mode 100644
index 0000000..4132b55
--- /dev/null
+++ b/app/module/Search/src/Search/Model/LuceneIndex.php
@@ -0,0 +1,29 @@
+index = $index;
+ }
+
+ public function search($query) {
+ $hits = $this->index->find($query);
+ return $hits;
+ }
+
+ public function optimize() {
+ $this->index->optimize();
+ }
+
+ public function addDocument($indexableDocument) {
+ $luceneDocObject = $indexableDocument->buildLuceneDocument();
+ $this->index->addDocument($luceneDocObject);
+ }
+}
\ No newline at end of file
diff --git a/app/module/Search/view/search/search/index.phtml b/app/module/Search/view/search/search/index.phtml
new file mode 100644
index 0000000..b9c3f68
--- /dev/null
+++ b/app/module/Search/view/search/search/index.phtml
@@ -0,0 +1,3 @@
+
Search Engine Dev Tools
+
Would you like to build a new index?
+
diff --git a/app/module/Search/view/search/search/indexops.phtml b/app/module/Search/view/search/search/indexops.phtml
new file mode 100644
index 0000000..b488055
--- /dev/null
+++ b/app/module/Search/view/search/search/indexops.phtml
@@ -0,0 +1,3 @@
+
Search Engine Indexing... Do not cancel until "OKAY" appears below.
+
+
OKAY
\ No newline at end of file
diff --git a/app/module/Search/view/search/search/result.phtml b/app/module/Search/view/search/search/result.phtml
new file mode 100644
index 0000000..45b08fe
--- /dev/null
+++ b/app/module/Search/view/search/search/result.phtml
@@ -0,0 +1,30 @@
+headTitle("Search Results");
+?>
+
+
Search Results Found items in µs
+
+
+ No results found. We recommend the following actions:
+
+
Change your search to be less specific or for something related to what you are searching for.
+
If the recipe you're looking for isn't in our database, search a different site and if you find a good one, add it to ours!
+
\ No newline at end of file
diff --git a/app/module/Search/view/search/search/results.phtml b/app/module/Search/view/search/search/results.phtml
new file mode 100644
index 0000000..e69de29
diff --git a/app/module/Users/Module.php b/app/module/Users/Module.php
index 907b07d..7c1c218 100644
--- a/app/module/Users/Module.php
+++ b/app/module/Users/Module.php
@@ -3,8 +3,10 @@
namespace Users;
+use Users\Model\FacebookLink;
use Users\Model\User;
use Users\Model\UserTable;
+use Users\Model\FacebookTable;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;
use Zend\Mvc\ModuleRouteListener;
@@ -69,6 +71,18 @@ public function getServiceConfig()
$resultSetPrototype->setArrayObjectPrototype(new User());
return new TableGateway('users', $dbAdapter, null, $resultSetPrototype);
},
+ 'Users\Model\FacebookTable' => function($sm) {
+ $tableGateway = $sm->get("FacebookTableGateway");
+ $table = new FacebookTable($tableGateway);
+ return $table;
+
+ },
+ 'FacebookTableGateway' => function ($sm) {
+ $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
+ $resultSetPrototype = new ResultSet();
+ $resultSetPrototype->setArrayObjectPrototype(new FacebookLink());
+ return new TableGateway('user_facebook', $dbAdapter, null, $resultSetPrototype);
+ }
)
);
}
diff --git a/app/module/Users/config/module.config.php b/app/module/Users/config/module.config.php
index 78a0323..94389f6 100644
--- a/app/module/Users/config/module.config.php
+++ b/app/module/Users/config/module.config.php
@@ -3,7 +3,8 @@
return array(
'controllers' => array(
'invokables' => array(
- 'Users\Controller\Auth' => 'Users\Controller\AuthController',
+ 'Users\Controller\Facebook' => 'Users\Controller\FacebookController',
+ 'Users\Controller\Auth' => 'Users\Controller\AuthController'
),
),
'router' => array(
@@ -22,6 +23,20 @@
),
),
),
+ 'fb' => array(
+ 'type' => 'segment',
+ 'options' => array(
+ 'route' => '/facebook[/][:action][/:id]',
+ 'constraints' => array(
+ 'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
+ 'id' => '[0-9]+',
+ ),
+ 'defaults' => array(
+ 'controller' => 'Users\Controller\Facebook',
+ 'action' => 'auth',
+ ),
+ ),
+ ),
),
),
'view_manager' => array(
@@ -29,6 +44,7 @@
'users' => __DIR__ . '/../view',
),
),
+
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
@@ -43,5 +59,8 @@
'template_path_stack' => array(
__DIR__ . '/../view',
),
+ 'strategies' => array(
+ 'ViewJsonStrategy',
+ ),
),
);
\ No newline at end of file
diff --git a/app/module/Users/src/Users/Controller/AuthController.php b/app/module/Users/src/Users/Controller/AuthController.php
index 3e77c3c..f6c934c 100644
--- a/app/module/Users/src/Users/Controller/AuthController.php
+++ b/app/module/Users/src/Users/Controller/AuthController.php
@@ -27,9 +27,11 @@ public function loginAction()
// echo $loginResult;
if ($loginResult != AuthenticationResult::SUCCESS) {
$vars['error'] = true;
+ } else {
+ $vars['loggedIn'] = $this->loginHandler->authenticated();
+ return $this->redirect()->toUrl("/");
}
}
- $vars['loggedIn'] = $this->loginHandler->authenticated();
return new ViewModel($vars);
diff --git a/app/module/Users/src/Users/Controller/FacebookController.php b/app/module/Users/src/Users/Controller/FacebookController.php
new file mode 100644
index 0000000..4e036ac
--- /dev/null
+++ b/app/module/Users/src/Users/Controller/FacebookController.php
@@ -0,0 +1,101 @@
+ '309223815892634',
+ 'secret' => '1e839317b386a08bd4dde801754ff641',
+ 'allowSignedRequest' => false // optional but should be set to false for non-canvas apps
+ );
+ $this->facebook = new Facebook($config);
+
+ }
+
+ public function init() {
+ $this->loginHandler = new LoginHandler($this->getUserTable());
+ $this->getFacebookTable();
+ }
+
+ public function authAction() {
+ $this->init();
+
+ $status = "err";
+ if (isset($_POST['token'])) {
+ $this->facebook->setAccessToken($_POST['token']);
+ $fbUser = $this->facebook->getUser();
+ if ($fbUser) {
+ try {
+ $fbUser = $this->facebook->api('/me');
+ } catch (\FacebookApiException $e ) {
+ //not a valid fb user
+ $fbUser = null;
+ }
+ } else {
+ die($_POST['token']);
+ }
+ $facebookID = $fbUser['id'];
+
+ if ($facebookID == null) {
+ return new JsonModel(array(
+ "status" => "invalid_token"
+ ));
+ }
+ $userId = $this->facebookTable->getUserIdFromFacebookId($facebookID);
+ if ($userId == null) {
+ //no facebook link yet
+ $status = "nolink";
+
+ } else {
+ //facebook link exists
+ $this->loginHandler->loginWithId($userId);
+ $status = "success";
+ }
+
+ }
+
+ return new JsonModel(array(
+ "status" => $status,
+ "fbId" => $facebookID
+ ));
+ }
+
+ public function getUserTable()
+ {
+ if (!$this->userTable) {
+ $sm = $this->getServiceLocator();
+ $this->userTable = $sm->get('Users\Model\UserTable');
+ }
+ return $this->userTable;
+ }
+
+ public function getFacebookTable()
+ {
+ if (!$this->facebookTable) {
+ $sm = $this->getServiceLocator();
+ $this->facebookTable = $sm->get('Users\Model\FacebookTable');
+ }
+ return $this->facebookTable;
+ }
+}
\ No newline at end of file
diff --git a/app/module/Users/src/Users/Model/FacebookLink.php b/app/module/Users/src/Users/Model/FacebookLink.php
new file mode 100644
index 0000000..56dcd0a
--- /dev/null
+++ b/app/module/Users/src/Users/Model/FacebookLink.php
@@ -0,0 +1,16 @@
+linkId = (!empty($data['linkId'])) ? $data['linkId'] : null;
+ $this->facebookId = (!empty($data['facebookId'])) ? $data['facebookId'] : null;
+ $this->userId = (!empty($data['userId'])) ? $data['userId'] : null;
+ }
+}
\ No newline at end of file
diff --git a/app/module/Users/src/Users/Model/FacebookTable.php b/app/module/Users/src/Users/Model/FacebookTable.php
new file mode 100644
index 0000000..7812298
--- /dev/null
+++ b/app/module/Users/src/Users/Model/FacebookTable.php
@@ -0,0 +1,34 @@
+tableGateway= $tableGateway;
+ }
+
+ public function getUserIdFromFacebookId($facebookId) {
+ $id = (int)$facebookId;
+
+ $rowset = $this->tableGateway->select(array('facebookId' => $id));
+ $row = $rowset->current();
+ if (!$row) {
+ return null;
+ }
+ return $row->userId;
+ }
+
+ public function linkUser($userId, $facebookId)
+ {
+ $data = array(
+ 'facebookId' => $facebookId,
+ 'userId' => $userId
+ );
+ $this->tableGateway->insert($data);
+ }
+}
\ No newline at end of file
diff --git a/app/module/Users/src/Users/Model/User.php b/app/module/Users/src/Users/Model/User.php
index 229ce4f..c7bfa1a 100644
--- a/app/module/Users/src/Users/Model/User.php
+++ b/app/module/Users/src/Users/Model/User.php
@@ -7,6 +7,7 @@ class User
public $username;
public $password;
public $email;
+ public $name;
public function exchangeArray($data)
{
@@ -14,5 +15,6 @@ public function exchangeArray($data)
$this->username = (!empty($data['username'])) ? $data['username'] : null;
$this->password = (!empty($data['password'])) ? $data['password'] : null;
$this->email = (!empty($data['email'])) ? $data['email'] : null;
+ $this->name = (!empty($data['name'])) ? $data['name'] : null;
}
}
\ No newline at end of file
diff --git a/app/module/Users/src/Users/Model/UserTable.php b/app/module/Users/src/Users/Model/UserTable.php
index 233130a..b7e0785 100644
--- a/app/module/Users/src/Users/Model/UserTable.php
+++ b/app/module/Users/src/Users/Model/UserTable.php
@@ -44,7 +44,8 @@ public function createUser(User $user)
$data = array(
'username' => $user->username,
'password' => $user->password,
- 'email' => $user->email
+ 'email' => $user->email,
+ 'name' => $user->name
);
$this->tableGateway->insert($data);
}
diff --git a/app/module/Users/src/Users/Util/LoginHandler.php b/app/module/Users/src/Users/Util/LoginHandler.php
index e57e025..053bdfb 100644
--- a/app/module/Users/src/Users/Util/LoginHandler.php
+++ b/app/module/Users/src/Users/Util/LoginHandler.php
@@ -4,6 +4,7 @@
use Users\Model\UserTable;
use Users\Model\User;
+use Zend\Authentication\Validator\Authentication;
use Zend\Session\Container;
class LoginHandler implements AbstractLoginHandler
@@ -28,6 +29,15 @@ public function login($username, $password)
return AuthenticationResult::INVALID_CREDENTIALS;
}
+ public function loginWithId($userId) {
+ $user = $this->userTable->getUser($userId);
+ if ($user == null)
+ return AuthenticationResult::INVALID_CREDENTIALS;
+
+ $this->setSession($user);
+ return AuthenticationResult::SUCCESS;
+ }
+
public function logout()
{
$this->sessionContainer->currentUser = null;
diff --git a/app/module/Users/src/Users/Util/PasswordCryptographyProvider.php b/app/module/Users/src/Users/Util/PasswordCryptographyProvider.php
index 12546c2..1d796a1 100644
--- a/app/module/Users/src/Users/Util/PasswordCryptographyProvider.php
+++ b/app/module/Users/src/Users/Util/PasswordCryptographyProvider.php
@@ -10,7 +10,7 @@ class PasswordCryptographyProvider
public static $PASSWORD_SALT = "KevinDurantIsABasketballPlayer!11%3234#";
public static $TIME_COMPLEXITY = 15;
- public static function EncryptPassword ( $password)
+ public static function EncryptPassword ( $password )
{
$bcrypt = new Bcrypt(array(
'salt' => PasswordCryptographyProvider::$PASSWORD_SALT,
@@ -21,7 +21,7 @@ public static function EncryptPassword ( $password)
return $securePass;
}
- public static function VerifyPassword( $given, $encryptedPass)
+ public static function VerifyPassword( $given, $encryptedPass )
{
$bcrypt = new Bcrypt();
return $bcrypt->verify($given, $encryptedPass);
diff --git a/app/module/Users/view/users/auth/login.phtml b/app/module/Users/view/users/auth/login.phtml
index 55b1ef4..bdad12d 100644
--- a/app/module/Users/view/users/auth/login.phtml
+++ b/app/module/Users/view/users/auth/login.phtml
@@ -25,4 +25,6 @@ $this->headTitle($title);
Forgot your password?
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/module/Users/view/users/auth/register.phtml b/app/module/Users/view/users/auth/register.phtml
index 7b2add9..fe5d785 100644
--- a/app/module/Users/view/users/auth/register.phtml
+++ b/app/module/Users/view/users/auth/register.phtml
@@ -1,4 +1,4 @@
-
Temporary Registration Form
+
Create an Account
diff --git a/app/public/css/globalstyle.css b/app/public/css/globalstyle.css
new file mode 100644
index 0000000..0ead9c5
--- /dev/null
+++ b/app/public/css/globalstyle.css
@@ -0,0 +1,100 @@
+/* This is basically for any pages that aren't the homepage */
+
+body {
+ background-image: url("../img/globalbg.jpg");
+ background-attachment: fixed;
+ font-family:"Freight-Sans-Pro";
+
+}
+
+h1, h2, h3, h4 {
+ font-family:"Freight-Sans-Pro";
+}
+
+.container {
+ box-shadow: #000 3px 3px 19px -2px;
+ background-color:#FFF;
+ margin-top:20px;
+ padding: 0px 20px 20px 20px;
+}
+
+/*NAV*/
+.navbar-green {
+ position:relative;
+ /*top: -8px;*/
+ background-color: #77AC42;
+ border-color: #77AC42;
+
+ border-radius: 0px;
+
+ font-family:"Freight-Sans-Pro";
+ margin-bottom:0px;
+}
+.navbar-green .navbar-brand {
+ color: #ecf0f1;
+}
+.navbar-green .navbar-brand:hover, .navbar-green .navbar-brand:focus {
+ color: #ccffcc;
+}
+.navbar-green .navbar-text {
+ color: #ecf0f1;
+}
+.navbar-green .navbar-nav > li > a {
+ color: #ecf0f1;
+}
+.navbar-green .navbar-nav > li > a:hover, .navbar-green .navbar-nav > li > a:focus {
+ /* color: #ecdbff;*/
+ color: #000;
+ background-color: #77AC42;
+}
+.navbar-green .navbar-nav > .active > a, .navbar-green .navbar-nav > .active > a:hover, .navbar-green .navbar-nav > .active > a:focus {
+ color: #ecdbff;
+ background-color: #77AC42;
+}
+.navbar-green .navbar-nav > .open > a, .navbar-green .navbar-nav > .open > a:hover, .navbar-green .navbar-nav > .open > a:focus {
+ color: #ecdbff;
+ background-color: #77AC42;
+}
+.navbar-green .navbar-toggle {
+ border-color: #77AC42;
+}
+.navbar-green .navbar-toggle:hover, .navbar-green .navbar-toggle:focus {
+ background-color: #77AC42;
+}
+.navbar-green .navbar-toggle .icon-bar {
+ background-color: #ecf0f1;
+}
+.navbar-green .navbar-collapse,
+.navbar-green .navbar-form {
+ border-color: #ecf0f1;
+}
+.navbar-green .navbar-link {
+ color: #ecf0f1;
+}
+.navbar-green .navbar-link:hover {
+ color: #ecdbff;
+}
+
+@media (max-width: 767px) {
+ .navbar-green .navbar-nav .open .dropdown-menu > li > a {
+ color: #ecf0f1;
+ font-size:14px;
+ }
+ .navbar-green .navbar-nav .open .dropdown-menu > li > a:hover, .navbar-green .navbar-nav .open .dropdown-menu > li > a:focus {
+ color: #ecdbff;
+ }
+ .navbar-green .navbar-nav .open .dropdown-menu > .active > a, .navbar-green .navbar-nav .open .dropdown-menu > .active > a:hover, .navbar-green .navbar-nav .open .dropdown-menu > .active > a:focus {
+ color: #ecdbff;
+ background-color: #77AC42;
+ }
+}
+
+/*SEARH*/
+
+.itemsfound {
+ font-size:12px;
+ text-transform: uppercase;
+ font-weight:bold;
+ float: right;
+ padding-top: 15px;
+}
\ No newline at end of file
diff --git a/app/public/css/style.css b/app/public/css/style.css
index 6e4f155..b6486a5 100644
--- a/app/public/css/style.css
+++ b/app/public/css/style.css
@@ -172,4 +172,5 @@ textarea.recipe {
resize: none;
width: 98%;
height: 500px;
-}
\ No newline at end of file
+}
+
diff --git a/app/public/img/globalbg.jpg b/app/public/img/globalbg.jpg
new file mode 100644
index 0000000..3908b8c
Binary files /dev/null and b/app/public/img/globalbg.jpg differ
diff --git a/app/public/js/global.js b/app/public/js/global.js
new file mode 100644
index 0000000..be23bb3
--- /dev/null
+++ b/app/public/js/global.js
@@ -0,0 +1,23 @@
+
+
+$(document).ready(function() {
+ initSearch();
+})
+
+var Search = {};
+
+function initSearch() {
+ Search.field = $("#search-tf");
+ Search.form = $("#search-form");
+
+
+ Search.field.change(function() {
+
+ })
+
+ Search.form.submit(function() {
+ location.href = "/search/result?q="+Search.field.val();
+ return false;
+ })
+}
+
diff --git a/app/public/js/login.js b/app/public/js/login.js
new file mode 100644
index 0000000..49437c0
--- /dev/null
+++ b/app/public/js/login.js
@@ -0,0 +1,66 @@
+window.fbAsyncInit = function() {
+ FB.init({
+ appId: '309223815892634', // App ID
+ channelUrl: 'channel.html', // Channel File
+ status: true, // check login status
+ cookie: true, // enable cookies to allow the server to access the session
+ xfbml: true
+ // parse XFBML
+ });
+};
+
+
+function facebookLogin() {
+ FB.login(function(response) {
+ if (response.authResponse) {
+ // connected
+ handleToken(response.authResponse.accessToken);
+ } else {
+
+ }
+ });
+}
+
+function handleToken(accessToken) {
+ var request = $.ajax({
+ type: "POST",
+ url: "/facebook/auth",
+ data: { token : accessToken },
+ dataType: "json"
+
+ });
+
+ request.success(function(data) {
+ if(data.status == "invalid_token") {
+ alert("FAIL");
+ } else if (data.status == "nolink") {
+
+ } else if (data.status == "success") {
+ location.href = "/";
+ }
+ });
+
+
+}
+
+$(document).ready(function() {
+ $("#fb-signin").click(function() {
+ facebookLogin();
+ });
+});
+
+// Load the SDK Asynchronously
+(function(d) {
+ var js, id = 'facebook-jssdk',
+ ref = d.getElementsByTagName('script')[0];
+ if (d.getElementById(id)) {
+ return;
+ }
+ js = d.createElement('script');
+ js.id = id;
+ js.async = true;
+ js.src = "//connect.facebook.net/en_US/all.js";
+ ref.parentNode.insertBefore(js, ref);
+
+
+}(document));
\ No newline at end of file
diff --git a/app/vendor/facebook/php-sdk/.gitignore b/app/vendor/facebook/php-sdk/.gitignore
new file mode 100644
index 0000000..c2a70fc
--- /dev/null
+++ b/app/vendor/facebook/php-sdk/.gitignore
@@ -0,0 +1,6 @@
+/coverage/
+vendor/
+composer.lock
+composer.phar
+.DS_Store
+.idea/
diff --git a/app/vendor/facebook/php-sdk/.travis.yml b/app/vendor/facebook/php-sdk/.travis.yml
new file mode 100644
index 0000000..9c49978
--- /dev/null
+++ b/app/vendor/facebook/php-sdk/.travis.yml
@@ -0,0 +1,6 @@
+language: php
+php:
+ - 5.3
+ - 5.4
+ - 5.5
+script: phpunit --stderr --bootstrap tests/bootstrap.php tests/tests.php
diff --git a/app/vendor/facebook/php-sdk/changelog.md b/app/vendor/facebook/php-sdk/changelog.md
new file mode 100644
index 0000000..16728fe
--- /dev/null
+++ b/app/vendor/facebook/php-sdk/changelog.md
@@ -0,0 +1,28 @@
+Facebook PHP SDK (v.3.0.0)
+==========================
+
+The new PHP SDK (v3.0.0) is a major upgrade to the older one (v2.2.x):
+
+- Uses OAuth authentication flows instead of our legacy authentication flow
+- Consists of two classes. The first (class BaseFacebook) maintains the core of the upgrade, and the second one (class Facebook) is a small subclass that uses PHP sessions to store the user id and access token.
+
+If you’re currently using the PHP SDK (v2.2.x) for authentication, you will recall that the login code looked like this:
+
+ $facebook = new Facebook(…);
+ $session = $facebook->getSession();
+ if ($session) {
+ // proceed knowing you have a valid user session
+ } else {
+ // proceed knowing you require user login and/or authentication
+ }
+
+The login code is now:
+
+ $facebook = new Facebook(…);
+ $user = $facebook->getUser();
+ if ($user) {
+ // proceed knowing you have a logged in user who's authenticated
+ } else {
+ // proceed knowing you require user login and/or authentication
+ }
+
diff --git a/app/vendor/facebook/php-sdk/composer.json b/app/vendor/facebook/php-sdk/composer.json
new file mode 100644
index 0000000..38cba01
--- /dev/null
+++ b/app/vendor/facebook/php-sdk/composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "facebook/php-sdk",
+ "description": "Facebook PHP SDK",
+ "keywords": ["facebook", "sdk"],
+ "type": "library",
+ "homepage": "https://github.com/facebook/facebook-php-sdk",
+ "license": "Apache2",
+ "authors": [
+ {
+ "name": "Facebook",
+ "homepage": "https://github.com/facebook/facebook-php-sdk/contributors"
+ }
+ ],
+ "require": {
+ "php": ">=5.2.0",
+ "ext-curl": "*",
+ "ext-json": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "3.7.*"
+ },
+ "autoload": {
+ "classmap": ["src"]
+ }
+}
diff --git a/app/vendor/facebook/php-sdk/examples/example.php b/app/vendor/facebook/php-sdk/examples/example.php
new file mode 100644
index 0000000..4c22fa9
--- /dev/null
+++ b/app/vendor/facebook/php-sdk/examples/example.php
@@ -0,0 +1,107 @@
+ '344617158898614',
+ 'secret' => '6dc8ac871858b34798bc2488200e503d',
+));
+
+// Get User ID
+$user = $facebook->getUser();
+
+// We may or may not have this data based on whether the user is logged in.
+//
+// If we have a $user id here, it means we know the user is logged into
+// Facebook, but we don't know if the access token is valid. An access
+// token is invalid if the user logged out of Facebook.
+
+if ($user) {
+ try {
+ // Proceed knowing you have a logged in user who's authenticated.
+ $user_profile = $facebook->api('/me');
+ } catch (FacebookApiException $e) {
+ error_log($e);
+ $user = null;
+ }
+}
+
+// Login or logout url will be needed depending on current user state.
+if ($user) {
+ $logoutUrl = $facebook->getLogoutUrl();
+} else {
+ $statusUrl = $facebook->getLoginStatusUrl();
+ $loginUrl = $facebook->getLoginUrl();
+}
+
+// This call will always work since we are fetching public data.
+$naitik = $facebook->api('/naitik');
+
+?>
+
+
+
+ php-sdk
+
+
+
+
+
+
+
+
diff --git a/app/vendor/facebook/php-sdk/examples/with_js_sdk.php b/app/vendor/facebook/php-sdk/examples/with_js_sdk.php
new file mode 100644
index 0000000..4255a35
--- /dev/null
+++ b/app/vendor/facebook/php-sdk/examples/with_js_sdk.php
@@ -0,0 +1,59 @@
+ '344617158898614',
+ 'secret' => '6dc8ac871858b34798bc2488200e503d',
+));
+
+// See if there is a user from a cookie
+$user = $facebook->getUser();
+
+if ($user) {
+ try {
+ // Proceed knowing you have a logged in user who's authenticated.
+ $user_profile = $facebook->api('/me');
+ } catch (FacebookApiException $e) {
+ echo '
'.htmlspecialchars(print_r($e, true)).'
';
+ $user = null;
+ }
+}
+
+?>
+
+
+
+
+ Your user profile is
+