mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 05:47:34 -05:00 
			
		
		
		
	Merge pull request #8269 from turbo124/v5-develop
Fixes for archived clients attempting to view client portal.
This commit is contained in:
		
						commit
						d955643748
					
				@ -383,7 +383,7 @@ class CompanySettings extends BaseSettings
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public $page_layout = 'portrait';
 | 
					    public $page_layout = 'portrait';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public $font_size = 7; //@implemented
 | 
					    public $font_size = 16; //@implemented
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public $primary_font = 'Roboto';
 | 
					    public $primary_font = 'Roboto';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -70,14 +70,19 @@ class StripeConnectController extends BaseController
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        \Stripe\Stripe::setApiKey(config('ninja.ninja_stripe_key'));
 | 
					        \Stripe\Stripe::setApiKey(config('ninja.ninja_stripe_key'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if($request->has('error') && $request->error == 'access_denied'){
 | 
				
			||||||
 | 
					            return view('auth.connect.access_denied');
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            $response = \Stripe\OAuth::token([
 | 
					            $response = \Stripe\OAuth::token([
 | 
				
			||||||
                'grant_type' => 'authorization_code',
 | 
					                'grant_type' => 'authorization_code',
 | 
				
			||||||
                'code' => $request->input('code'),
 | 
					                'code' => $request->input('code'),
 | 
				
			||||||
            ]);
 | 
					            ]);
 | 
				
			||||||
        } catch (\Exception $e) {
 | 
					        } catch (\Exception $e) {
 | 
				
			||||||
            nlog($e->getMessage());
 | 
					
 | 
				
			||||||
            throw new SystemError($e->getMessage(), 500);
 | 
					            return view('auth.connect.access_denied');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']);
 | 
					        MultiDB::findAndSetDbByCompanyKey($request->getTokenContent()['company_key']);
 | 
				
			||||||
 | 
				
			|||||||
@ -50,7 +50,7 @@ class DocumentsTable extends Component
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        MultiDB::setDb($this->db);
 | 
					        MultiDB::setDb($this->db);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->client = Client::with('company')->find($this->client_id);
 | 
					        $this->client = Client::withTrashed()->with('company')->find($this->client_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->company = $this->client->company;
 | 
					        $this->company = $this->client->company;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -29,7 +29,7 @@ class PaymentMethodsTable extends Component
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        MultiDB::setDb($this->db);
 | 
					        MultiDB::setDb($this->db);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->client = Client::with('company')->find($this->client_id);
 | 
					        $this->client = Client::withTrashed()->with('company')->find($this->client_id);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->company = $this->client->company;
 | 
					        $this->company = $this->client->company;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -240,7 +240,6 @@ class ClientContact extends Authenticatable implements HasLocalePreference
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
        return $this
 | 
					        return $this
 | 
				
			||||||
            ->withTrashed()
 | 
					            ->withTrashed()
 | 
				
			||||||
            // ->company()
 | 
					 | 
				
			||||||
            ->where('id', $this->decodePrimaryKey($value))->firstOrFail();
 | 
					            ->where('id', $this->decodePrimaryKey($value))->firstOrFail();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -45,7 +45,7 @@ class QuoteObserver
 | 
				
			|||||||
     * @return void
 | 
					     * @return void
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public function updated(Quote $quote)
 | 
					    public function updated(Quote $quote)
 | 
				
			||||||
    {nlog("updated");
 | 
					    {
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        $event = Webhook::EVENT_UPDATE_QUOTE;
 | 
					        $event = Webhook::EVENT_UPDATE_QUOTE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -76,7 +76,7 @@ return [
 | 
				
			|||||||
        'redis' => [
 | 
					        'redis' => [
 | 
				
			||||||
            'driver' => 'redis',
 | 
					            'driver' => 'redis',
 | 
				
			||||||
            'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
 | 
					            'connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
 | 
				
			||||||
            'lock_connection' => 'default',
 | 
					            'lock_connection' => env('REDIS_CACHE_CONNECTION', 'cache'),
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        'dynamodb' => [
 | 
					        'dynamodb' => [
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										13
									
								
								resources/views/auth/connect/access_denied.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								resources/views/auth/connect/access_denied.blade.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					@extends('layouts.ninja')
 | 
				
			||||||
 | 
					@section('meta_title', ctrans('texts.success'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@section('body')
 | 
				
			||||||
 | 
					    <div class="flex flex-col justify-center items-center mt-10">
 | 
				
			||||||
 | 
					        <div class="mb-4">
 | 
				
			||||||
 | 
					            <svg height="60"  version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 468 222.5" xml:space="preserve"><style>.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#635bff}</style><path class="st0" d="M414 113.4c0-25.6-12.4-45.8-36.1-45.8-23.8 0-38.2 20.2-38.2 45.6 0 30.1 17 45.3 41.4 45.3 11.9 0 20.9-2.7 27.7-6.5v-20c-6.8 3.4-14.6 5.5-24.5 5.5-9.7 0-18.3-3.4-19.4-15.2h48.9c0-1.3.2-6.5.2-8.9zm-49.4-9.5c0-11.3 6.9-16 13.2-16 6.1 0 12.6 4.7 12.6 16h-25.8zM301.1 67.6c-9.8 0-16.1 4.6-19.6 7.8l-1.3-6.2h-22v116.6l25-5.3.1-28.3c3.6 2.6 8.9 6.3 17.7 6.3 17.9 0 34.2-14.4 34.2-46.1-.1-29-16.6-44.8-34.1-44.8zm-6 68.9c-5.9 0-9.4-2.1-11.8-4.7l-.1-37.1c2.6-2.9 6.2-4.9 11.9-4.9 9.1 0 15.4 10.2 15.4 23.3 0 13.4-6.2 23.4-15.4 23.4zM223.8 61.7l25.1-5.4V36l-25.1 5.3zM223.8 69.3h25.1v87.5h-25.1zM196.9 76.7l-1.6-7.4h-21.6v87.5h25V97.5c5.9-7.7 15.9-6.3 19-5.2v-23c-3.2-1.2-14.9-3.4-20.8 7.4zM146.9 47.6l-24.4 5.2-.1 80.1c0 14.8 11.1 25.7 25.9 25.7 8.2 0 14.2-1.5 17.5-3.3V135c-3.2 1.3-19 5.9-19-8.9V90.6h19V69.3h-19l.1-21.7zM79.3 94.7c0-3.9 3.2-5.4 8.5-5.4 7.6 0 17.2 2.3 24.8 6.4V72.2c-8.3-3.3-16.5-4.6-24.8-4.6C67.5 67.6 54 78.2 54 95.9c0 27.6 38 23.2 38 35.1 0 4.6-4 6.1-9.6 6.1-8.3 0-18.9-3.4-27.3-8v23.8c9.3 4 18.7 5.7 27.3 5.7 20.8 0 35.1-10.3 35.1-28.2-.1-29.8-38.2-24.5-38.2-35.7z"/></svg>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        <p>We were unable to connect to Stripe as access was denied.</p>
 | 
				
			||||||
 | 
					        <span>Click <a class="font-semibold hover:underline" href="{{ url('/#/settings/company_gateways') }}">here</a> to continue.</span>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					@endsection
 | 
				
			||||||
@ -56,7 +56,7 @@
 | 
				
			|||||||
                    type="checkbox"
 | 
					                    type="checkbox"
 | 
				
			||||||
                    class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
 | 
					                    class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500"
 | 
				
			||||||
                  /> 
 | 
					                  /> 
 | 
				
			||||||
                <a href="#" class="group relative inline-block ml-4 text-blue-500 hover:text-red-500 duration-300 no-underline" @click="open = true">{{ ctrans('texts.terms')}}</a>
 | 
					                <a href="#" class="group relative inline-block ml-4 text-blue-500 hover:text-red-500 duration-300 no-underline" @click="open = true">{{ ctrans('texts.agree_to_terms', ['terms' => ctrans('texts.terms')]) }}</a>
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user