Accept des valeurs vide pour le shell et le répertoire de chroot

tags/ipasserelle-base-0.2.65-1
Daniel Berteaud 13 years ago
parent 464ed3c13a
commit 6e41dc477d
  1. 4
      root/etc/e-smith/web/functions/userinfo
  2. 8
      root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm

@ -135,7 +135,7 @@ __DATA__
<label>URL</label>
</field>
<field type="text" size="30" id="Shell"
value="get_ldap_value('Shell')" validation="exec_exists">
value="get_ldap_value('Shell')" validation="exec_exists_or_empty">
<label>SHELL</label>
</field>
<field type="text" size="30" id="DesktopShell"
@ -143,7 +143,7 @@ __DATA__
<label>DESKTOP_SHELL</label>
</field>
<field type="text" size="30" id="ChrootDir"
value="get_ldap_value('ChrootDir')" validation="dir_exists">
value="get_ldap_value('ChrootDir')" validation="dir_exists_or_empty">
<label>CHROOT_DIR</label>
</field>
<subroutine src="print_save_button()" />

@ -235,20 +235,20 @@ sub url_or_empty {
return $ret;
}
sub dir_exists {
sub dir_exists_or_empty {
my ($self, $field) = @_;
my $ret = $self->localise('DIR_DOES_NOT_EXIST');
$ret = 'OK' if (-d "$field");
$ret = 'OK' if ((-d "$field") || ($field eq ''));
return $ret;
}
sub exec_exists {
sub exec_exists_or_empty {
my ($self, $field) = @_;
my $ret = $self->localise('IS_NOT_AN_EXECUTABLE');
$ret = 'OK' if (-x "$field");
$ret = 'OK' if ((-x "$field") || ($field eq ''));
return $ret;
}

Loading…
Cancel
Save