mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:07:33 -05:00 
			
		
		
		
	Merge pull request #5739 from turbo124/v5-develop
Fixes for subdomain checks
This commit is contained in:
		
						commit
						50ba43c2e4
					
				@ -83,7 +83,7 @@ class Handler extends ExceptionHandler
 | 
			
		||||
                        'email' => 'anonymous@example.com',
 | 
			
		||||
                        'name'  => 'Anonymous User',
 | 
			
		||||
                    ]);
 | 
			
		||||
                } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->companyIsSet() && auth()->user()->company()->account->report_errors) {
 | 
			
		||||
                } elseif (auth()->guard('user') && auth()->guard('user')->user() && auth()->user()->company() && auth()->user()->company()->account->report_errors) {
 | 
			
		||||
                    $scope->setUser([
 | 
			
		||||
                        'id'    => auth()->user()->account->key,
 | 
			
		||||
                        'email' => 'anonymous@example.com',
 | 
			
		||||
 | 
			
		||||
@ -64,8 +64,8 @@ class StripeConnectController extends BaseController
 | 
			
		||||
        // if($email = $request->getContact()->email)
 | 
			
		||||
        //     $endpoint .= "&stripe_user[email]={$email}";
 | 
			
		||||
 | 
			
		||||
        $company_name = str_replace(" ", "_", $company->present()->name());
 | 
			
		||||
        $endpoint .= "&stripe_user[business_name]={$company_name}";
 | 
			
		||||
        // $company_name = str_replace(" ", "_", $company->present()->name());
 | 
			
		||||
        // $endpoint .= "&stripe_user[business_name]={$company_name}";
 | 
			
		||||
 | 
			
		||||
        return redirect($endpoint);
 | 
			
		||||
    }
 | 
			
		||||
@ -83,6 +83,7 @@ class StripeConnectController extends BaseController
 | 
			
		||||
 | 
			
		||||
        }catch(\Exception $e)
 | 
			
		||||
        {
 | 
			
		||||
            
 | 
			
		||||
            nlog($e->getMessage());
 | 
			
		||||
        
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -41,7 +41,7 @@ class SubdomainController extends BaseController
 | 
			
		||||
    public function index()
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        if(in_array(request()->input('subdomain'), $this->protected) || MultiDB::findAndSetDbByDomain(request()->input('subdomain')))
 | 
			
		||||
        if(in_array(request()->input('subdomain'), $this->protected) || MultiDB::findAndSetDbByDomain(['subdomain' => request()->input('subdomain')]))
 | 
			
		||||
            return response()->json(['message' => 'Domain not available'] , 401);
 | 
			
		||||
 | 
			
		||||
        return response()->json(['message' => 'Domain available'], 200);
 | 
			
		||||
 | 
			
		||||
@ -94,6 +94,9 @@ return [
 | 
			
		||||
            'prefix_indexes' => true,
 | 
			
		||||
            'strict'         => env('DB_STRICT', false),
 | 
			
		||||
            'engine'         => 'InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8',
 | 
			
		||||
            //  'options'   => array(
 | 
			
		||||
            //     PDO::ATTR_EMULATE_PREPARES => true
 | 
			
		||||
            // ),
 | 
			
		||||
        ],
 | 
			
		||||
 | 
			
		||||
        'db-ninja-02' => [
 | 
			
		||||
@ -109,6 +112,9 @@ return [
 | 
			
		||||
            'prefix_indexes' => true,
 | 
			
		||||
            'strict'         => env('DB_STRICT', false),
 | 
			
		||||
            'engine'         => 'InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8',
 | 
			
		||||
            //  'options'   => array(
 | 
			
		||||
            //     PDO::ATTR_EMULATE_PREPARES => true
 | 
			
		||||
            // ),
 | 
			
		||||
        ],
 | 
			
		||||
    ],
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user