Initial revision
[freeside.git] / htdocs / docs / man / UID.txt
1 NAME
2     FS::UID - Subroutines for database login and assorted other
3     stuff
4
5 SYNOPSIS
6       use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker
7       checkeuid checkruid swapuid);
8
9       adminsuidsetup;
10
11       $cgi = new CGI::Base;
12       $cgi->get;
13       $dbh = cgisuidsetup($cgi);
14
15       $dbh = dbh;
16
17       $datasrc = datasrc;
18
19 DESCRIPTION
20     Provides a hodgepodge of subroutines.
21
22 SUBROUTINES
23     adminsuidsetup
24         Cleans the environment. Make sure the script is running as
25         freeside, or setuid freeside. Opens a connection to the
26         database. Swaps real and effective UIDs. Returns the DBI
27         database handle (usually you don't need this).
28
29     dbh Returns the DBI database handle.
30
31     datasrc
32         Returns the DBI data source.
33
34     getotaker
35         Returns the current Freeside user. Currently that means the
36         CGI REMOTE_USER, or 'freeside'.
37
38     checkeuid
39         Returns true if effective UID is that of the freeside user.
40
41     checkruid
42         Returns true if the real UID is that of the freeside user.
43
44     swapuid
45         Swaps real and effective UIDs.
46
47 BUGS
48     Not OO.
49
50     No capabilities yet. When mod_perl and Authen::DBI are
51     implemented, cgisuidsetup will go away as well.
52
53 SEE ALSO
54     the FS::Record manpage, the CGI::Base manpage, the DBI manpage
55
56 HISTORY
57     ivan@voicenet.com 97-jun-4 - 9 untaint otaker ivan@voicenet.com
58     97-jul-7
59
60     generalize and auto-get uid (getotaker still needs to be db'ed)
61     ivan@sisd.com 97-nov-10
62
63     &cgisuidsetup logs into database. other cleaning. ivan@sisd.com
64     97-nov-22,23
65
66     &adminsuidsetup logs into database with otaker='freeside' (for
67     automated tasks like billing) ivan@sisd.com 97-dec-13
68
69     added sub datasrc for fs-setup ivan@sisd.com 98-feb-21
70
71     datasrc, user and pass now come from conf/secrets ivan@sisd.com
72     98-jun-28
73
74     added ChopBlanks to DBI call (see man DBI) ivan@sisd.com 98-aug-
75     16
76
77     pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup,
78     inlined suidsetup ivan@sisd.com 98-sep-12
79