2 FS::UID - Subroutines for database login and assorted other
6 use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker
7 checkeuid checkruid swapuid);
13 $dbh = cgisuidsetup($cgi);
20 Provides a hodgepodge of subroutines.
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).
29 dbh Returns the DBI database handle.
32 Returns the DBI data source.
35 Returns the current Freeside user. Currently that means the
36 CGI REMOTE_USER, or 'freeside'.
39 Returns true if effective UID is that of the freeside user.
42 Returns true if the real UID is that of the freeside user.
45 Swaps real and effective UIDs.
50 No capabilities yet. When mod_perl and Authen::DBI are
51 implemented, cgisuidsetup will go away as well.
54 the FS::Record manpage, the CGI::Base manpage, the DBI manpage
57 ivan@voicenet.com 97-jun-4 - 9 untaint otaker ivan@voicenet.com
60 generalize and auto-get uid (getotaker still needs to be db'ed)
61 ivan@sisd.com 97-nov-10
63 &cgisuidsetup logs into database. other cleaning. ivan@sisd.com
66 &adminsuidsetup logs into database with otaker='freeside' (for
67 automated tasks like billing) ivan@sisd.com 97-dec-13
69 added sub datasrc for fs-setup ivan@sisd.com 98-feb-21
71 datasrc, user and pass now come from conf/secrets ivan@sisd.com
74 added ChopBlanks to DBI call (see man DBI) ivan@sisd.com 98-aug-
77 pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup,
78 inlined suidsetup ivan@sisd.com 98-sep-12