This commit was generated by cvs2svn to compensate for changes in r3921,
[freeside.git] / rt / lib / RT / User.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
10 # from www.gnu.org.
11
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
21
22
23 # END LICENSE BLOCK
24 # Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
25 # WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.  
26
27 # !! DO NOT EDIT THIS FILE !!
28 #
29
30 use strict;
31
32
33 =head1 NAME
34
35 RT::User
36
37
38 =head1 SYNOPSIS
39
40 =head1 DESCRIPTION
41
42 =head1 METHODS
43
44 =cut
45
46 package RT::User;
47 use RT::Record; 
48
49
50 use vars qw( @ISA );
51 @ISA= qw( RT::Record );
52
53 sub _Init {
54   my $self = shift; 
55
56   $self->Table('Users');
57   $self->SUPER::_Init(@_);
58 }
59
60
61
62
63
64 =item Create PARAMHASH
65
66 Create takes a hash of values and creates a row in the database:
67
68   varchar(200) 'Name'.
69   varchar(40) 'Password'.
70   blob 'Comments'.
71   blob 'Signature'.
72   varchar(120) 'EmailAddress'.
73   blob 'FreeformContactInfo'.
74   varchar(200) 'Organization'.
75   varchar(120) 'RealName'.
76   varchar(16) 'NickName'.
77   varchar(16) 'Lang'.
78   varchar(16) 'EmailEncoding'.
79   varchar(16) 'WebEncoding'.
80   varchar(100) 'ExternalContactInfoId'.
81   varchar(30) 'ContactInfoSystem'.
82   varchar(100) 'ExternalAuthId'.
83   varchar(30) 'AuthSystem'.
84   varchar(16) 'Gecos'.
85   varchar(30) 'HomePhone'.
86   varchar(30) 'WorkPhone'.
87   varchar(30) 'MobilePhone'.
88   varchar(30) 'PagerPhone'.
89   varchar(200) 'Address1'.
90   varchar(200) 'Address2'.
91   varchar(100) 'City'.
92   varchar(100) 'State'.
93   varchar(16) 'Zip'.
94   varchar(50) 'Country'.
95   varchar(50) 'Timezone'.
96   text 'PGPKey'.
97
98 =cut
99
100
101
102
103 sub Create {
104     my $self = shift;
105     my %args = ( 
106                 Name => '',
107                 Password => '',
108                 Comments => '',
109                 Signature => '',
110                 EmailAddress => '',
111                 FreeformContactInfo => '',
112                 Organization => '',
113                 RealName => '',
114                 NickName => '',
115                 Lang => '',
116                 EmailEncoding => '',
117                 WebEncoding => '',
118                 ExternalContactInfoId => '',
119                 ContactInfoSystem => '',
120                 ExternalAuthId => '',
121                 AuthSystem => '',
122                 Gecos => '',
123                 HomePhone => '',
124                 WorkPhone => '',
125                 MobilePhone => '',
126                 PagerPhone => '',
127                 Address1 => '',
128                 Address2 => '',
129                 City => '',
130                 State => '',
131                 Zip => '',
132                 Country => '',
133                 Timezone => '',
134                 PGPKey => '',
135
136                   @_);
137     $self->SUPER::Create(
138                          Name => $args{'Name'},
139                          Password => $args{'Password'},
140                          Comments => $args{'Comments'},
141                          Signature => $args{'Signature'},
142                          EmailAddress => $args{'EmailAddress'},
143                          FreeformContactInfo => $args{'FreeformContactInfo'},
144                          Organization => $args{'Organization'},
145                          RealName => $args{'RealName'},
146                          NickName => $args{'NickName'},
147                          Lang => $args{'Lang'},
148                          EmailEncoding => $args{'EmailEncoding'},
149                          WebEncoding => $args{'WebEncoding'},
150                          ExternalContactInfoId => $args{'ExternalContactInfoId'},
151                          ContactInfoSystem => $args{'ContactInfoSystem'},
152                          ExternalAuthId => $args{'ExternalAuthId'},
153                          AuthSystem => $args{'AuthSystem'},
154                          Gecos => $args{'Gecos'},
155                          HomePhone => $args{'HomePhone'},
156                          WorkPhone => $args{'WorkPhone'},
157                          MobilePhone => $args{'MobilePhone'},
158                          PagerPhone => $args{'PagerPhone'},
159                          Address1 => $args{'Address1'},
160                          Address2 => $args{'Address2'},
161                          City => $args{'City'},
162                          State => $args{'State'},
163                          Zip => $args{'Zip'},
164                          Country => $args{'Country'},
165                          Timezone => $args{'Timezone'},
166                          PGPKey => $args{'PGPKey'},
167 );
168
169 }
170
171
172
173 =item id
174
175 Returns the current value of id. 
176 (In the database, id is stored as int(11).)
177
178
179 =cut
180
181
182 =item Name
183
184 Returns the current value of Name. 
185 (In the database, Name is stored as varchar(200).)
186
187
188
189 =item SetName VALUE
190
191
192 Set Name to VALUE. 
193 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
194 (In the database, Name will be stored as a varchar(200).)
195
196
197 =cut
198
199
200 =item Password
201
202 Returns the current value of Password. 
203 (In the database, Password is stored as varchar(40).)
204
205
206
207 =item SetPassword VALUE
208
209
210 Set Password to VALUE. 
211 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
212 (In the database, Password will be stored as a varchar(40).)
213
214
215 =cut
216
217
218 =item Comments
219
220 Returns the current value of Comments. 
221 (In the database, Comments is stored as blob.)
222
223
224
225 =item SetComments VALUE
226
227
228 Set Comments to VALUE. 
229 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
230 (In the database, Comments will be stored as a blob.)
231
232
233 =cut
234
235
236 =item Signature
237
238 Returns the current value of Signature. 
239 (In the database, Signature is stored as blob.)
240
241
242
243 =item SetSignature VALUE
244
245
246 Set Signature to VALUE. 
247 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
248 (In the database, Signature will be stored as a blob.)
249
250
251 =cut
252
253
254 =item EmailAddress
255
256 Returns the current value of EmailAddress. 
257 (In the database, EmailAddress is stored as varchar(120).)
258
259
260
261 =item SetEmailAddress VALUE
262
263
264 Set EmailAddress to VALUE. 
265 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
266 (In the database, EmailAddress will be stored as a varchar(120).)
267
268
269 =cut
270
271
272 =item FreeformContactInfo
273
274 Returns the current value of FreeformContactInfo. 
275 (In the database, FreeformContactInfo is stored as blob.)
276
277
278
279 =item SetFreeformContactInfo VALUE
280
281
282 Set FreeformContactInfo to VALUE. 
283 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
284 (In the database, FreeformContactInfo will be stored as a blob.)
285
286
287 =cut
288
289
290 =item Organization
291
292 Returns the current value of Organization. 
293 (In the database, Organization is stored as varchar(200).)
294
295
296
297 =item SetOrganization VALUE
298
299
300 Set Organization to VALUE. 
301 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
302 (In the database, Organization will be stored as a varchar(200).)
303
304
305 =cut
306
307
308 =item RealName
309
310 Returns the current value of RealName. 
311 (In the database, RealName is stored as varchar(120).)
312
313
314
315 =item SetRealName VALUE
316
317
318 Set RealName to VALUE. 
319 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
320 (In the database, RealName will be stored as a varchar(120).)
321
322
323 =cut
324
325
326 =item NickName
327
328 Returns the current value of NickName. 
329 (In the database, NickName is stored as varchar(16).)
330
331
332
333 =item SetNickName VALUE
334
335
336 Set NickName to VALUE. 
337 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
338 (In the database, NickName will be stored as a varchar(16).)
339
340
341 =cut
342
343
344 =item Lang
345
346 Returns the current value of Lang. 
347 (In the database, Lang is stored as varchar(16).)
348
349
350
351 =item SetLang VALUE
352
353
354 Set Lang to VALUE. 
355 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
356 (In the database, Lang will be stored as a varchar(16).)
357
358
359 =cut
360
361
362 =item EmailEncoding
363
364 Returns the current value of EmailEncoding. 
365 (In the database, EmailEncoding is stored as varchar(16).)
366
367
368
369 =item SetEmailEncoding VALUE
370
371
372 Set EmailEncoding to VALUE. 
373 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
374 (In the database, EmailEncoding will be stored as a varchar(16).)
375
376
377 =cut
378
379
380 =item WebEncoding
381
382 Returns the current value of WebEncoding. 
383 (In the database, WebEncoding is stored as varchar(16).)
384
385
386
387 =item SetWebEncoding VALUE
388
389
390 Set WebEncoding to VALUE. 
391 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
392 (In the database, WebEncoding will be stored as a varchar(16).)
393
394
395 =cut
396
397
398 =item ExternalContactInfoId
399
400 Returns the current value of ExternalContactInfoId. 
401 (In the database, ExternalContactInfoId is stored as varchar(100).)
402
403
404
405 =item SetExternalContactInfoId VALUE
406
407
408 Set ExternalContactInfoId to VALUE. 
409 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
410 (In the database, ExternalContactInfoId will be stored as a varchar(100).)
411
412
413 =cut
414
415
416 =item ContactInfoSystem
417
418 Returns the current value of ContactInfoSystem. 
419 (In the database, ContactInfoSystem is stored as varchar(30).)
420
421
422
423 =item SetContactInfoSystem VALUE
424
425
426 Set ContactInfoSystem to VALUE. 
427 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
428 (In the database, ContactInfoSystem will be stored as a varchar(30).)
429
430
431 =cut
432
433
434 =item ExternalAuthId
435
436 Returns the current value of ExternalAuthId. 
437 (In the database, ExternalAuthId is stored as varchar(100).)
438
439
440
441 =item SetExternalAuthId VALUE
442
443
444 Set ExternalAuthId to VALUE. 
445 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
446 (In the database, ExternalAuthId will be stored as a varchar(100).)
447
448
449 =cut
450
451
452 =item AuthSystem
453
454 Returns the current value of AuthSystem. 
455 (In the database, AuthSystem is stored as varchar(30).)
456
457
458
459 =item SetAuthSystem VALUE
460
461
462 Set AuthSystem to VALUE. 
463 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
464 (In the database, AuthSystem will be stored as a varchar(30).)
465
466
467 =cut
468
469
470 =item Gecos
471
472 Returns the current value of Gecos. 
473 (In the database, Gecos is stored as varchar(16).)
474
475
476
477 =item SetGecos VALUE
478
479
480 Set Gecos to VALUE. 
481 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
482 (In the database, Gecos will be stored as a varchar(16).)
483
484
485 =cut
486
487
488 =item HomePhone
489
490 Returns the current value of HomePhone. 
491 (In the database, HomePhone is stored as varchar(30).)
492
493
494
495 =item SetHomePhone VALUE
496
497
498 Set HomePhone to VALUE. 
499 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
500 (In the database, HomePhone will be stored as a varchar(30).)
501
502
503 =cut
504
505
506 =item WorkPhone
507
508 Returns the current value of WorkPhone. 
509 (In the database, WorkPhone is stored as varchar(30).)
510
511
512
513 =item SetWorkPhone VALUE
514
515
516 Set WorkPhone to VALUE. 
517 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
518 (In the database, WorkPhone will be stored as a varchar(30).)
519
520
521 =cut
522
523
524 =item MobilePhone
525
526 Returns the current value of MobilePhone. 
527 (In the database, MobilePhone is stored as varchar(30).)
528
529
530
531 =item SetMobilePhone VALUE
532
533
534 Set MobilePhone to VALUE. 
535 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
536 (In the database, MobilePhone will be stored as a varchar(30).)
537
538
539 =cut
540
541
542 =item PagerPhone
543
544 Returns the current value of PagerPhone. 
545 (In the database, PagerPhone is stored as varchar(30).)
546
547
548
549 =item SetPagerPhone VALUE
550
551
552 Set PagerPhone to VALUE. 
553 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
554 (In the database, PagerPhone will be stored as a varchar(30).)
555
556
557 =cut
558
559
560 =item Address1
561
562 Returns the current value of Address1. 
563 (In the database, Address1 is stored as varchar(200).)
564
565
566
567 =item SetAddress1 VALUE
568
569
570 Set Address1 to VALUE. 
571 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
572 (In the database, Address1 will be stored as a varchar(200).)
573
574
575 =cut
576
577
578 =item Address2
579
580 Returns the current value of Address2. 
581 (In the database, Address2 is stored as varchar(200).)
582
583
584
585 =item SetAddress2 VALUE
586
587
588 Set Address2 to VALUE. 
589 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
590 (In the database, Address2 will be stored as a varchar(200).)
591
592
593 =cut
594
595
596 =item City
597
598 Returns the current value of City. 
599 (In the database, City is stored as varchar(100).)
600
601
602
603 =item SetCity VALUE
604
605
606 Set City to VALUE. 
607 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
608 (In the database, City will be stored as a varchar(100).)
609
610
611 =cut
612
613
614 =item State
615
616 Returns the current value of State. 
617 (In the database, State is stored as varchar(100).)
618
619
620
621 =item SetState VALUE
622
623
624 Set State to VALUE. 
625 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
626 (In the database, State will be stored as a varchar(100).)
627
628
629 =cut
630
631
632 =item Zip
633
634 Returns the current value of Zip. 
635 (In the database, Zip is stored as varchar(16).)
636
637
638
639 =item SetZip VALUE
640
641
642 Set Zip to VALUE. 
643 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
644 (In the database, Zip will be stored as a varchar(16).)
645
646
647 =cut
648
649
650 =item Country
651
652 Returns the current value of Country. 
653 (In the database, Country is stored as varchar(50).)
654
655
656
657 =item SetCountry VALUE
658
659
660 Set Country to VALUE. 
661 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
662 (In the database, Country will be stored as a varchar(50).)
663
664
665 =cut
666
667
668 =item Timezone
669
670 Returns the current value of Timezone. 
671 (In the database, Timezone is stored as varchar(50).)
672
673
674
675 =item SetTimezone VALUE
676
677
678 Set Timezone to VALUE. 
679 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
680 (In the database, Timezone will be stored as a varchar(50).)
681
682
683 =cut
684
685
686 =item PGPKey
687
688 Returns the current value of PGPKey. 
689 (In the database, PGPKey is stored as text.)
690
691
692
693 =item SetPGPKey VALUE
694
695
696 Set PGPKey to VALUE. 
697 Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
698 (In the database, PGPKey will be stored as a text.)
699
700
701 =cut
702
703
704 =item Creator
705
706 Returns the current value of Creator. 
707 (In the database, Creator is stored as int(11).)
708
709
710 =cut
711
712
713 =item Created
714
715 Returns the current value of Created. 
716 (In the database, Created is stored as datetime.)
717
718
719 =cut
720
721
722 =item LastUpdatedBy
723
724 Returns the current value of LastUpdatedBy. 
725 (In the database, LastUpdatedBy is stored as int(11).)
726
727
728 =cut
729
730
731 =item LastUpdated
732
733 Returns the current value of LastUpdated. 
734 (In the database, LastUpdated is stored as datetime.)
735
736
737 =cut
738
739
740
741 sub _ClassAccessible {
742     {
743      
744         id =>
745                 {read => 1, type => 'int(11)', default => ''},
746         Name => 
747                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
748         Password => 
749                 {read => 1, write => 1, type => 'varchar(40)', default => ''},
750         Comments => 
751                 {read => 1, write => 1, type => 'blob', default => ''},
752         Signature => 
753                 {read => 1, write => 1, type => 'blob', default => ''},
754         EmailAddress => 
755                 {read => 1, write => 1, type => 'varchar(120)', default => ''},
756         FreeformContactInfo => 
757                 {read => 1, write => 1, type => 'blob', default => ''},
758         Organization => 
759                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
760         RealName => 
761                 {read => 1, write => 1, type => 'varchar(120)', default => ''},
762         NickName => 
763                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
764         Lang => 
765                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
766         EmailEncoding => 
767                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
768         WebEncoding => 
769                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
770         ExternalContactInfoId => 
771                 {read => 1, write => 1, type => 'varchar(100)', default => ''},
772         ContactInfoSystem => 
773                 {read => 1, write => 1, type => 'varchar(30)', default => ''},
774         ExternalAuthId => 
775                 {read => 1, write => 1, type => 'varchar(100)', default => ''},
776         AuthSystem => 
777                 {read => 1, write => 1, type => 'varchar(30)', default => ''},
778         Gecos => 
779                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
780         HomePhone => 
781                 {read => 1, write => 1, type => 'varchar(30)', default => ''},
782         WorkPhone => 
783                 {read => 1, write => 1, type => 'varchar(30)', default => ''},
784         MobilePhone => 
785                 {read => 1, write => 1, type => 'varchar(30)', default => ''},
786         PagerPhone => 
787                 {read => 1, write => 1, type => 'varchar(30)', default => ''},
788         Address1 => 
789                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
790         Address2 => 
791                 {read => 1, write => 1, type => 'varchar(200)', default => ''},
792         City => 
793                 {read => 1, write => 1, type => 'varchar(100)', default => ''},
794         State => 
795                 {read => 1, write => 1, type => 'varchar(100)', default => ''},
796         Zip => 
797                 {read => 1, write => 1, type => 'varchar(16)', default => ''},
798         Country => 
799                 {read => 1, write => 1, type => 'varchar(50)', default => ''},
800         Timezone => 
801                 {read => 1, write => 1, type => 'varchar(50)', default => ''},
802         PGPKey => 
803                 {read => 1, write => 1, type => 'text', default => ''},
804         Creator => 
805                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
806         Created => 
807                 {read => 1, auto => 1, type => 'datetime', default => ''},
808         LastUpdatedBy => 
809                 {read => 1, auto => 1, type => 'int(11)', default => '0'},
810         LastUpdated => 
811                 {read => 1, auto => 1, type => 'datetime', default => ''},
812
813  }
814 };
815
816
817         eval "require RT::User_Overlay";
818         if ($@ && $@ !~ qr{^Can't locate RT/User_Overlay.pm}) {
819             die $@;
820         };
821
822         eval "require RT::User_Vendor";
823         if ($@ && $@ !~ qr{^Can't locate RT/User_Vendor.pm}) {
824             die $@;
825         };
826
827         eval "require RT::User_Local";
828         if ($@ && $@ !~ qr{^Can't locate RT/User_Local.pm}) {
829             die $@;
830         };
831
832
833
834
835 =head1 SEE ALSO
836
837 This class allows "overlay" methods to be placed
838 into the following files _Overlay is for a System overlay by the original author,
839 _Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.  
840
841 These overlay files can contain new subs or subs to replace existing subs in this module.
842
843 If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line 
844
845    no warnings qw(redefine);
846
847 so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
848
849 RT::User_Overlay, RT::User_Vendor, RT::User_Local
850
851 =cut
852
853
854 1;