mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:57:35 -05:00 
			
		
		
		
	fixes for validation
This commit is contained in:
		
							parent
							
								
									4ff0108c5c
								
							
						
					
					
						commit
						976f610158
					
				@ -47,14 +47,10 @@ class InvitationController extends Controller
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        $entity_obj = 'App\Models\\'.ucfirst(Str::camel($entity)).'Invitation';
 | 
					        $entity_obj = 'App\Models\\'.ucfirst(Str::camel($entity)).'Invitation';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
nlog($entity);
 | 
					 | 
				
			||||||
nlog($entity_obj);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key])
 | 
					        $invitation = $entity_obj::whereRaw('BINARY `key`= ?', [$invitation_key])
 | 
				
			||||||
                                    ->with('contact.client')
 | 
					                                    ->with('contact.client')
 | 
				
			||||||
                                    ->firstOrFail();
 | 
					                                    ->firstOrFail();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
nlog($invitation->getLink());
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* Return early if we have the correct client_hash embedded */
 | 
					        /* Return early if we have the correct client_hash embedded */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -39,9 +39,9 @@ class StoreUserRequest extends Request
 | 
				
			|||||||
        $rules['last_name'] = 'required|string|max:100';
 | 
					        $rules['last_name'] = 'required|string|max:100';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (config('ninja.db.multi_db_enabled')) {
 | 
					        if (config('ninja.db.multi_db_enabled')) {
 | 
				
			||||||
            $rules['email'] = ['email:rfc,dns', new ValidUserForCompany(), Rule::unique('users')];
 | 
					            $rules['email'] = ['email', new ValidUserForCompany(), Rule::unique('users')];
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            $rules['email'] = ['email:rfc,dns',Rule::unique('users')];
 | 
					            $rules['email'] = ['email',Rule::unique('users')];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -35,7 +35,7 @@ class UpdateUserRequest extends Request
 | 
				
			|||||||
        ];
 | 
					        ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (isset($input['email'])) {
 | 
					        if (isset($input['email'])) {
 | 
				
			||||||
            $rules['email'] = ['email:rfc,dns', 'sometimes', new UniqueUserRule($this->user, $input['email'])];
 | 
					            $rules['email'] = ['email', 'sometimes', new UniqueUserRule($this->user, $input['email'])];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $rules;
 | 
					        return $rules;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user