Exemple #1
0
 def clean_nt4_workgroup(self):
     workgroup = self.cleaned_data.get("nt4_workgroup")
     try:
         validate_netbios_name(workgroup)
     except Exception as e:
         raise forms.ValidationError(_("workgroup: %s" % e))
     return workgroup
Exemple #2
0
 def clean_nt4_workgroup(self):
     workgroup = self.cleaned_data.get("nt4_workgroup")
     try:
         validate_netbios_name(workgroup)
     except Exception as e:
         raise forms.ValidationError(_("workgroup: %s" % e))
     return workgroup
Exemple #3
0
 def clean_ldap_netbiosname_a(self):
     netbiosname = self.cleaned_data.get("ldap_netbiosname_a")
     try:
         validate_netbios_name(netbiosname)
     except Exception as e:
         raise forms.ValidationError(e)
     return netbiosname
Exemple #4
0
 def clean_ldap_netbiosname_a(self):
     netbiosname = self.cleaned_data.get("ldap_netbiosname_a")
     try:
         validate_netbios_name(netbiosname)
     except Exception as e:
         raise forms.ValidationError(e)
     return netbiosname
Exemple #5
0
 def clean_ldap_netbiosalias(self):
     netbiosalias = self.cleaned_data.get("ldap_netbiosalias")
     if netbiosalias:
         try:
             validate_netbios_name(netbiosalias)
         except Exception as e:
             raise forms.ValidationError(e)
     return netbiosalias
Exemple #6
0
 def clean_ldap_netbiosalias(self):
     netbiosalias = self.cleaned_data.get("ldap_netbiosalias")
     if netbiosalias:
         try:
             validate_netbios_name(netbiosalias)
         except Exception as e:
             raise forms.ValidationError(e)
     return netbiosalias
Exemple #7
0
 def clean_ldap_netbiosname_b(self):
     netbiosname_a = self.cleaned_data.get("ldap_netbiosname_a")
     netbiosname = self.cleaned_data.get("ldap_netbiosname_b")
     if not netbiosname:
         return netbiosname
     if netbiosname_a and netbiosname_a == netbiosname:
         raise forms.ValidationError(
             _('NetBIOS cannot be the same as the first.'))
     try:
         validate_netbios_name(netbiosname)
     except Exception as e:
         raise forms.ValidationError(e)
     return netbiosname
Exemple #8
0
 def clean_ldap_netbiosname_b(self):
     netbiosname_a = self.cleaned_data.get("ldap_netbiosname_a")
     netbiosname = self.cleaned_data.get("ldap_netbiosname_b")
     if not netbiosname:
         return netbiosname
     if netbiosname_a and netbiosname_a == netbiosname:
         raise forms.ValidationError(_(
             'NetBIOS cannot be the same as the first.'
         ))
     try:
         validate_netbios_name(netbiosname)
     except Exception as e:
         raise forms.ValidationError(e)
     return netbiosname
Exemple #9
0
 def clean_ad_netbiosname_b(self):
     netbiosname_a = self.cleaned_data.get("ad_netbiosname_a")
     netbiosname = self.cleaned_data.get("ad_netbiosname_b")
     if not netbiosname:
         return netbiosname
     if netbiosname_a and netbiosname_a == netbiosname:
         with client as c:
             system_dataset = c.call('systemdataset.config')
         if system_dataset['path'] == "freenas-boot":
             raise forms.ValidationError(
                 _('When the system dataset is located on the boot device, the same NetBIOS name cannot be used on both controllers.'
                   ))
     try:
         validate_netbios_name(netbiosname)
     except Exception as e:
         raise forms.ValidationError(e)
     return netbiosname