From 0cb6a37f0d09174a7c057ba73b6f091a2ddeb45f Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 24 Aug 2012 11:10:51 +0200 Subject: [PATCH] Ajout d'un champ chroot --- root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo | 8 ++++++++ root/etc/e-smith/web/functions/userinfo | 4 ++++ root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo index 49be422..0763b93 100644 --- a/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo +++ b/root/etc/e-smith/locale/fr/etc/e-smith/web/functions/userinfo @@ -99,4 +99,12 @@ DESKTOP_SHELL Shell de connexion aux postes de travail + + CHROOT_DIR + Répertoire racine (chroot) + + + DIR_DOES_NOT_EXIST + Ce répertoire n'existe pas + diff --git a/root/etc/e-smith/web/functions/userinfo b/root/etc/e-smith/web/functions/userinfo index 3c94170..de34c4a 100644 --- a/root/etc/e-smith/web/functions/userinfo +++ b/root/etc/e-smith/web/functions/userinfo @@ -142,6 +142,10 @@ __DATA__ value="get_ldap_value('DesktopShell')"> + + + diff --git a/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm b/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm index ee2251d..9297edf 100644 --- a/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm +++ b/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm @@ -151,6 +151,7 @@ sub modify_user { 'Url' => $self->{cgi}->param('Url'), 'Shell' => $self->{cgi}->param('Shell'), 'DesktopShell' => $self->{cgi}->param('DesktopShell'), + 'ChrootDir' => $self->{cgi}->param('ChrootDir'), ); $acct->merge_props(%newProperties); @@ -234,4 +235,12 @@ sub url_or_empty { return $ret; } +sub dir_exists { + my ($self, $field) = @_; + my $ret = $self->localise('DIR_DOES_NOT_EXIST'); + + $ret = 'OK' if (-d "$field"); + return $ret; +} + 1;