There's a giant mix brewing between "old" code, bad code and not implemented exceptions. I suspect the next change will be to cut out all old stuff, throw a lot of NotImplementedExceptions and get going.

This commit is contained in:
Sander Dorigo
2014-11-12 10:54:53 +01:00
parent 638fa9005f
commit 78d034d366
16 changed files with 366 additions and 436 deletions

View File

@@ -5,6 +5,7 @@ namespace FireflyIII\Database;
/**
* Class User
*
* @package FireflyIII\Database
*/
class User
@@ -12,14 +13,15 @@ class User
/**
* @param array $data
*
* @return bool|\User
*/
public function register(array $data)
{
$user = new \User;
$user->email = isset($data['email']) ? $data['email'] : null;
$user = new \User;
$user->email = isset($data['email']) ? $data['email'] : null;
$user->migrated = 0;
$user->reset = \Str::random(32);
$user->reset = \Str::random(32);
$user->password = \Hash::make(\Str::random(12));
if (!$user->save()) {
@@ -34,6 +36,20 @@ class User
}
/**
* @param \User $user
* @param $password
*
* @return bool
*/
public function updatePassword(\User $user, $password)
{
$user->password = $password;
$user->forceSave();
return true;
}
/**
* @param $mail
*