Combination of initial files and some new code for login and user registration.

This commit is contained in:
James Cole
2014-06-29 22:12:33 +02:00
parent a3a30bd5e1
commit 5d430e7dad
72 changed files with 9779 additions and 913 deletions

View File

@@ -0,0 +1,44 @@
<?php
namespace Firefly\Storage\User;
class EloquentUserRepository implements UserRepositoryInterface
{
public function __construct()
{
}
public function register()
{
$user = new \User;
$user->email = \Input::get('email');
$user->migrated = 0;
$user->verification = \Str::random(32);
$user->password = \Hash::make(\Str::random(12));
if (!$user->isValid()) {
\Log::error('Invalid user');
\Session::flash('error', 'Input invalid, please try again.');
return false;
}
$user->save();
return $user;
}
public function auth()
{
$user = \User::where('email', \Input::get('email'))->first();
if (!is_null($user)) {
if (\Hash::check(\Input::get('password'), $user->password)) {
}
}
return false;
}
public function findByVerification($verification)
{
return \User::where('verification', $verification)->first();
}
}