2 FS::UID - Subroutines for database login and assorted other
6 use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker
7 checkeuid checkruid swapuid);
12 $dbh = cgisuidsetup($cgi);
19 Provides a hodgepodge of subroutines.
23 Sets the user to USER (see config.html from the base
24 documentation). Cleans the environment. Make sure the script
25 is running as freeside, or setuid freeside. Opens a
26 connection to the database. Swaps real and effective UIDs.
27 Runs any defined callbacks (see below). Returns the DBI
28 database handle (usually you don't need this).
30 cgisuidsetup CGI_object
31 Stores the CGI (see the CGI manpage) object for later use.
32 (CGI::Base is depriciated) Runs adminsuidsetup.
34 cgi Returns the CGI (see the CGI manpage) object.
36 dbh Returns the DBI database handle.
39 Returns the DBI data source.
42 Returns the current Freeside user.
45 Sets and returns the CGI REMOTE_USER. $cgi should be defined
46 as a CGI.pm object. Support for CGI::Base and derived
47 classes is depriciated.
50 Returns true if effective UID is that of the freeside user.
53 Returns true if the real UID is that of the freeside user.
56 Swaps real and effective UIDs.
59 Sets the user to USER, if supplied. Sets and returns the DBI
60 datasource, username and password for this user from the
61 `/usr/local/etc/freeside/mapsecrets' file.
64 Warning: this interface is likely to change in future releases.
66 A package can install a callback to be run in adminsuidsetup by
67 putting a coderef into the hash %FS::UID::callback :
69 $coderef = sub { warn "Hi, I'm returning your call!" };
70 $FS::UID::callback{'Package::Name'};
73 $Id: UID.txt,v 1.3 1999-02-09 09:37:52 ivan Exp $
76 Too many package-global variables.
80 No capabilities yet. When mod_perl and Authen::DBI are
81 implemented, cgisuidsetup will go away as well.
83 Goes through contortions to support non-OO syntax with multiple
86 Callbacks are inelegant.
89 the FS::Record manpage, the CGI manpage, the DBI manpage,
90 config.html from the base documentation.
93 ivan@voicenet.com 97-jun-4 - 9 untaint otaker ivan@voicenet.com
96 generalize and auto-get uid (getotaker still needs to be db'ed)
97 ivan@sisd.com 97-nov-10
99 &cgisuidsetup logs into database. other cleaning. ivan@sisd.com
102 &adminsuidsetup logs into database with otaker='freeside' (for
103 automated tasks like billing) ivan@sisd.com 97-dec-13
105 added sub datasrc for fs-setup ivan@sisd.com 98-feb-21
107 datasrc, user and pass now come from conf/secrets ivan@sisd.com
110 added ChopBlanks to DBI call (see man DBI) ivan@sisd.com 98-aug-
113 pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup,
114 inlined suidsetup ivan@sisd.com 98-sep-12
117 Revision 1.3 1999-02-09 09:37:52 ivan
118 regenerated perl api docs from embedded pod
119 Revision 1.7 1999/01/18 09:22:40 ivan changes
120 to track email addresses for email invoicing
122 Revision 1.6 1998/11/15 05:27:48 ivan bugfix for new
125 Revision 1.5 1998/11/15 00:51:51 ivan eliminated some warnings
126 on certain fatal errors (well, it is less confusing)
128 Revision 1.4 1998/11/13 09:56:52 ivan change configuration file
129 layout to support multiple distinct databases (with own set of
130 config files, export, etc.)
132 Revision 1.3 1998/11/08 10:45:42 ivan got sub cgi for FS::CGI
134 Revision 1.2 1998/11/08 09:38:43 ivan cgisuidsetup complains if
135 you pass it a isa CGI::Base instead of an isa CGI (first step in
136 migrating from CGI-modules to CGI.pm)