- md5
- 875e89750bd5c1c4918af5f1a2724c80
- sha1
- 44f8103cd4e727d7e0a08a565a38c2233c9cde26
- sha256
- 9a3dbe98f338bb2bee56adb1da2d2f198e25bf7e7b63ee388c04429f30d8d78f
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
<?php
/**
* @version $Id: example.php 21097 2011-04-07 15:38:03Z dextercowley $
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
jimport('joomla.plugin.plugin');
/**
* Example Authentication Plugin
*
* @package Joomla.Plugin
* @subpackage Authentication.example
* @since 1.5
*/
class plgAuthenticationExample extends JPlugin
{
/**
* This method should handle any authentication and report back to the subject
*
* @access public
* @param array $credentials Array holding the user credentials
* @param array $options Array of extra options
* @param object $response Authentication response object
* @return boolean
* @since 1.5
*/
function onUserAuthenticate($credentials, $options, &$response)
{
/*
* Here you would do whatever you need for an authentication routine with the credentials
*
* In this example the mixed variable $return would be set to false
* if the authentication routine fails or an integer userid of the authenticated
* user if the routine passes
*/
$success = true;
$response->type = 'Example';
if ($success)
{
$response->status = JAUTHENTICATE_STATUS_SUCCESS;
$response->error_message = '';
// You may also define other variables:
/*
$yourUser = YourClass::getUser($credentials);
$response->email = $yourUser->email;
$response->fullname = $yourUser->name;
*/
return true;
}
else
{
$response->status = JAUTHENTICATE_STATUS_FAILURE;
$response->error_message = 'Could not authenticate';
return false;
}
}
}
The same content is in 5 releases, Joomla 1.6.2 to 1.6.6. See them all, or every version of this file.