summaryrefslogtreecommitdiff
path: root/htdocs/docs/man/UID.txt
blob: bf9f6b4bdc326b86d48070f2da7b631d050d65c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
NAME
    FS::UID - Subroutines for database login and assorted other
    stuff

SYNOPSIS
      use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker
      checkeuid checkruid swapuid);

      adminsuidsetup;

      $cgi = new CGI::Base;
      $cgi->get;
      $dbh = cgisuidsetup($cgi);

      $dbh = dbh;

      $datasrc = datasrc;

DESCRIPTION
    Provides a hodgepodge of subroutines.

SUBROUTINES
    adminsuidsetup
        Cleans the environment. Make sure the script is running as
        freeside, or setuid freeside. Opens a connection to the
        database. Swaps real and effective UIDs. Returns the DBI
        database handle (usually you don't need this).

    dbh Returns the DBI database handle.

    datasrc
        Returns the DBI data source.

    getotaker
        Returns the current Freeside user. Currently that means the
        CGI REMOTE_USER, or 'freeside'.

    checkeuid
        Returns true if effective UID is that of the freeside user.

    checkruid
        Returns true if the real UID is that of the freeside user.

    swapuid
        Swaps real and effective UIDs.

BUGS
    Not OO.

    No capabilities yet. When mod_perl and Authen::DBI are
    implemented, cgisuidsetup will go away as well.

SEE ALSO
    the FS::Record manpage, the CGI::Base manpage, the DBI manpage

HISTORY
    ivan@voicenet.com 97-jun-4 - 9 untaint otaker ivan@voicenet.com
    97-jul-7

    generalize and auto-get uid (getotaker still needs to be db'ed)
    ivan@sisd.com 97-nov-10

    &cgisuidsetup logs into database. other cleaning. ivan@sisd.com
    97-nov-22,23

    &adminsuidsetup logs into database with otaker='freeside' (for
    automated tasks like billing) ivan@sisd.com 97-dec-13

    added sub datasrc for fs-setup ivan@sisd.com 98-feb-21

    datasrc, user and pass now come from conf/secrets ivan@sisd.com
    98-jun-28

    added ChopBlanks to DBI call (see man DBI) ivan@sisd.com 98-aug-
    16

    pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup,
    inlined suidsetup ivan@sisd.com 98-sep-12