Validation du champs Shell

tags/ipasserelle-base-0.2.65-1
Daniel Berteaud 12 years ago
parent db39f8e39c
commit 464ed3c13a
  1. 4
      root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo
  2. 2
      root/etc/e-smith/web/functions/userinfo
  3. 9
      root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm

@ -107,4 +107,8 @@
<base>DIR_DOES_NOT_EXIST</base> <base>DIR_DOES_NOT_EXIST</base>
<trans>Ce répertoire n'existe pas</trans> <trans>Ce répertoire n'existe pas</trans>
</entry> </entry>
<entry>
<base>IS_NOT_AN_EXECUTABLE</base>
<trans>Veuillez sélectionner un exécutable</trans>
</entry>
</lexicon> </lexicon>

@ -135,7 +135,7 @@ __DATA__
<label>URL</label> <label>URL</label>
</field> </field>
<field type="text" size="30" id="Shell" <field type="text" size="30" id="Shell"
value="get_ldap_value('Shell')"> value="get_ldap_value('Shell')" validation="exec_exists">
<label>SHELL</label> <label>SHELL</label>
</field> </field>
<field type="text" size="30" id="DesktopShell" <field type="text" size="30" id="DesktopShell"

@ -243,4 +243,13 @@ sub dir_exists {
return $ret; return $ret;
} }
sub exec_exists {
my ($self, $field) = @_;
my $ret = $self->localise('IS_NOT_AN_EXECUTABLE');
$ret = 'OK' if (-x "$field");
return $ret;
}
1; 1;

Loading…
Cancel
Save