diff --git a/VERSION.txt b/VERSION.txt index b3fc69690c5a..0c5d745ebb0d 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.1.12 \ No newline at end of file +5.1.13 \ No newline at end of file diff --git a/app/Http/Requests/User/StoreUserRequest.php b/app/Http/Requests/User/StoreUserRequest.php index 512994be8b3e..901d4b42f296 100644 --- a/app/Http/Requests/User/StoreUserRequest.php +++ b/app/Http/Requests/User/StoreUserRequest.php @@ -39,9 +39,9 @@ class StoreUserRequest extends Request $rules['last_name'] = 'required|string|max:100'; if (config('ninja.db.multi_db_enabled')) { - $rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')->ignore($this->input('company_user.account.id'), 'account_id')]; + $rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')->ignore(auth()->user()->company()->account_id, 'account_id')]; } else { - $rules['email'] = ['email',Rule::unique('users')->ignore($this->input('company_user.account.id'), 'account_id')]; + $rules['email'] = ['email',Rule::unique('users')->ignore(auth()->user()->company()->account_id, 'account_id')]; } @@ -56,7 +56,10 @@ class StoreUserRequest extends Request { $input = $this->all(); -nlog($this->input('company_user.account')); +//unique user rule - check company_user table for user_id / company_id / account_id if none exist we can add the user. ELSE return false + +//nlog($this->all()); +//nlog($this->input('company_user.account')); // nlog($this->input('company_user.account.id')); // nlog($this->input('company_user.account.id')); diff --git a/app/Models/Presenters/CompanyPresenter.php b/app/Models/Presenters/CompanyPresenter.php index dde59b55649e..247cce90d47d 100644 --- a/app/Models/Presenters/CompanyPresenter.php +++ b/app/Models/Presenters/CompanyPresenter.php @@ -36,8 +36,10 @@ class CompanyPresenter extends EntityPresenter $settings = $this->entity->settings; } - if(strlen($settings->company_logo)) - return asset($settings->company_logo); + if(strlen($settings->company_logo) >= 1 && strpos($settings->company_logo, 'http')) + return $settings->company_logo; + else if(strlen($settings->company_logo) >= 1) + return url('') . $settings->company_logo; else return 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'; diff --git a/config/ninja.php b/config/ninja.php index 0662c2573a02..40e4e421927e 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -13,7 +13,7 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', ''), - 'app_version' => '5.1.12', + 'app_version' => '5.1.13', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false),