/[A3C]/lib/A3C/Model/hrEduOrg.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/A3C/Model/hrEduOrg.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 208 - (show annotations)
Thu Jun 19 21:24:26 2008 UTC (15 years, 10 months ago) by dpavlin
File size: 4916 byte(s)
another round of re-factoring

- re-organize LDAP-related pages under /ldap with new view A3C::View::LDAP
- move record multi-value support into A3C::Record
- document multi-value solution which started it all
1 package A3C::Model::hrEduOrg;
2 use strict;
3 use warnings;
4
5 use Jifty::DBI::Schema;
6 use Data::Dump qw/dump/;
7
8 use A3C::Record schema {
9
10 # hrEduOrg super: organization
11
12 # hrEduOrg must:
13
14 column hrEduOrgUniqueNumber =>
15 label is _('Visestruka vrijednost brojcani identifikator ustanove'),
16 max_length is 128,
17 is indexed,
18 is mandatory;
19
20 column hrEduOrgMail =>
21 label is _('Sluzbena e-mail adresa ustanove'),
22 max_length is 256,
23 is mandatory;
24
25 column o =>
26 label is _('RFC2256: organization this object belongs to'),
27 is mandatory;
28
29 column hrEduOrgURL =>
30 label is _('URL adresa Web sjedista ustanove'),
31 max_length is 256,
32 is mandatory;
33
34 column hrEduOrgType =>
35 label is _('Jednostruka vrijednost prema kategorizaciji MZOS'),
36 max_length is 128,
37 is mandatory;
38
39 column objectClass =>
40 label is _('RFC2256: object classes of the entity'),
41 is mandatory;
42
43
44 # hrEduOrg may:
45
46 column businessCategory =>
47 label is _('RFC2256: business category'),
48 max_length is 128;
49
50 column searchGuide =>
51 label is _('RFC2256: search guide, obsoleted by enhancedSearchGuide');
52
53 column internationaliSDNNumber =>
54 label is _('RFC2256: international ISDN number'),
55 max_length is 16;
56
57 column telexNumber =>
58 label is _('RFC2256: Telex Number');
59
60 column hrEduOrgPolicyURI =>
61 label is _('URI s oznakom; pokazuje na sluzbenu politiku ustanove'),
62 max_length is 256;
63
64 column postOfficeBox =>
65 label is _('RFC2256: Post Office Box'),
66 max_length is 40;
67
68 column telephoneNumber =>
69 label is _('RFC2256: Telephone Number'),
70 max_length is 32;
71
72 column destinationIndicator =>
73 label is _('RFC2256: destination indicator'),
74 max_length is 128;
75
76 column facsimileTelephoneNumber =>
77 label is _('RFC2256: Facsimile (Fax) Telephone Number');
78
79 column hrEduOrgMobile =>
80 label is _('Broj mobilnog telefona ustanove');
81
82 column userPassword =>
83 label is _('RFC2256/2307: password of user'),
84 max_length is 128;
85
86 column x121Address =>
87 label is _('RFC2256: X.121 Address'),
88 max_length is 15;
89
90 column st =>
91 label is _('RFC2256: state or province which this object resides in');
92
93 column postalCode =>
94 label is _('RFC2256: postal code'),
95 max_length is 40;
96
97 column seeAlso =>
98 label is _('RFC2256: DN of related object');
99
100 column postalAddress =>
101 render as 'textarea',
102 label is _('RFC2256: postal address');
103
104 column physicalDeliveryOfficeName =>
105 label is _('RFC2256: Physical Delivery Office Name'),
106 max_length is 128;
107
108 column teletexTerminalIdentifier =>
109 label is _('RFC2256: Teletex Terminal Identifier');
110
111 column l =>
112 label is _('RFC2256: locality which this object resides in');
113
114 column registeredAddress =>
115 label is _('RFC2256: registered postal address');
116
117 column hrEduOrgMember =>
118 label is _('Pripadnost nekoj ustanovi'),
119 max_length is 128;
120
121 column description =>
122 label is _('RFC2256: descriptive information'),
123 max_length is 1024;
124
125 column preferredDeliveryMethod =>
126 label is _('RFC2256: preferred delivery method');
127
128 column street =>
129 label is _('RFC2256: street address of this object'),
130 max_length is 128;
131
132
133 # dcObject super: top
134
135 # dcObject must:
136
137 column dc =>
138 label is _('RFC1274/2247: domain component'),
139 is mandatory;
140
141
142 # posixAccount super: top
143
144 # posixAccount must:
145
146 column uidNumber =>
147 type is 'int',
148 label is _('An integer uniquely identifying a user in an administrative domain'),
149 is indexed,
150 is distinct,
151 is mandatory;
152
153 column uid =>
154 label is _('RFC1274: user identifier'),
155 max_length is 256,
156 is indexed,
157 is distinct,
158 is mandatory;
159
160 column homeDirectory =>
161 label is _('The absolute path to the home directory'),
162 is mandatory;
163
164 column cn =>
165 label is _('RFC2256: common name(s) for which the entity is known by'),
166 is indexed,
167 is mandatory;
168
169 column gidNumber =>
170 type is 'int',
171 label is _('An integer uniquely identifying a group in an administrative domain'),
172 is mandatory;
173
174
175 # posixAccount may:
176
177 column gecos =>
178 label is _('The GECOS field; the common name');
179
180 column loginShell =>
181 label is _('The path to the login shell');
182
183
184
185
186 };
187
188
189 =head2 name
190
191 Humanly readable name of organization
192
193 =cut
194
195 sub name {
196 my $self = shift;
197 return $self->cn . ' - ' . $self->o;
198 }
199
200 =head2 validate_uidNumber
201
202 =cut
203
204 sub validate_uidNumber {
205 my ( $self, $value ) = @_;
206 return ( 0, _('uidNumber must be only digits') ) unless $value =~ m/^\d+$/;
207 return ( 1, 'OK' );
208 }
209
210 =head2 validate_gidNumber
211
212 =cut
213
214 sub validate_gidNumber {
215 my ( $self, $value ) = @_;
216 return ( 0, _('gidNumber must be only digits') ) unless $value =~ m/^\d+$/;
217 return ( 1, 'OK' );
218 }
219
220 =head2 ACL
221
222 We use L<A3C::DefaultACL> for access control
223
224 =cut
225
226 use A3C::DefaultACL;
227
228 # added to make Jifty::View::Declare::CRUD happy because it
229 # tries to capitalize first letter of model creating
230 # A3C::Model::HrEduOrg which is invalid
231 sub object_type { 'A3C::Model::hrEduOrg' }
232 sub collection_class { 'A3C::Model::hrEduOrgCollection' }
233
234 1;

  ViewVC Help
Powered by ViewVC 1.1.26