mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Updated validation
This commit is contained in:
parent
33a35ec7f5
commit
eacf70ee3f
|
@ -24,14 +24,14 @@ class SetupUserRequest extends Request
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'site_name' => 'required|string|min:1',
|
||||
'first_name' => 'required|string|min:1',
|
||||
'last_name' => 'required|string|min:1',
|
||||
'location_id' => 'numeric',
|
||||
'username' => 'required|string|min:2|unique:users,username,NULL,deleted_at',
|
||||
'email' => 'email|unique:users,email',
|
||||
'password' => 'required|min:6',
|
||||
'password_confirm' => 'required|min:6|same:password',
|
||||
'company_id' => 'integer',
|
||||
'email_domain' => 'required|min:4',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -11,19 +11,30 @@ class Setting extends Model
|
|||
use ValidatingTrait;
|
||||
|
||||
protected $rules = [
|
||||
"site_name" => 'required|min:1',
|
||||
"brand" => 'required|min:1|numeric',
|
||||
"alert_threshold" => 'numeric',
|
||||
"alert_interval" => 'numeric',
|
||||
"qr_text" => 'min:1|max:31',
|
||||
"logo_img" => 'mimes:jpeg,bmp,png,gif',
|
||||
"custom_css" => 'string',
|
||||
"alert_email" => 'email_array',
|
||||
"slack_endpoint" => 'url',
|
||||
"default_currency" => 'required',
|
||||
"locale" => 'required',
|
||||
"slack_channel" => 'regex:/(?<!\w)#\w+/',
|
||||
"slack_botname" => 'string',
|
||||
'labels_per_page' => 'numeric',
|
||||
'labels_width' => 'numeric',
|
||||
'labels_height' => 'numeric',
|
||||
'labels_pmargin_left' => 'numeric',
|
||||
'labels_pmargin_right' => 'numeric',
|
||||
'labels_pmargin_top' => 'numeric',
|
||||
'labels_pmargin_bottom' => 'numeric',
|
||||
'labels_display_bgutter' => 'numeric',
|
||||
'labels_display_sgutter' => 'numeric',
|
||||
'labels_fontsize' => 'numeric|min:5',
|
||||
'labels_pagewidth' => 'numeric',
|
||||
'labels_pageheight' => 'numeric',
|
||||
"ldap_server" => 'sometimes|required_if:ldap_enabled,1|url',
|
||||
"ldap_uname" => 'sometimes|required_if:ldap_enabled,1',
|
||||
"ldap_pword" => 'sometimes|required_if:ldap_enabled,1',
|
||||
"ldap_basedn" => 'sometimes|required_if:ldap_enabled,1',
|
||||
"ldap_filter" => 'sometimes|required_if:ldap_enabled,1',
|
||||
"ldap_username_field" => 'sometimes|required_if:ldap_enabled,1',
|
||||
|
@ -32,7 +43,7 @@ class Setting extends Model
|
|||
"ldap_version" => 'sometimes|required_if:ldap_enabled,1',
|
||||
];
|
||||
|
||||
protected $fillable = ['site_name'];
|
||||
protected $fillable = ['site_name','email_domain','email_format','username_format'];
|
||||
|
||||
public static function getSettings()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue