<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://secure.freeside.biz/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Freeside%3A4%3ADocumentation%3ADeveloper%2FFS%2FUID</id>
		<title>Freeside:4:Documentation:Developer/FS/UID - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://secure.freeside.biz/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Freeside%3A4%3ADocumentation%3ADeveloper%2FFS%2FUID"/>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/UID&amp;action=history"/>
		<updated>2026-08-13T12:07:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://secure.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/UID&amp;diff=9387&amp;oldid=prev</id>
		<title>Jeremyd: Edit via perl MediaWiki framework (1.13)</title>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/UID&amp;diff=9387&amp;oldid=prev"/>
				<updated>2015-11-18T15:31:32Z</updated>
		
		<summary type="html">&lt;p&gt;Edit via perl MediaWiki framework (1.13)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==NAME==&lt;br /&gt;
FS::UID - Subroutines for database login and assorted other stuff&lt;br /&gt;
&lt;br /&gt;
==SYNOPSIS==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  use FS::UID qw(adminsuidsetup dbh datasrc checkeuid checkruid);&lt;br /&gt;
 &lt;br /&gt;
  $dbh = adminsuidsetup $user;&lt;br /&gt;
 &lt;br /&gt;
  $dbh = dbh;&lt;br /&gt;
 &lt;br /&gt;
  $datasrc = datasrc;&lt;br /&gt;
 &lt;br /&gt;
  $driver_name = driver_name;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==DESCRIPTION==&lt;br /&gt;
Provides a hodgepodge of subroutines.&lt;br /&gt;
&lt;br /&gt;
==SUBROUTINES==&lt;br /&gt;
; adminsuidsetup USER&lt;br /&gt;
:Sets the user to USER (see config.html from the base documentation). Cleans the environment. Make sure the script is running as freeside, or setuid freeside. Opens a connection to the database. Runs any defined callbacks (see below). Returns the DBI database handle (usually you don't need this).&lt;br /&gt;
; install_callback&lt;br /&gt;
:A package can install a callback to be run in adminsuidsetup by passing a coderef to the FS::UID-&amp;gt;install_callback class method. If adminsuidsetup has run already, the callback will also be run immediately.&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    $coderef = sub { warn &amp;quot;Hi, I'm returning your call!&amp;quot; };&lt;br /&gt;
    FS::UID-&amp;gt;install_callback($coderef);&lt;br /&gt;
 &lt;br /&gt;
    install_callback FS::UID sub { &lt;br /&gt;
      warn &amp;quot;Hi, I'm returning your call!&amp;quot;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
; cgi&lt;br /&gt;
:Returns the CGI (see [[Freeside:4:Documentation:Developer/CGI|CGI]]) object.&lt;br /&gt;
; cgi CGI_OBJECT&lt;br /&gt;
:Sets the CGI (see [[Freeside:4:Documentation:Developer/CGI|CGI]]) object.&lt;br /&gt;
; dbh&lt;br /&gt;
:Returns the DBI database handle.&lt;br /&gt;
; datasrc&lt;br /&gt;
:Returns the DBI data source.&lt;br /&gt;
; driver_name&lt;br /&gt;
:Returns just the driver name portion of the DBI data source.&lt;br /&gt;
; getotaker&lt;br /&gt;
:(Deprecated) Returns the current Freeside user's username.&lt;br /&gt;
; checkeuid&lt;br /&gt;
:Returns true if effective UID is that of the freeside user.&lt;br /&gt;
; checkruid&lt;br /&gt;
:Returns true if the real UID is that of the freeside user.&lt;br /&gt;
; getsecrets&lt;br /&gt;
:Sets and returns the DBI datasource, username and password from the `/usr/local/etc/freeside/secrets' file.&lt;br /&gt;
&lt;br /&gt;
==CALLBACKS==&lt;br /&gt;
Warning: this interface is (still) likely to change in future releases.&lt;br /&gt;
&lt;br /&gt;
New (experimental) callback interface:&lt;br /&gt;
&lt;br /&gt;
A package can install a callback to be run in adminsuidsetup by passing a coderef to the FS::UID-&amp;gt;install_callback class method. If adminsuidsetup has run already, the callback will also be run immediately.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    $coderef = sub { warn &amp;quot;Hi, I'm returning your call!&amp;quot; };&lt;br /&gt;
    FS::UID-&amp;gt;install_callback($coderef);&lt;br /&gt;
 &lt;br /&gt;
    install_callback FS::UID sub { &lt;br /&gt;
      warn &amp;quot;Hi, I'm returning your call!&amp;quot;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Old (deprecated) callback interface:&lt;br /&gt;
&lt;br /&gt;
A package can install a callback to be run in adminsuidsetup by putting a coderef into the hash %FS::UID::callback :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    $coderef = sub { warn &amp;quot;Hi, I'm returning your call!&amp;quot; };&lt;br /&gt;
    $FS::UID::callback{'Package::Name'} = $coderef;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==BUGS==&lt;br /&gt;
Too many package-global variables.&lt;br /&gt;
&lt;br /&gt;
Not OO.&lt;br /&gt;
&lt;br /&gt;
No capabilities yet. (What does this mean again?)&lt;br /&gt;
&lt;br /&gt;
Goes through contortions to support non-OO syntax with multiple datasrc's.&lt;br /&gt;
&lt;br /&gt;
Callbacks are (still) inelegant.&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
[[Freeside:4:Documentation:Developer/FS/Record|FS::Record]], [[Freeside:4:Documentation:Developer/CGI|CGI]], [[Freeside:4:Documentation:Developer/DBI|DBI]], config.html from the base documentation.&lt;/div&gt;</summary>
		<author><name>Jeremyd</name></author>	</entry>

	</feed>