mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 14:07:32 -04:00 
			
		
		
		
	Merge pull request #7590 from turbo124/v5-develop
Minor fixes for create user route
This commit is contained in:
		
						commit
						aa7c3a0ce0
					
				| @ -158,7 +158,7 @@ class UserController extends BaseController | |||||||
|      */ |      */ | ||||||
|     public function create(CreateUserRequest $request) |     public function create(CreateUserRequest $request) | ||||||
|     { |     { | ||||||
|         $user = UserFactory::create(auth()->user()->account->id); |         $user = UserFactory::create(auth()->user()->account_id); | ||||||
| 
 | 
 | ||||||
|         return $this->itemResponse($user); |         return $this->itemResponse($user); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -200,6 +200,14 @@ class NinjaMailerJob implements ShouldQueue | |||||||
| 
 | 
 | ||||||
|         $user = User::find($this->decodePrimaryKey($sending_user)); |         $user = User::find($this->decodePrimaryKey($sending_user)); | ||||||
|          |          | ||||||
|  |         /* Always ensure the user is set on the correct account */ | ||||||
|  |         if($user->account_id != $this->company->account_id){ | ||||||
|  | 
 | ||||||
|  |             $this->nmo->settings->email_sending_method = 'default'; | ||||||
|  |             return $this->setMailDriver(); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         nlog("Sending via {$user->name()}"); |         nlog("Sending via {$user->name()}"); | ||||||
| 
 | 
 | ||||||
|         $token = $this->refreshOfficeToken($user); |         $token = $this->refreshOfficeToken($user); | ||||||
| @ -236,6 +244,14 @@ class NinjaMailerJob implements ShouldQueue | |||||||
| 
 | 
 | ||||||
|         $user = User::find($this->decodePrimaryKey($sending_user)); |         $user = User::find($this->decodePrimaryKey($sending_user)); | ||||||
| 
 | 
 | ||||||
|  |         /* Always ensure the user is set on the correct account */ | ||||||
|  |         if($user->account_id != $this->company->account_id){ | ||||||
|  | 
 | ||||||
|  |             $this->nmo->settings->email_sending_method = 'default'; | ||||||
|  |             return $this->setMailDriver(); | ||||||
|  | 
 | ||||||
|  |         } | ||||||
|  |          | ||||||
|         nlog("Sending via {$user->name()}"); |         nlog("Sending via {$user->name()}"); | ||||||
| 
 | 
 | ||||||
|         $google = (new Google())->init(); |         $google = (new Google())->init(); | ||||||
|  | |||||||
| @ -212,6 +212,7 @@ Route::group(['middleware' => ['throttle:100,1', 'api_db', 'token_auth', 'locale | |||||||
|     Route::get('purchase_orders/{purchase_order}/{action}', 'PurchaseOrderController@action')->name('purchase_orders.action'); |     Route::get('purchase_orders/{purchase_order}/{action}', 'PurchaseOrderController@action')->name('purchase_orders.action'); | ||||||
| 
 | 
 | ||||||
|     Route::get('users', 'UserController@index'); |     Route::get('users', 'UserController@index'); | ||||||
|  |     Route::get('users/create', 'UserController@create')->middleware('password_protected'); | ||||||
|     Route::get('users/{user}', 'UserController@show')->middleware('password_protected'); |     Route::get('users/{user}', 'UserController@show')->middleware('password_protected'); | ||||||
|     Route::put('users/{user}', 'UserController@update')->middleware('password_protected'); |     Route::put('users/{user}', 'UserController@update')->middleware('password_protected'); | ||||||
|     Route::post('users', 'UserController@store')->middleware('password_protected'); |     Route::post('users', 'UserController@store')->middleware('password_protected'); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user