Changeset 1042
- Timestamp:
- 05/31/12 19:50:39 (12 years ago)
- Location:
- trunk/LATMOS-Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm
r1041 r1042 21 21 =cut 22 22 23 ####24 23 # Return the configuration directory according settings: 25 24 # … … 33 32 =head1 FUNCTION 34 33 35 =head2 new($configdir )34 =head2 new($configdir, %options) 36 35 37 36 Instanciate a new LATMOS::Accounts object. 38 37 39 $configdirif defined is the directory containing files to use,38 C<$configdir> if defined is the directory containing files to use, 40 39 default to F</etc/latmos-accounts/>. 40 41 C<%options> can contains: 42 43 =over 4 44 45 =item noacl 46 47 If true, acls configuration are not load and code act like everything is 48 allowed. 49 50 This flag is usefull for administrative tools, for which no acl must apply. 51 52 =back 41 53 42 54 =cut … … 60 72 bless($self, $class); 61 73 62 if (!$options{noacl}) { 63 if ($self->val('_default_', 'acls')) { 64 $self->{_acls} = LATMOS::Accounts::Acls->new( 65 $self->val('_default_', 'acls') 66 ) or do { 67 la_log(LA_ERR, 68 'Cannot load ACL file %s', $self->val('_default_', 'acls') 69 ); 70 return; 71 }; 72 } elsif (-f (my $aclf = join('/', $self->_configdir, 'la-acls.ini'))) { 74 unless ($options{noacl}) { 75 if (-f (my $aclf = join('/', $self->_configdir, 'la-acls.ini'))) { 73 76 $self->{_acls} = LATMOS::Accounts::Acls->new($aclf) or do { 74 77 la_log(LA_ERR, 'Cannot load ACL file %s', $aclf); … … 78 81 } 79 82 80 if ($self->val('_default_', 'allowed_values')) { 81 $self->{_allowed_values} = Config::IniFiles->new( 82 -file => $self->val('_default_', 'allowed_values'), 83 ) or do { 84 la_log(LA_ERR, 'Cannot load ALLOWED VALUES %s', 85 $self->val('_default_', 'allowed_values')); 86 return; 87 }; 88 } elsif (-f (my $allowf = join('/', $self->_configdir, 89 'la-allowed-values.ini'))) { 83 if (-f (my $allowf = join('/', $self->_configdir, 'la-allowed-values.ini'))) { 90 84 $self->{_allowed_values} = Config::IniFiles->new( 91 85 -file => $allowf, -
trunk/LATMOS-Accounts/man/man5/latmos-accounts.ini.pod
r1013 r1042 41 41 42 42 The identity to use in FROM field when sending mail 43 44 =head3 acls45 46 The configuration file to use as ACL list47 48 =head3 allowed_values49 50 The configuration file containing attributes restriction51 43 52 44 =head3 expire_summary_to -
trunk/LATMOS-Accounts/sample/latmos-accounts.ini
r861 r1042 7 7 # Default synchro to apply 8 8 sync = name 9 # The acls file to use to limit access10 #acls =11 # An inifile containing per attributes values restriction12 # allowed_values =13 9 # smtp: the server used to send mail 14 10 smtp = localhost
Note: See TracChangeset
for help on using the changeset viewer.