mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-08 21:58:03 +00:00
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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user