1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #5182 from turbo124/v5-develop

Minor fixes
This commit is contained in:
David Bomba 2021-03-19 23:40:05 +11:00 committed by GitHub
commit 422fd4f88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 14 deletions

View File

@ -57,24 +57,17 @@ class Kernel extends ConsoleKernel
$schedule->job(new BillingSubscriptionCron)->daily()->withoutOverlapping();
$schedule->job(new RecurringInvoicesCron)->hourly()->withoutOverlapping();
$schedule->job(new SchedulerCheck)->everyFiveMinutes();
/* Run hosted specific jobs */
if (Ninja::isHosted()) {
$schedule->job(new AdjustEmailQuota())->daily()->withoutOverlapping();
$schedule->job(new SendFailedEmails())->daily()->withoutOverlapping();
$schedule->job(new AdjustEmailQuota)->daily()->withoutOverlapping();
$schedule->job(new SendFailedEmails)->daily()->withoutOverlapping();
}
/* Run queue's with this*/
if (Ninja::isSelfHost()) {
$schedule->command('queue:work --daemon')->everyMinute()->withoutOverlapping();
//we need to add this as we are seeing cached queues mess up the system on first load.
$schedule->command('queue:restart')->everyFiveMinutes()->withoutOverlapping();
$schedule->job(new SchedulerCheck)->everyFiveMinutes()->withoutOverlapping();
}
}
/**

View File

@ -35,7 +35,7 @@ class CompanyFactory
$company->custom_fields = (object) [];
$company->subdomain = '';
$company->enabled_modules = config('ninja.enabled_modules'); //32767;//8191; //4095
$company->default_password_timeout = 30;
$company->default_password_timeout = 30 * 60000;
return $company;
}

View File

@ -42,7 +42,7 @@ class PasswordProtection
if($timeout == 0)
$timeout = null;
else
$timeout = now()->addMinutes($timeout);
$timeout = now()->addMinutes($timeout/60000);
if (Cache::get(auth()->user()->hashed_id.'_logged_in')) {
@ -67,7 +67,7 @@ class PasswordProtection
];
//If OAuth and user also has a password set - check both
if ($existing_user = MultiDB::hasUser($query) && auth()->user()->has_password && Hash::check(auth()->user()->password, $request->header('X-API-PASSWORD'))) {
if ($existing_user = MultiDB::hasUser($query) && auth()->user()->has_password && Hash::check(auth()->user()->password, $request->header('X-API-PASSWORD'))) {
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), $timeout);
return $next($request);

View File

@ -78,9 +78,15 @@ class SystemHealth
'phantom_enabled' => (bool)config('ninja.phantomjs_pdf_generation'),
'exec' => (bool)self::checkExecWorks(),
'open_basedir' => (bool)self::checkOpenBaseDir(),
'mail_mailer' => (string)self::checkMailMailer(),
];
}
public static function checkMailMailer()
{
return config('mail.default');
}
public static function checkOpenBaseDir()
{
if (strlen(ini_get('open_basedir') == 0)) {