mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:14:35 -04:00
Log contact logins
This commit is contained in:
parent
9f624b3c61
commit
2f401e3457
@ -12,6 +12,7 @@
|
|||||||
namespace App\Providers;
|
namespace App\Providers;
|
||||||
|
|
||||||
use App\Events\Client\ClientWasCreated;
|
use App\Events\Client\ClientWasCreated;
|
||||||
|
use App\Events\Contact\ContactLoggedIn;
|
||||||
use App\Events\Invoice\InvoiceWasCreated;
|
use App\Events\Invoice\InvoiceWasCreated;
|
||||||
use App\Events\Invoice\InvoiceWasMarkedSent;
|
use App\Events\Invoice\InvoiceWasMarkedSent;
|
||||||
use App\Events\Invoice\InvoiceWasUpdated;
|
use App\Events\Invoice\InvoiceWasUpdated;
|
||||||
@ -20,6 +21,7 @@ use App\Events\User\UserLoggedIn;
|
|||||||
use App\Events\User\UserWasCreated;
|
use App\Events\User\UserWasCreated;
|
||||||
use App\Listeners\Activity\CreatedClientActivity;
|
use App\Listeners\Activity\CreatedClientActivity;
|
||||||
use App\Listeners\Activity\PaymentCreatedActivity;
|
use App\Listeners\Activity\PaymentCreatedActivity;
|
||||||
|
use App\Listeners\Contact\UpdateContactLastLogin;
|
||||||
use App\Listeners\Invoice\CreateInvoiceActivity;
|
use App\Listeners\Invoice\CreateInvoiceActivity;
|
||||||
use App\Listeners\Invoice\CreateInvoiceInvitations;
|
use App\Listeners\Invoice\CreateInvoiceInvitations;
|
||||||
use App\Listeners\Invoice\UpdateInvoiceActivity;
|
use App\Listeners\Invoice\UpdateInvoiceActivity;
|
||||||
@ -41,6 +43,9 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
UserLoggedIn::class => [
|
UserLoggedIn::class => [
|
||||||
UpdateUserLastLogin::class,
|
UpdateUserLastLogin::class,
|
||||||
],
|
],
|
||||||
|
ContactLoggedIn::class => [
|
||||||
|
UpdateContactLastLogin::class,
|
||||||
|
],
|
||||||
// Clients
|
// Clients
|
||||||
ClientWasCreated::class => [
|
ClientWasCreated::class => [
|
||||||
CreatedClientActivity::class,
|
CreatedClientActivity::class,
|
||||||
|
@ -117,18 +117,18 @@ class MultiDatabaseUserProvider implements UserProvider
|
|||||||
*/
|
*/
|
||||||
public function retrieveByCredentials(array $credentials)
|
public function retrieveByCredentials(array $credentials)
|
||||||
{
|
{
|
||||||
Log::error('retrieving by credentials');
|
//Log::error('retrieving by credentials');
|
||||||
if (empty($credentials) ||
|
if (empty($credentials) ||
|
||||||
(count($credentials) === 1 &&
|
(count($credentials) === 1 &&
|
||||||
array_key_exists('password', $credentials))) {
|
array_key_exists('password', $credentials))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::error('settings DB');
|
//Log::error('settings DB');
|
||||||
|
|
||||||
$this->setDefaultDatabase(false, $credentials['email'], false);
|
$this->setDefaultDatabase(false, $credentials['email'], false);
|
||||||
|
|
||||||
Log::error('set DB');
|
//Log::error('set DB');
|
||||||
|
|
||||||
|
|
||||||
// First we will add each credential element to the query as a where clause.
|
// First we will add each credential element to the query as a where clause.
|
||||||
@ -147,7 +147,7 @@ class MultiDatabaseUserProvider implements UserProvider
|
|||||||
$query->where($key, $value);
|
$query->where($key, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log::error($query->count());
|
//Log::error($query->count());
|
||||||
return $query->first();
|
return $query->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ Log::error($query->count());
|
|||||||
{ Log::error('validateCredentials');
|
{ Log::error('validateCredentials');
|
||||||
|
|
||||||
$plain = $credentials['password'];
|
$plain = $credentials['password'];
|
||||||
Log::error($plain);
|
//Log::error($plain);
|
||||||
return $this->hasher->check($plain, $user->getAuthPassword());
|
return $this->hasher->check($plain, $user->getAuthPassword());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -226,8 +226,8 @@ Log::error($query->count());
|
|||||||
|
|
||||||
private function setDefaultDatabase($id = false, $email = false, $token = false) : void
|
private function setDefaultDatabase($id = false, $email = false, $token = false) : void
|
||||||
{
|
{
|
||||||
Log::error('setting DB');
|
//Log::error('setting DB');
|
||||||
Log::error('model = '.$this->model);
|
//Log::error('model = '.$this->model);
|
||||||
|
|
||||||
foreach (MultiDB::getDbs() as $database) {
|
foreach (MultiDB::getDbs() as $database) {
|
||||||
$this->setDB($database);
|
$this->setDB($database);
|
||||||
@ -246,7 +246,7 @@ Log::error('model = '.$this->model);
|
|||||||
$user = $query->get();
|
$user = $query->get();
|
||||||
|
|
||||||
if (count($user) >= 1) {
|
if (count($user) >= 1) {
|
||||||
Log::error('found user, settings DB for EMAIL');
|
//Log::error('found user, settings DB for EMAIL');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,6 +320,7 @@ class CreateUsersTable extends Migration
|
|||||||
$table->string('confirmation_code')->nullable();
|
$table->string('confirmation_code')->nullable();
|
||||||
$table->boolean('is_primary')->default(false);
|
$table->boolean('is_primary')->default(false);
|
||||||
$table->boolean('confirmed')->default(false);
|
$table->boolean('confirmed')->default(false);
|
||||||
|
$table->timestamp('last_login')->nullable();
|
||||||
$table->smallInteger('failed_logins')->nullable();
|
$table->smallInteger('failed_logins')->nullable();
|
||||||
$table->string('oauth_user_id',100)->nullable()->unique();
|
$table->string('oauth_user_id',100)->nullable()->unique();
|
||||||
$table->unsignedInteger('oauth_provider_id')->nullable()->unique();
|
$table->unsignedInteger('oauth_provider_id')->nullable()->unique();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user