Prv8 Shell
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4
System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64
User : jackjohn ( 502)
PHP Version : 5.3.17
Disable Function : NONE
Directory :  /proc/self/cwd/imagemanager/docs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/cwd/imagemanager/docs/custom_authentication.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Custom authentication</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="header">
	<h1>Custom authentication</h1>
</div>

<div class="content">
	<p>ImageManager if created to be easy to integrate with existing server applications such as CMS systems, web hosting controllers or LMS systems. So the most common need is to handle authentication of end users.</p>

	<div class="separator"></div>

	<h2>Writing your own authentication plug in</h2>
	<div class="section">
		<p>The most common need for integration is with a systems authentication logic.
		  Verify the level of access the end user has to the system. ImageManager
		  comes with a built in session authenticator, this authenticator simply
		  checks for two named session variables. But some times more custom
		  logic is required, then you can extend the build in authenticator logic
		  by writing an authenticator plug in.</p>
		<p>A authenticator plug in is a PHP class that extends the BaseAuthenicator class located in  &quot;imagemanager\classes\Authenticators\BaseAuthenticator.php&quot;. The default behavior of this base class is that everyone is logged in and the user isn't added to any groups. This behavior can easily be changed if you subclass it and extend the base methods with your logic.</p>
		<h3>Example of a custom Authenticator class:</h3>
		<div class="example">
<pre>
class MyAuthenticator extends BaseAuthenticator {
    function MyAuthenticator() {
        // Your custom constructor code
    }

    function init(&$config) {
        // Your custom initialization code
        $config['some.config.option'] = "new value";
    }

    function getGroups() {
        return "mygroup1,mygroup2";
    }

    function isLoggedin() {
        if ($something)
            return true;

        return false;
    }
}
</pre>
		</div>
		<p>The example above changes a specific config value when it initializes, returns two groups and checks the $something variable to verify access. For more details on the specific methods in BaseAuthenticator consult the API documentation.</p>
	</div>
</div>

<div class="footer">
	<div class="helpindexlink"><a href="index.html">Help index</a></div>
	<div class="copyright">Copyright &copy; 2005-2006 Moxiecode Systems AB</div>
	<br style="clear: both" />
</div>

</body>
</html>

haha - 2025