mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Ajout du home par défaut dans les préférences
This commit is contained in:
parent
49646ae34b
commit
6b1ad1fa66
2 changed files with 6 additions and 1 deletions
|
@ -98,6 +98,11 @@ class OptionalUser(AclMixin, PreferencesModel):
|
|||
default = 15,
|
||||
help_text = "Maximum number of local email address for a standard user"
|
||||
)
|
||||
default_home_path = models.CharField(
|
||||
max_length = 256,
|
||||
default = "/home/{0}",
|
||||
help_text = "Chemin par défaut du home des utilisateurs, formaté avec le pseudo"
|
||||
)
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
|
|
|
@ -537,7 +537,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
|
|||
user_ldap.name = self.pseudo
|
||||
user_ldap.sn = self.pseudo
|
||||
user_ldap.dialupAccess = str(self.has_access())
|
||||
user_ldap.home_directory = '/home/' + self.pseudo
|
||||
user_ldap.home_directory = OptionalUser.get_cached_value('default_home_path').format(self.pseudo)
|
||||
user_ldap.mail = self.email
|
||||
user_ldap.given_name = self.surname.lower() + '_'\
|
||||
+ self.name.lower()[:3]
|
||||
|
|
Loading…
Reference in a new issue