davical/docs/api/davical/authentication/_inc---auth-functions.php.html
2010-02-23 23:28:21 +13:00

199 lines
9.3 KiB
HTML

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- template designed by Marco Von Ballmoos -->
<title>Docs for page auth-functions.php</title>
<link rel="stylesheet" href="../../media/stylesheet.css" />
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
</head>
<body>
<div class="page-body">
<h2 class="file-name"><img src="../../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/inc/auth-functions.php</h2>
<a name="sec-description"></a>
<div class="info-box">
<div class="info-box-title">Description</div>
<div class="nav-bar">
<span class="disabled">Description</span> |
<a href="#sec-includes">Includes</a>
| <a href="#sec-functions">Functions</a>
</div>
<div class="info-box-body">
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The authentication handling plugins can be used by the Session class to provide authentication.</p>
<p class="description"><p>Each authenticate hook needs to: <ul><li>Accept a username / password</li><li>Confirm the username / password are correct</li><li>Create (or update) a 'usr' record in our database</li><li>Return the 'usr' record as an object</li><li>Return === false when authentication fails</li></ul> It can expect that: <ul><li>Configuration data will be in $c-&gt;authenticate_hook['config'], which might be an array, or whatever is needed.</li></ul> In order to be called: <ul><li>This file should be included</li><li>$c-&gt;authenticate_hook['call'] should be set to the name of the plugin</li><li>$c-&gt;authenticate_hook['config'] should be set up with any configuration data for the plugin</li></ul></p></p>
<ul class="tags">
<li><span class="field">author:</span> Andrew McMillan &lt;<a href="mailto:andrew@mcmillan.net.nz">andrew@mcmillan.net.nz</a>&gt;</li>
<li><span class="field">copyright:</span> Catalyst IT Ltd, Morphoss Ltd</li>
<li><span class="field">license:</span> <a href="http://gnu.org/copyleft/gpl.html">GNU GPL v2 or later</a></li>
</ul>
</div>
</div>
<a name="sec-includes"></a>
<div class="info-box">
<div class="info-box-title">Includes</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<span class="disabled">Includes</span>
| <a href="#sec-functions">Functions</a>
</div>
<div class="info-box-body">
<a name="_DataUpdate_php"><!-- --></a>
<div class="evenrow">
<div>
<img src="../../media/images/Page.png" alt=" " />
<span class="include-title">
<span class="include-type">require_once</span>
(<span class="include-name">"DataUpdate.php"</span>)
(line <span class="line-number">28</span>)
</span>
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The authentication handling plugins can be used by the Session class to provide authentication.</p>
<p class="description"><p>Each authenticate hook needs to: <ul><li>Accept a username / password</li><li>Confirm the username / password are correct</li><li>Create (or update) a 'usr' record in our database</li><li>Return the 'usr' record as an object</li><li>Return === false when authentication fails</li></ul> It can expect that: <ul><li>Configuration data will be in $c-&gt;authenticate_hook['config'], which might be an array, or whatever is needed.</li></ul> In order to be called: <ul><li>This file should be included</li><li>$c-&gt;authenticate_hook['call'] should be set to the name of the plugin</li><li>$c-&gt;authenticate_hook['config'] should be set up with any configuration data for the plugin</li></ul></p></p>
<ul class="tags">
<li><span class="field">author:</span> Andrew McMillan &lt;<a href="mailto:andrew@mcmillan.net.nz">andrew@mcmillan.net.nz</a>&gt;</li>
<li><span class="field">copyright:</span> Catalyst IT Ltd, Morphoss Ltd</li>
<li><span class="field">license:</span> <a href="http://gnu.org/copyleft/gpl.html">GNU GPL v2 or later</a></li>
</ul>
</div>
</div>
</div>
<a name="sec-functions"></a>
<div class="info-box">
<div class="info-box-title">Functions</div>
<div class="nav-bar">
<a href="#sec-description">Description</a> |
<a href="#sec-includes">Includes</a>
| <span class="disabled">Functions</span>
</div>
<div class="info-box-body">
<a name="functionAuthExternalAWL" id="functionAuthExternalAWL"><!-- --></a>
<div class="oddrow">
<div>
<img src="../../media/images/Function.png" />
<span class="method-title">AuthExternalAWL</span> (line <span class="line-number">145</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Authenticate against a different PostgreSQL database which contains a usr table in the AWL format.</p>
<p class="description"><p>Use this as in the following example config snippet:</p><p>require_once('auth-functions.php'); $c-&gt;authenticate_hook = array( 'call' =&gt; 'AuthExternalAwl', 'config' =&gt; array( // A PgSQL database connection string for the database containing user records 'connection' =&gt; 'dbname=wrms host=otherhost port=5433 user=general', // Which columns should be fetched from the database 'columns' =&gt; &quot;user_no, active, email_ok, joined, last_update AS updated, last_used, username, password, fullname, email&quot;, // a WHERE clause to limit the records returned. 'where' =&gt; &quot;active AND org_code=7&quot; ) );</p></p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
AuthExternalAWL
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">$username</span>, <span class="var-type"></span>&nbsp;<span class="var-name">$password</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type"></span>
<span class="var-name">$username</span> </li>
<li>
<span class="var-type"></span>
<span class="var-name">$password</span> </li>
</ul>
</div>
<a name="functionCreateDefaultRelationships" id="functionCreateDefaultRelationships"><!-- --></a>
<div class="evenrow">
<div>
<img src="../../media/images/Function.png" />
<span class="method-title">CreateDefaultRelationships</span> (line <span class="line-number">62</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Defunct function for creating default relationships.</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
CreateDefaultRelationships
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$username</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$username</span><span class="var-description">: The username of the user we are creating relationships for.</span> </li>
</ul>
</div>
<a name="functionCreateHomeCalendar" id="functionCreateHomeCalendar"><!-- --></a>
<div class="oddrow">
<div>
<img src="../../media/images/Function.png" />
<span class="method-title">CreateHomeCalendar</span> (line <span class="line-number">35</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create a default home calendar for the user.</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
CreateHomeCalendar
</span>
(<span class="var-type">string</span>&nbsp;<span class="var-name">$username</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">string</span>
<span class="var-name">$username</span><span class="var-description">: The username of the user we are creating relationships for.</span> </li>
</ul>
</div>
<a name="functionUpdateUserFromExternal" id="functionUpdateUserFromExternal"><!-- --></a>
<div class="evenrow">
<div>
<img src="../../media/images/Function.png" />
<span class="method-title">UpdateUserFromExternal</span> (line <span class="line-number">71</span>)
</div>
<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Update the local cache of the remote user details</p>
<div class="method-signature">
<span class="method-result">void</span>
<span class="method-name">
UpdateUserFromExternal
</span>
(<span class="var-type"></span>&nbsp;<span class="var-name">&$usr</span>, <span class="var-type">object</span>&nbsp;<span class="var-name">$usr</span>)
</div>
<ul class="parameters">
<li>
<span class="var-type">object</span>
<span class="var-name">$usr</span><span class="var-description">: The user details we read from the remote.</span> </li>
<li>
<span class="var-type"></span>
<span class="var-name">&$usr</span> </li>
</ul>
</div>
</div>
</div>
<p class="notes" id="credit">
Documentation generated on Tue, 23 Feb 2010 23:26:30 +1300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
</p>
</div></body>
</html>