diff --git a/app/Console/Commands/FinishUpdate.php b/app/Console/Commands/FinishUpdate.php index a25f2a00a..86d37f444 100644 --- a/app/Console/Commands/FinishUpdate.php +++ b/app/Console/Commands/FinishUpdate.php @@ -37,7 +37,7 @@ class FinishUpdate extends Command */ public function handle() { - set_time_limit(900); // 15 minutes + set_time_limit(3600); // 1 hour $this->info('Finishing update...'); @@ -56,7 +56,11 @@ class FinishUpdate extends Command // Set locale for modules if ($alias != 'core') { - app()->setLocale(Company::find($company_id)->locale); + $company = Company::find($company_id); + + if (!empty($company->locale)) { + app()->setLocale($company->locale); + } } session(['company_id' => $company_id]); diff --git a/app/Console/Commands/Update.php b/app/Console/Commands/Update.php index fd1086495..68c477f68 100644 --- a/app/Console/Commands/Update.php +++ b/app/Console/Commands/Update.php @@ -47,7 +47,7 @@ class Update extends Command */ public function handle() { - set_time_limit(900); // 15 minutes + set_time_limit(3600); // 1 hour $this->alias = $this->argument('alias'); diff --git a/app/Http/Controllers/Auth/Forgot.php b/app/Http/Controllers/Auth/Forgot.php index 007b60708..a761e10e2 100644 --- a/app/Http/Controllers/Auth/Forgot.php +++ b/app/Http/Controllers/Auth/Forgot.php @@ -10,17 +10,6 @@ use Illuminate\Support\Facades\Password; class Forgot extends Controller { - /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset emails and - | includes a trait which assists in sending these notifications from - | your application to your users. Feel free to explore this trait. - | - */ - use SendsPasswordResetEmails; /** diff --git a/app/Http/Controllers/Auth/Login.php b/app/Http/Controllers/Auth/Login.php index cec5b1fb3..dde57b182 100644 --- a/app/Http/Controllers/Auth/Login.php +++ b/app/Http/Controllers/Auth/Login.php @@ -9,17 +9,6 @@ use Illuminate\Support\Str; class Login extends Controller { - /* - |-------------------------------------------------------------------------- - | Login Controller - |-------------------------------------------------------------------------- - | - | This controller handles authenticating users for the application and - | redirecting them to your home screen. The controller uses a trait - | to conveniently provide its functionality to your applications. - | - */ - use AuthenticatesUsers; /** @@ -34,10 +23,6 @@ class Login extends Controller * * @return void */ - /*public function __construct() - { - $this->middleware('guest')->except('logout'); - }*/ public function __construct() { $this->middleware('guest', ['except' => 'destroy']); @@ -104,7 +89,7 @@ class Login extends Controller return response()->json($response); } - session(['dashboard_id' => $user->dashboards()->pluck('id')->first()]); + session(['dashboard_id' => $user->dashboards()->enabled()->pluck('id')->first()]); $response = [ 'status' => null, diff --git a/app/Http/Controllers/Auth/Reset.php b/app/Http/Controllers/Auth/Reset.php index fa3b5cb11..c8263fc96 100644 --- a/app/Http/Controllers/Auth/Reset.php +++ b/app/Http/Controllers/Auth/Reset.php @@ -10,17 +10,6 @@ use Illuminate\Support\Str; class Reset extends Controller { - /* - |-------------------------------------------------------------------------- - | Password Reset Controller - |-------------------------------------------------------------------------- - | - | This controller is responsible for handling password reset requests - | and uses a simple trait to include this behavior. You're free to - | explore this trait and override any methods you wish to tweak. - | - */ - use ResetsPasswords; /** diff --git a/app/Models/Common/Company.php b/app/Models/Common/Company.php index b46fc6eb4..86de79dbe 100644 --- a/app/Models/Common/Company.php +++ b/app/Models/Common/Company.php @@ -268,7 +268,7 @@ class Company extends Eloquent $search = $request->get('search'); $limit = $request->get('limit', setting('default.list_limit', '25')); - return $query->usingSearchString($search)->sortable($sort)->paginate($limit); + return user()->companies()->usingSearchString($search)->sortable($sort)->paginate($limit); } /** diff --git a/config/maintenancemode.php b/config/maintenancemode.php index bc9a42a38..687267d4c 100644 --- a/config/maintenancemode.php +++ b/config/maintenancemode.php @@ -7,14 +7,14 @@ return [ * * @var string */ - 'view' => 'maintenancemode::app-down', + 'view' => env('MAINTENANCE_VIEW', 'maintenancemode::app-down'), /** * Include CSS styles with the optional notification view * * @var boolean */ - 'notification-styles' => true, + 'notification-styles' => env('MAINTENANCE_STYLES', true), /** * Configuration values for injecting variables into the views @@ -59,7 +59,7 @@ return [ * * @var array */ - 'exempt-ips' => [env('MAINTENANCE_EXEMPT_IPS')], + 'exempt-ips' => explode(',', env('MAINTENANCE_EXEMPT_IPS')), /** * Use proxies to get the user's IP address @@ -68,7 +68,7 @@ return [ * * @var boolean */ - 'exempt-ips-proxy' => false, + 'exempt-ips-proxy' => env('MAINTENANCE_EXEMPT_IPS_PROXY', false), /** * An array of environments that will never show the maintenance page @@ -77,7 +77,7 @@ return [ * * @var array */ - 'exempt-environments' => [env('MAINTENANCE_EXEMPT_ENVIRONMENTS', 'local')], + 'exempt-environments' => explode(',', env('MAINTENANCE_EXEMPT_ENVIRONMENTS', 'local')), /** * A list of exemption classes to execute